| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | return service.getList(name); |
| | | } |
| | | |
| | | @PostMapping("add") |
| | | @ApiOperation("添加") |
| | | public Response add(@RequestBody DeviceSpare spare) { |
| | | return service.add(spare); |
| | | } |
| | | |
| | | @PostMapping("update") |
| | | @ApiOperation("修改") |
| | | public Response update(@RequestBody DeviceSpare spare) { |
| | | return service.update(spare); |
| | | } |
| | | |
| | | @PostMapping("delete") |
| | | @ApiOperation("删除") |
| | | public Response delete(@RequestParam Integer id) { |
| | | return service.delete(id); |
| | | } |
| | | |
| | | } |