| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.BattAttention; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.BattAttentionService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("battAttention") |
| | | @Api(tags = "数据管理-电池关注管理") |
| | | public class BattAttentionController { |
| | | public class BattAttentionController extends BaseController{ |
| | | |
| | | @Resource |
| | | private BattAttentionService service; |
| | | |
| | | @PostMapping("searByCondition") |
| | | @ApiOperation(value = "根据电池组的筛选条件,查询单体的实际电压") |
| | | public Response searByCondition(@RequestParam int pageNum,@RequestParam int pageSize,@RequestBody Battinf battinf){ |
| | | UserInf userInf = ActionUtil.getUser(); |
| | | return service.searchByCondition(pageNum,pageSize,battinf,userInf.getUId().intValue()); |
| | | } |
| | | |
| | | |
| | | @PostMapping("delete") |
| | | @ApiOperation(value = "取消关注") |
| | | public Response delete(@RequestBody BattAttention battAttention){ |
| | | UserInf userInf = ActionUtil.getUser(); |
| | | battAttention.setUId(userInf.getUId().intValue()); |
| | | return service.deleteByEntity(battAttention); |
| | | } |
| | | |
| | | @GetMapping("judgeInOrNot") |
| | | @ApiOperation(value = "关注之前识别是否关注过") |
| | | public Response judgeInOrNot(int battGroupId,int monNum){ |
| | | UserInf userInf = ActionUtil.getUser(); |
| | | return service.judgeInOrNot(battGroupId,monNum,userInf.getUId().intValue()); |
| | | } |
| | | |
| | | @PostMapping("add") |
| | | @ApiOperation(tags = "在线监测-实时监控",value = "添加关注单体",notes = "Batt_attentionAction!add") |
| | | public Response add(@RequestBody BattAttention attention){ |
| | | return service.add(attention); |
| | | } |
| | | |
| | | } |