//package com.backendsys.controller.Med;
//
//import com.backendsys.aspect.QueryNullCheck;
//import com.backendsys.aspect.QueryNullCheckAspect;
//import com.backendsys.entity.Med.MedMaterialCategoryDTO;
//import com.backendsys.service.Med.MedMaterialCategoryService;
//import com.backendsys.entity.PageDTO;
//import com.backendsys.utils.response.Result;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
///**
// * 素材分类
// */
//@RestController
//public class MedMaterialCategoryController {
//
//    @Autowired
//    private MedMaterialCategoryService medMaterialCategoryService;
//
//    @PreAuthorize("@sr.hasPermission('20.2')")
//    @GetMapping("/api/med/material/getMaterialCategory")
//    public Result getMaterialCategory(@Validated PageDTO pageDTO, @Validated MedMaterialCategoryDTO medMaterialCategoryDTO) {
//        return Result.success(medMaterialCategoryService.queryMaterialCategory(pageDTO.getPage_num(), pageDTO.getPage_size(), medMaterialCategoryDTO));
//    }
//
//    @PreAuthorize("@sr.hasPermission('20.2.1')")
//    @QueryNullCheck(serviceClass = MedMaterialCategoryService.class, serviceMethod = "queryMaterialCategoryDetail", argField = "material_category_id", message = "素材分类不存在")
//    @GetMapping("/api/med/material/getMaterialCategoryDetail")
//    public Result getMaterialCategoryDetail(@Validated(MedMaterialCategoryDTO.Detail.class) MedMaterialCategoryDTO medMaterialCategoryDTO) {
//        return Result.success(QueryNullCheckAspect.getQueryResult());
//    }
//
//    @PreAuthorize("@sr.hasPermission('20.2.2')")
//    @PostMapping("/api/med/material/createMaterialCategory")
//    public Result createMaterialCategory(@Validated(MedMaterialCategoryDTO.Create.class) @RequestBody MedMaterialCategoryDTO medMaterialCategoryDTO) {
//        return Result.success(medMaterialCategoryService.insertMaterialCategory(medMaterialCategoryDTO), "创建成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('20.2.3')")
//    @QueryNullCheck(serviceClass = MedMaterialCategoryService.class, serviceMethod = "queryMaterialCategoryDetail", argField = "material_category_id", message = "素材分类不存在")
//    @PutMapping("/api/med/material/updateMaterialCategory")
//    public Result updateMaterialCategory(@Validated(MedMaterialCategoryDTO.Update.class) @RequestBody MedMaterialCategoryDTO medMaterialCategoryDTO) {
//        return Result.success(medMaterialCategoryService.updateMaterialCategory(medMaterialCategoryDTO), "更新成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('20.2.4')")
//    @QueryNullCheck(serviceClass = MedMaterialCategoryService.class, serviceMethod = "queryMaterialCategoryDetail", argField = "material_category_id", message = "素材分类不存在")
//    @DeleteMapping("/api/med/material/deleteMaterialCategory")
//    public Result deleteMaterialCategory(@Validated(MedMaterialCategoryDTO.Delete.class) @RequestBody MedMaterialCategoryDTO medMaterialCategoryDTO) {
//        return Result.success(medMaterialCategoryService.deleteMaterialCategory(medMaterialCategoryDTO), "删除成功");
//    }
//
//}
