package com.iailab.module.pms.coalquality.modules.detection.controller.admin; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; import com.iailab.module.pms.coalquality.modules.detection.dto.QualityMediumDTO; import com.iailab.module.pms.coalquality.modules.detection.service.QualityMediumService; import com.iailab.module.pms.coalquality.modules.detection.vo.MediumPageReqVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author PanZhibao * @Description * @createTime 2023年02月07日 17:36:00 */ @Slf4j @RestController @RequestMapping("/coal-quality/quality/medium") @Tag(name = "介质粉检测") public class QualityMediumController { @Autowired private QualityMediumService qualityMediumService; @GetMapping("page") @Operation(summary = "分页") public CommonResult> page(MediumPageReqVO mediumPageReqVO){ PageResult page = qualityMediumService.page(mediumPageReqVO); return success(page); } @GetMapping("/get") @Operation(summary = "信息") public CommonResult get(String id){ QualityMediumDTO data = qualityMediumService.get(id); return success(data); } @PostMapping("/create") @Operation(summary = "保存") public CommonResult create(@RequestBody QualityMediumDTO dto){ // //效验数据 // ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); qualityMediumService.save(dto); return success(true); } @PutMapping("/update") @Operation(summary = "修改") public CommonResult update(@RequestBody QualityMediumDTO dto){ // //效验数据 // ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); // // if (qualityMediumService.cheack(dto) > 0) { // return new CommonResult().error("编号重复"); // } qualityMediumService.update(dto); return success(true); } @DeleteMapping("/delete") @Operation(summary = "删除") public CommonResult delete(@RequestBody String[] ids){ qualityMediumService.delete(ids); return success(true); } }