| | |
| | | //添加关注 |
| | | @PostMapping("/") |
| | | @ApiOperation(notes = "",value="添加关注") |
| | | public ServiceModel add(@RequestParam Integer battGroupId,@RequestParam Integer monNum,@ApiParam(value = "ID")@RequestParam Integer uid) { |
| | | public ServiceModel add(@RequestParam Integer battGroupId,@RequestParam Integer monNum) { |
| | | Batt_attention attention = new Batt_attention(); |
| | | User_inf uinf = (User_inf)ActionUtil.getUser(); |
| | | // User_inf uinf = new User_inf(); |
| | |
| | | attention.setUid(uinf.getuId()); |
| | | attention.setBattGroupId(battGroupId); |
| | | attention.setMonNum(monNum); |
| | | attention.setUid(uid); |
| | | ServiceModel model = service.add(attention); |
| | | { |
| | | if (model.getCode().equals(1)){ |
| | | String msg="添加对"+attention.getBattGroupId()+"电池组的"+attention.getMonNum()+"单体的关注"; |
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg); |
| | | uservice.add(ulog);//将用户的操作记录下来 |
| | |
| | | //取消关注 |
| | | @DeleteMapping("/") |
| | | @ApiOperation(notes = "",value="取消关注") |
| | | public ServiceModel delete(@RequestParam Integer battGroupId,@RequestParam Integer monNum,@ApiParam(value = "ID",required = true)@RequestParam Integer uid) { |
| | | public ServiceModel delete(@RequestParam Integer battGroupId,@RequestParam Integer monNum) { |
| | | Batt_attention attention = new Batt_attention(); |
| | | User_inf uinf = (User_inf)ActionUtil.getUser(); |
| | | attention.setUid(uinf.getuId()); |
| | | attention.setBattGroupId(battGroupId); |
| | | attention.setMonNum(monNum); |
| | | attention.setUid(uid); |
| | | ServiceModel model = service.delete(attention); |
| | | { |
| | | if (model.getCode().equals(1)){ |
| | | String msg="取消对"+attention.getBattGroupId()+"电池组的"+attention.getMonNum()+"号单体的关注"; |
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Delete, msg); |
| | | uservice.add(ulog);//将用户的操作记录下来 |
| | |
| | | //关注之前识别是否关注过 |
| | | @GetMapping("judge") |
| | | @ApiOperation(notes = "",value="关注之前识别是否关注过") |
| | | public ServiceModel judgeInOrNot(@RequestParam Integer battGroupId,@RequestParam Integer monNum,@ApiParam(value = "ID",required = true)@RequestParam Integer uid) { |
| | | public ServiceModel judgeInOrNot(@RequestParam Integer battGroupId,@RequestParam Integer monNum) { |
| | | Batt_attention attention = new Batt_attention(); |
| | | User_inf uinf = (User_inf)ActionUtil.getUser(); |
| | | attention.setUid(uinf.getuId()); |
| | | attention.setBattGroupId(battGroupId); |
| | | attention.setMonNum(monNum); |
| | | attention.setUid(uid); |
| | | ServiceModel model = service.judgeInOrNot(attention); |
| | | |
| | | return model; |