对比新文件 |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.modules.dnc.entity.DeviceCharacters; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dnc.request.DeviceCharactersRequest; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | | import org.jeecg.modules.dnc.response.ResponseResult; |
| | | import org.jeecg.modules.dnc.service.IDeviceCharactersService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @Description: 璁惧鐗规畩瀛楃 |
| | | * @Author: |
| | | * @Date: 2024-12-31 |
| | | * @Version: V1.0 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Api(tags = "璁惧鐗规畩瀛楃") |
| | | @RestController |
| | | @RequestMapping("/nc/device/characters") |
| | | public class DeviceCharactersController extends JeecgController<DeviceCharacters, IDeviceCharactersService> { |
| | | |
| | | @Autowired |
| | | private IDeviceCharactersService iDeviceCharactersService; |
| | | |
| | | /** |
| | | * 璁惧鐗规畩瀛楃鍒嗛〉鏌ヨ |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param deviceCharactersRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "璁惧鐗规畩瀛楃-鍒嗛〉鍒楄〃鏌ヨ") |
| | | @ApiOperation(value = "璁惧鐗规畩瀛楃-鍒嗛〉鍒楄〃鏌ヨ", notes = "璁惧鐗规畩瀛楃-鍒嗛〉鍒楄〃鏌ヨ") |
| | | @GetMapping("/find/page") |
| | | public Result<?> findPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | DeviceCharactersRequest deviceCharactersRequest) { |
| | | return iDeviceCharactersService.findByPageList(pageNo, pageSize, deviceCharactersRequest); |
| | | } |
| | | |
| | | /** |
| | | * 鏂板璁惧鐗规畩瀛楃 |
| | | * @param deviceCharacters |
| | | */ |
| | | @AutoLog(value = "璁惧鐗规畩瀛楃-鏂板璁惧鐗规畩瀛楃") |
| | | @ApiOperation(value = "璁惧鐗规畩瀛楃-鏂板璁惧鐗规畩瀛楃", notes = "璁惧鐗规畩瀛楃-鏂板璁惧鐗规畩瀛楃") |
| | | @PostMapping("/add") |
| | | public ResponseResult addPartsInfo(@RequestBody DeviceCharacters deviceCharacters) { |
| | | boolean b = iDeviceCharactersService.save(deviceCharacters); |
| | | if(b) { |
| | | return new ResponseResult(CommonCode.SUCCESS); |
| | | } |
| | | return new ResponseResult(CommonCode.FAIL); |
| | | } |
| | | |
| | | /** |
| | | * 缂栬緫璁惧鐗规畩瀛楃 |
| | | * @param deviceCharacters |
| | | */ |
| | | @AutoLog(value = "璁惧鐗规畩瀛楃-缂栬緫璁惧鐗规畩瀛楃") |
| | | @ApiOperation(value = "璁惧鐗规畩瀛楃-缂栬緫璁惧鐗规畩瀛楃", notes = "璁惧鐗规畩瀛楃-缂栬緫璁惧鐗规畩瀛楃") |
| | | @PutMapping("/edit") |
| | | public ResponseResult editDefinition(@RequestBody DeviceCharacters deviceCharacters) { |
| | | boolean b = iDeviceCharactersService.updateById(deviceCharacters); |
| | | if(b) { |
| | | return new ResponseResult(CommonCode.SUCCESS); |
| | | } |
| | | return new ResponseResult(CommonCode.FAIL); |
| | | } |
| | | |
| | | /** |
| | | * 鍒犻櫎璁惧鐗规畩瀛楃 |
| | | * id |
| | | */ |
| | | @AutoLog(value = "璁惧鐗规畩瀛楃-鍒犻櫎璁惧鐗规畩瀛楃") |
| | | @ApiOperation(value = "璁惧鐗规畩瀛楃-鍒犻櫎璁惧鐗规畩瀛楃", notes = "璁惧鐗规畩瀛楃-鍒犻櫎璁惧鐗规畩瀛楃") |
| | | @DeleteMapping("/delete") |
| | | public ResponseResult deleteDefinition(@RequestParam("id") String id) { |
| | | boolean b = iDeviceCharactersService.removeById(id); |
| | | if(b) |
| | | return new ResponseResult(CommonCode.SUCCESS); |
| | | return new ResponseResult(CommonCode.FAIL); |
| | | } |
| | | |
| | | |
| | | } |