//package com.backendsys.controller.B2c;
//
//import com.backendsys.aspect.QueryNullCheck;
//import com.backendsys.aspect.QueryNullCheckAspect;
//import com.backendsys.entity.B2c.B2cGoodBrandDTO;
//import com.backendsys.entity.PageDTO;
//import com.backendsys.service.B2c.B2cGoodBrandService;
//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 B2cGoodBrandController {
//
//    @Autowired
//    private B2cGoodBrandService b2cGoodBrandService;
//
//    @PreAuthorize("@sr.hasPermission('11.3')")
//    @GetMapping("/api/b2c/good/getGoodBrand")
//    public Result getGoodBrand(@Validated PageDTO pageDTO, @Validated B2cGoodBrandDTO b2cGoodBrandDTO) {
//        return Result.success(b2cGoodBrandService.queryGoodBrandList(pageDTO.getPage_num(), pageDTO.getPage_size(), b2cGoodBrandDTO));
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.3.1')")
//    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
//    @GetMapping("/api/b2c/good/getGoodBrandDetail")
//    public Result getGoodBrandDetail(@Validated(B2cGoodBrandDTO.Detail.class) B2cGoodBrandDTO b2cGoodBrandDTO) {
//        return Result.success(QueryNullCheckAspect.getQueryResult());
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.3.2')")
//    @PostMapping("/api/b2c/good/createGoodBrand")
//    public Result createGoodBrand(@Validated(B2cGoodBrandDTO.Create.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
//        return Result.success(b2cGoodBrandService.insertGoodBrand(b2cGoodBrandDTO), "创建成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.3.3')")
//    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
//    @PutMapping("/api/b2c/good/updateGoodBrand")
//    public Result updateGoodBrand(@Validated(B2cGoodBrandDTO.Update.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
//        return Result.success(b2cGoodBrandService.updateGoodBrand(b2cGoodBrandDTO), "更新成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('11.3.4')")
//    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
//    @DeleteMapping("/api/b2c/good/deleteGoodBrand")
//    public Result deleteGoodBrand(@Validated(B2cGoodBrandDTO.Delete.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
//
//        // 判断是否有子ID，有则不允许删除
//
//
//        return Result.success(b2cGoodBrandService.deleteGoodBrand(b2cGoodBrandDTO), "删除成功");
//    }
//}
