Showing
4 changed files
with
20 additions
and
4 deletions
@@ -61,12 +61,12 @@ public class GrassTopicController { | @@ -61,12 +61,12 @@ public class GrassTopicController { | ||
61 | return topicService.changeTopicHotStatus(req); | 61 | return topicService.changeTopicHotStatus(req); |
62 | } | 62 | } |
63 | 63 | ||
64 | - /*@RequestMapping("/getAllTopic") | 64 | + @RequestMapping("/getAllTopic") |
65 | @ResponseBody | 65 | @ResponseBody |
66 | public ApiResponse getAllTopic(){ | 66 | public ApiResponse getAllTopic(){ |
67 | - List<TopicRespBo> result = topicService.getAllTopic(); | 67 | + List<TopicRespBo> result = topicService.selectAllTopic(); |
68 | return new ApiResponse.ApiResponseBuilder().data(result).build(); | 68 | return new ApiResponse.ApiResponseBuilder().data(result).build(); |
69 | - }*/ | 69 | + } |
70 | 70 | ||
71 | @RequestMapping("/addArticlesTop") | 71 | @RequestMapping("/addArticlesTop") |
72 | @ResponseBody | 72 | @ResponseBody |
@@ -17,6 +17,9 @@ public interface ITopicService { | @@ -17,6 +17,9 @@ public interface ITopicService { | ||
17 | 17 | ||
18 | List<TopicRespBo> grassTopicByGroupId(GrassTopicReq req); | 18 | List<TopicRespBo> grassTopicByGroupId(GrassTopicReq req); |
19 | 19 | ||
20 | + List<TopicRespBo> selectAllTopic(); | ||
21 | + | ||
22 | + | ||
20 | void changeTopicStatus(GrassTopicReq req); | 23 | void changeTopicStatus(GrassTopicReq req); |
21 | 24 | ||
22 | ApiResponse changeTopicHotStatus(GrassTopicReq req); | 25 | ApiResponse changeTopicHotStatus(GrassTopicReq req); |
@@ -178,6 +178,19 @@ public class TopicServiceImpl implements ITopicService { | @@ -178,6 +178,19 @@ public class TopicServiceImpl implements ITopicService { | ||
178 | return rsp; | 178 | return rsp; |
179 | } | 179 | } |
180 | 180 | ||
181 | + @Override | ||
182 | + public List<TopicRespBo> selectAllTopic() { | ||
183 | + List<TopicRespBo> rsp = Lists.newArrayList(); | ||
184 | + List<GrassTopic> topicList = grassTopicDAO.selectUsingTopics(); | ||
185 | + topicList.forEach(grassTopic -> { | ||
186 | + TopicRespBo rspbo = new TopicRespBo(); | ||
187 | + rspbo.setId(grassTopic.getId()); | ||
188 | + rspbo.setTopicName(grassTopic.getTopicName()); | ||
189 | + rsp.add(rspbo); | ||
190 | + }); | ||
191 | + return rsp; | ||
192 | + } | ||
193 | + | ||
181 | //转换 | 194 | //转换 |
182 | private List<TopicRespBo> convertTopicRespBo(List<GrassTopic> sourceList) { | 195 | private List<TopicRespBo> convertTopicRespBo(List<GrassTopic> sourceList) { |
183 | if(CollectionUtils.isEmpty(sourceList)){ | 196 | if(CollectionUtils.isEmpty(sourceList)){ |
@@ -247,7 +247,7 @@ | @@ -247,7 +247,7 @@ | ||
247 | required: false, | 247 | required: false, |
248 | prompt: "请选择话题", | 248 | prompt: "请选择话题", |
249 | selectOnNavigation : true, | 249 | selectOnNavigation : true, |
250 | - url : serverContextPath + "/grassTopicManage/getGrassTopicList", | 250 | + url : serverContextPath + "/grassTopicManage/getAllTopic", |
251 | loadFilter: function (data) { | 251 | loadFilter: function (data) { |
252 | var data = defaultLoadFilter(data); | 252 | var data = defaultLoadFilter(data); |
253 | data = data.list; | 253 | data = data.list; |
-
Please register or login to post a comment