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.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.modules.dnc.entity.PartsInfo; import org.jeecg.modules.dnc.response.CommonCode; import org.jeecg.modules.dnc.response.ResponseResult; import org.jeecg.modules.dnc.service.IPartsInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @Slf4j @Api(tags = "零件信息表") @RestController @RequestMapping("/nc/parts") public class PartsInfoController extends JeecgController { @Autowired private IPartsInfoService partsInfoService; @AutoLog(value = "零件信息表-添加零件信息") @ApiOperation(value = "零件信息表-添加零件信息", notes = "零件信息表-添加零件信息") @PostMapping("/add") public ResponseResult addPartsInfo(@RequestBody PartsInfo partsInfo) { boolean b = partsInfoService.addPartsInfo(partsInfo); if(b) { return new ResponseResult(CommonCode.SUCCESS); } return new ResponseResult(CommonCode.FAIL); } @AutoLog(value = "零件信息表-编辑零件信息") @ApiOperation(value = "零件信息表-编辑零件信息", notes = "零件信息表-编辑零件信息") @PutMapping("/edit/{id}") public ResponseResult editPartsInfo(@PathVariable("id") String id, @RequestBody PartsInfo partsInfo) { boolean b = partsInfoService.editPartsInfo(id, partsInfo); if(b) { return new ResponseResult(CommonCode.SUCCESS); } return new ResponseResult(CommonCode.FAIL); } @AutoLog(value = "零件信息表-删除零件") @ApiOperation(value = "零件信息表-删除零件", notes = "零件信息表-删除零件") @DeleteMapping("/delete") public ResponseResult deletePartsInfo(@RequestParam("id") String id) { boolean b = partsInfoService.deletePartsInfo(id); if(b) { return new ResponseResult(CommonCode.SUCCESS); } return new ResponseResult(CommonCode.FAIL); } }