New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_batt.BattInf; |
| | | import com.whyc.service.BattInfService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 弃用,整合到电源信息表了 |
| | | */ |
| | | @Deprecated |
| | | @RestController |
| | | @Api(tags = "电池信息") |
| | | @RequestMapping("battInf") |
| | | public class BattInfController { |
| | | |
| | | @Autowired |
| | | private BattInfService service; |
| | | |
| | | @ApiOperation("新增") |
| | | @PostMapping("add") |
| | | public Response add(@RequestBody BattInf battInf){ |
| | | return service.add(battInf); |
| | | } |
| | | |
| | | @ApiOperation("删除") |
| | | @PostMapping("delete") |
| | | public Response delete(@RequestParam int battGroupId){ |
| | | return service.delete(battGroupId); |
| | | } |
| | | |
| | | @ApiOperation("修改") |
| | | @PostMapping("update") |
| | | public Response update(@RequestBody BattInf battInf){ |
| | | return service.update(battInf); |
| | | } |
| | | |
| | | @ApiOperation("查询-分页") |
| | | @GetMapping("getPage") |
| | | public Response getPage(@RequestParam int pageNum,@RequestParam int pageSize){ |
| | | return service.getPage(pageNum,pageSize); |
| | | } |
| | | |
| | | @ApiOperation("查询-根据id") |
| | | @GetMapping("getById") |
| | | public Response getById(@RequestParam int battGroupId){ |
| | | BattInf battInf = service.getById(battGroupId); |
| | | return new Response().set(1,battInf); |
| | | } |
| | | |
| | | |
| | | } |