| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 查询资讯分页信息(角色权限)附带点赞评论数 |
| | | * @param response |
| | | * @param article 资讯对象 |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageLikes") |
| | | public R<IPage<Article>> pageLikes(HttpServletResponse response, ArticleVo article, Query query){ |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | return R.data(articleService.pageLikes(Condition.getPage(query),article)); |
| | | } |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param article 资讯查询对象 |
| | | * @param response |
| | |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(articleService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 批量修改评论区状态 |
| | | */ |
| | | @PostMapping("/upcomment") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids,String type) { |
| | | String[] split = ids.split(","); |
| | | String strArrays = ""; |
| | | for (int i = 0; i < split.length; i++) { |
| | | strArrays += "'" + split[i] + "',"; |
| | | } |
| | | String code = strArrays.substring(0, strArrays.length() - 1); |
| | | return R.status(articleService.upcomment(code,type)); |
| | | } |
| | | } |