Authored by 张帅

话题筛选

... ... @@ -61,12 +61,12 @@ public class GrassTopicController {
return topicService.changeTopicHotStatus(req);
}
/*@RequestMapping("/getAllTopic")
@RequestMapping("/getAllTopic")
@ResponseBody
public ApiResponse getAllTopic(){
List<TopicRespBo> result = topicService.getAllTopic();
List<TopicRespBo> result = topicService.selectAllTopic();
return new ApiResponse.ApiResponseBuilder().data(result).build();
}*/
}
@RequestMapping("/addArticlesTop")
@ResponseBody
... ...
... ... @@ -17,6 +17,9 @@ public interface ITopicService {
List<TopicRespBo> grassTopicByGroupId(GrassTopicReq req);
List<TopicRespBo> selectAllTopic();
void changeTopicStatus(GrassTopicReq req);
ApiResponse changeTopicHotStatus(GrassTopicReq req);
... ...
... ... @@ -178,6 +178,19 @@ public class TopicServiceImpl implements ITopicService {
return rsp;
}
@Override
public List<TopicRespBo> selectAllTopic() {
List<TopicRespBo> rsp = Lists.newArrayList();
List<GrassTopic> topicList = grassTopicDAO.selectUsingTopics();
topicList.forEach(grassTopic -> {
TopicRespBo rspbo = new TopicRespBo();
rspbo.setId(grassTopic.getId());
rspbo.setTopicName(grassTopic.getTopicName());
rsp.add(rspbo);
});
return rsp;
}
//转换
private List<TopicRespBo> convertTopicRespBo(List<GrassTopic> sourceList) {
if(CollectionUtils.isEmpty(sourceList)){
... ...
... ... @@ -247,7 +247,7 @@
required: false,
prompt: "请选择话题",
selectOnNavigation : true,
url : serverContextPath + "/grassTopicManage/getGrassTopicList",
url : serverContextPath + "/grassTopicManage/getAllTopic",
loadFilter: function (data) {
var data = defaultLoadFilter(data);
data = data.list;
... ...