//package com.backendsys.controller.B2c;
//
//import com.backendsys.aspect.QueryNullCheck;
//import com.backendsys.aspect.QueryNullCheckAspect;
//import com.backendsys.entity.B2c.B2cGoodCategoryDTO;
//import com.backendsys.entity.PageDTO;
//import com.backendsys.service.B2c.B2cGoodCategoryService;
//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.*;
//
///**
// * 商品分类
// */
//@Validated
//@RestController
//public class B2cGoodCategoryController {
//
//    @Autowired
//    private B2cGoodCategoryService b2cGoodCategoryService;
//
//    @PreAuthorize("@sr.hasPermission('11.2')")
//    @GetMapping("/api/b2c/good/getGoodCategory")
//    public Result getGoodCategory(@Validated PageDTO pageDTO, @Validated B2cGoodCategoryDTO b2cGoodCategoryDTO) {
//        return Result.success(b2cGoodCategoryService.queryGoodCategoryList(pageDTO.getPage_num(), pageDTO.getPage_size(), b2cGoodCategoryDTO));
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.2.1')")
//    @QueryNullCheck(serviceClass = B2cGoodCategoryService.class, serviceMethod = "queryGoodCategoryDetail", argField = "good_category_id", message = "商品分类不存在")
//    @GetMapping("/api/b2c/good/getGoodCategoryDetail")
//    public Result getGoodCategoryDetail(@Validated(B2cGoodCategoryDTO.Detail.class) B2cGoodCategoryDTO b2cGoodCategoryDTO) {
//        return Result.success(QueryNullCheckAspect.getQueryResult());
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.2.2')")
//    @PostMapping("/api/b2c/good/createGoodCategory")
//    public Result createGoodCategory(@Validated(B2cGoodCategoryDTO.Create.class) @RequestBody B2cGoodCategoryDTO b2cGoodCategoryDTO) {
//        return Result.success(b2cGoodCategoryService.insertGoodCategory(b2cGoodCategoryDTO), "创建成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.2.3')")
//    @QueryNullCheck(serviceClass = B2cGoodCategoryService.class, serviceMethod = "queryGoodCategoryDetail", argField = "good_category_id", message = "商品分类不存在")
//    @PutMapping("/api/b2c/good/updateGoodCategory")
//    public Result updateGoodCategory(@Validated(B2cGoodCategoryDTO.Update.class) @RequestBody B2cGoodCategoryDTO b2cGoodCategoryDTO) {
//        return Result.success(b2cGoodCategoryService.updateGoodCategory(b2cGoodCategoryDTO), "更新成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.2.4')")
//    @QueryNullCheck(serviceClass = B2cGoodCategoryService.class, serviceMethod = "queryGoodCategoryDetail", argField = "good_category_id", message = "商品分类不存在")
//    @DeleteMapping("/api/b2c/good/deleteGoodCategory")
//    public Result deleteGoodCategory(@Validated(B2cGoodCategoryDTO.Delete.class) @RequestBody B2cGoodCategoryDTO b2cGoodCategoryDTO) {
//        return Result.success(b2cGoodCategoryService.deleteGoodCategory(b2cGoodCategoryDTO), "删除成功");
//    }
//}
