| | |
| | | @RequestMapping(value = "/cstmr/followers/table/auth") |
| | | @ManagerAuth |
| | | public R cstmrFollowersTable(@RequestParam("cstmrId") Long cstmrId) { |
| | | List<CstmrFoll> cstmrFolls = cstmrFollService.selectList(new EntityWrapper<CstmrFoll>().eq("cstmr_id", cstmrId)); |
| | | List<CstmrFoll> cstmrFolls = cstmrFollService.selectList(new EntityWrapper<CstmrFoll>().eq("cstmr_id", cstmrId).orderBy("id", false)); |
| | | List<CstmrFollowerTableVo> result = new ArrayList<>(); |
| | | for (CstmrFoll cstmrFoll : cstmrFolls) { |
| | | User user = userService.selectById(cstmrFoll.getUserId()); |
| | |
| | | return R.ok("添加成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/cstmr/followers/remove/auth") |
| | | @ManagerAuth |
| | | public R cstmrFollowersRemove(@RequestParam("cstmrId") Long cstmrId, |
| | | @RequestParam("userId") Long userId) { |
| | | if (Cools.isEmpty(cstmrId, userId)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (!cstmrFollService.delete(new EntityWrapper<CstmrFoll>().eq("cstmr_id", cstmrId).eq("user_id", userId))) { |
| | | throw new CoolException("删除失败,请联系管理员"); |
| | | } |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | } |