|
|
@@ -35,114 +35,114 @@ import java.util.List;
|
|
|
@RequestMapping("/popular/feelings")
|
|
|
public class PopularFeelingsController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private PopularFeelingsService popularFeelingsService;
|
|
|
+ @Autowired
|
|
|
+ private PopularFeelingsService popularFeelingsService;
|
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
- private PopularFeelingsPageService popularFeelingsPageService;
|
|
|
+ @Autowired
|
|
|
+ private PopularFeelingsPageService popularFeelingsPageService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private OauthService oauthService;
|
|
|
+ @Autowired
|
|
|
+ private OauthService oauthService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private SequenceService sequenceService;
|
|
|
+ @Autowired
|
|
|
+ private SequenceService sequenceService;
|
|
|
|
|
|
|
|
|
- @Permission(value = "popular.feelings.find", tags = "查询舆情监控")
|
|
|
- @PostMapping("/findPage")
|
|
|
- public Result findPage(@RequestBody QueryPopularFeelingsParam param) {
|
|
|
+ @Permission(value = "popular.feelings.find", tags = "查询舆情监控")
|
|
|
+ @PostMapping("/findPage")
|
|
|
+ public Result findPage(@RequestBody QueryPopularFeelingsParam param) {
|
|
|
|
|
|
- QueryWrapper<PopularFeelings> wrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<PopularFeelings> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
- if (StringUtils.isNotBlank(param.getTitle())) {
|
|
|
- wrapper.like("title", param.getTitle());
|
|
|
- }
|
|
|
+ if (StringUtils.isNotBlank(param.getTitle())) {
|
|
|
+ wrapper.like("title", param.getTitle());
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isNotBlank(param.getKeywords())) {
|
|
|
- wrapper.like("keywords", param.getKeywords());
|
|
|
- }
|
|
|
+ if (StringUtils.isNotBlank(param.getKeywords())) {
|
|
|
+ wrapper.like("keywords", param.getKeywords());
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isNotBlank(param.getSiteUrl())) {
|
|
|
- wrapper.like("site_url", param.getSiteUrl());
|
|
|
- }
|
|
|
+ if (StringUtils.isNotBlank(param.getSiteUrl())) {
|
|
|
+ wrapper.like("site_url", param.getSiteUrl());
|
|
|
+ }
|
|
|
|
|
|
- Page<PopularFeelings> page = param.getPage();
|
|
|
- page.addOrder(OrderItem.desc("id"));
|
|
|
+ Page<PopularFeelings> page = param.getPage();
|
|
|
+ page.addOrder(OrderItem.desc("id"));
|
|
|
|
|
|
- Page<PopularFeelings> resultData = this.popularFeelingsService.page(page, wrapper);
|
|
|
+ Page<PopularFeelings> resultData = this.popularFeelingsService.page(page, wrapper);
|
|
|
|
|
|
- return Result.instance(Result.Code.SUCCESS).setData(resultData);
|
|
|
- }
|
|
|
+ return Result.instance(Result.Code.SUCCESS).setData(resultData);
|
|
|
+ }
|
|
|
|
|
|
- @Permission(value = "popular.feelings.add", tags = "新建舆情监控")
|
|
|
- @PostMapping("/save")
|
|
|
- public Result save(@Valid @RequestBody SavePopularFeelingsParam param) throws Exception {
|
|
|
+ @Permission(value = "popular.feelings.add", tags = "新建舆情监控")
|
|
|
+ @PostMapping("/save")
|
|
|
+ public Result save(@Valid @RequestBody SavePopularFeelingsParam param) throws Exception {
|
|
|
|
|
|
- PopularFeelings entity = new PopularFeelings();
|
|
|
- BeanUtils.copyProperties(param, entity);
|
|
|
+ PopularFeelings entity = new PopularFeelings();
|
|
|
+ BeanUtils.copyProperties(param, entity);
|
|
|
|
|
|
- OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
+ OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
|
|
|
- entity.setCreatedTime(DateUtil.current());
|
|
|
- entity.setCreatedBy(oauthInfo.getId());
|
|
|
+ entity.setCreatedTime(DateUtil.current());
|
|
|
+ entity.setCreatedBy(oauthInfo.getId());
|
|
|
|
|
|
- entity.setUpdatedTime(DateUtil.current());
|
|
|
- entity.setUpdatedBy(oauthInfo.getId());
|
|
|
- entity.setId(this.sequenceService.nextId());
|
|
|
+ entity.setUpdatedTime(DateUtil.current());
|
|
|
+ entity.setUpdatedBy(oauthInfo.getId());
|
|
|
+ entity.setId(this.sequenceService.nextId());
|
|
|
|
|
|
- this.popularFeelingsService.save(entity);
|
|
|
+ this.popularFeelingsService.save(entity);
|
|
|
|
|
|
- return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
- }
|
|
|
+ return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
+ }
|
|
|
|
|
|
- @Permission(value = "popular.feelings.edit", tags = "更新舆情监控")
|
|
|
- @PostMapping("/updateById")
|
|
|
- public Result updateById(Long id, @Valid @RequestBody SavePopularFeelingsParam param) {
|
|
|
- PopularFeelings entity = new PopularFeelings();
|
|
|
- BeanUtils.copyProperties(param, entity);
|
|
|
+ @Permission(value = "popular.feelings.edit", tags = "更新舆情监控")
|
|
|
+ @PostMapping("/updateById")
|
|
|
+ public Result updateById(Long id, @Valid @RequestBody SavePopularFeelingsParam param) {
|
|
|
+ PopularFeelings entity = new PopularFeelings();
|
|
|
+ BeanUtils.copyProperties(param, entity);
|
|
|
|
|
|
- OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
+ OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
|
|
|
- entity.setUpdatedBy(oauthInfo.getId());
|
|
|
- entity.setUpdatedTime(DateUtil.current());
|
|
|
- entity.setId(id);
|
|
|
+ entity.setUpdatedBy(oauthInfo.getId());
|
|
|
+ entity.setUpdatedTime(DateUtil.current());
|
|
|
+ entity.setId(id);
|
|
|
|
|
|
- this.popularFeelingsService.updateById(entity);
|
|
|
+ this.popularFeelingsService.updateById(entity);
|
|
|
|
|
|
- return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
- }
|
|
|
+ return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
+ }
|
|
|
|
|
|
- @Permission(value = "popular.feelings.delete", tags = "删除舆情监控")
|
|
|
- @PostMapping("/deleteByIds")
|
|
|
- public Result deleteByIds(@RequestBody List<Long> ids) {
|
|
|
- this.popularFeelingsService.removeByIds(ids);
|
|
|
- return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
- }
|
|
|
+ @Permission(value = "popular.feelings.delete", tags = "删除舆情监控")
|
|
|
+ @PostMapping("/deleteByIds")
|
|
|
+ public Result deleteByIds(@RequestBody List<Long> ids) {
|
|
|
+ this.popularFeelingsService.removeByIds(ids);
|
|
|
+ return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
+ }
|
|
|
|
|
|
- @Permission(value = "popular.feelings.delete", tags = "启动舆情监控")
|
|
|
- @PostMapping("/startSpider")
|
|
|
- public Result startSpider(@RequestBody List<Long> ids) {
|
|
|
- List<PopularFeelings> listData = this.popularFeelingsService.listByIds(ids);
|
|
|
- for (PopularFeelings popularFeelings : listData) {
|
|
|
- this.popularFeelingsService.start(popularFeelings);
|
|
|
- }
|
|
|
- return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
- }
|
|
|
+ @Permission(value = "popular.feelings.delete", tags = "启动舆情监控")
|
|
|
+ @PostMapping("/startSpider")
|
|
|
+ public Result startSpider(@RequestBody List<Long> ids) {
|
|
|
+ List<PopularFeelings> listData = this.popularFeelingsService.listByIds(ids);
|
|
|
+ for (PopularFeelings popularFeelings : listData) {
|
|
|
+ this.popularFeelingsService.start(popularFeelings);
|
|
|
+ }
|
|
|
+ return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
+ }
|
|
|
|
|
|
- @Permission(value = "popular.feelings.delete", tags = "查询舆情监控详情")
|
|
|
- @PostMapping("/findDetailPage")
|
|
|
- public Result findDetailPage(@RequestBody QueryPopularFeelingsPageParam param) {
|
|
|
+ @Permission(value = "popular.feelings.delete", tags = "查询舆情监控详情")
|
|
|
+ @PostMapping("/findDetailPage")
|
|
|
+ public Result findDetailPage(@RequestBody QueryPopularFeelingsPageParam param) {
|
|
|
|
|
|
- QueryWrapper<PopularFeelingsPage> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.select("id", "popular_feelings_id", "url", "title", "spider_time");
|
|
|
- wrapper.eq("popular_feelings_id", param.getPopularFeelingsId());
|
|
|
+ QueryWrapper<PopularFeelingsPage> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.select("id", "popular_feelings_id", "url", "title", "keywords", "description", "spider_time", "update_time");
|
|
|
+ wrapper.eq("popular_feelings_id", param.getPopularFeelingsId());
|
|
|
|
|
|
- Page<PopularFeelingsPage> page = param.getPage();
|
|
|
- page.addOrder(OrderItem.desc("id"));
|
|
|
+ Page<PopularFeelingsPage> page = param.getPage();
|
|
|
+ page.addOrder(OrderItem.desc("id"));
|
|
|
|
|
|
- Page<PopularFeelingsPage> resultData = this.popularFeelingsPageService.page(page, wrapper);
|
|
|
+ Page<PopularFeelingsPage> resultData = this.popularFeelingsPageService.page(page, wrapper);
|
|
|
|
|
|
- return Result.instance(Result.Code.SUCCESS).setData(resultData);
|
|
|
- }
|
|
|
+ return Result.instance(Result.Code.SUCCESS).setData(resultData);
|
|
|
+ }
|
|
|
}
|