|
@@ -55,7 +55,7 @@ public class CmsChannelController {
|
|
|
}
|
|
}
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
if (!isRootRole) {
|
|
if (!isRootRole) {
|
|
|
- builder.field(ChannelView::getCreator, adminId);
|
|
|
|
|
|
|
+ builder.put("condition", String.format("FIND_IN_SET(%s,c.creator) > 0", adminId));
|
|
|
}
|
|
}
|
|
|
SearchResult<ChannelView> searchResult = beanSearcher.search(ChannelView.class,
|
|
SearchResult<ChannelView> searchResult = beanSearcher.search(ChannelView.class,
|
|
|
builder.put("time", timeSql).build());
|
|
builder.put("time", timeSql).build());
|
|
@@ -71,7 +71,7 @@ public class CmsChannelController {
|
|
|
long adminId = StpUtil.getLoginIdAsLong();
|
|
long adminId = StpUtil.getLoginIdAsLong();
|
|
|
Boolean isRootRole = cmsUserService.isRootRole(adminId);
|
|
Boolean isRootRole = cmsUserService.isRootRole(adminId);
|
|
|
if (!isRootRole) {
|
|
if (!isRootRole) {
|
|
|
- builder.field(Channel::getCreator, adminId);
|
|
|
|
|
|
|
+ builder.put("condition", String.format("FIND_IN_SET(%s,c.creator) > 0", adminId));
|
|
|
}
|
|
}
|
|
|
List<Channel> list = beanSearcher.searchAll(Channel.class, builder
|
|
List<Channel> list = beanSearcher.searchAll(Channel.class, builder
|
|
|
.onlySelect(Channel::getId, Channel::getName)
|
|
.onlySelect(Channel::getId, Channel::getName)
|
|
@@ -81,8 +81,8 @@ public class CmsChannelController {
|
|
|
|
|
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
public Result<String> post(@RequestBody Channel channel){
|
|
public Result<String> post(@RequestBody Channel channel){
|
|
|
- long adminId = StpUtil.getLoginIdAsLong();
|
|
|
|
|
- channel.setCreator(adminId);
|
|
|
|
|
|
|
+ Long adminId = StpUtil.getLoginIdAsLong();
|
|
|
|
|
+ channel.setCreator(adminId.toString());
|
|
|
channelService.save(channel);
|
|
channelService.save(channel);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|