//package com.backendsys.controller.Cms;
//
//import com.backendsys.aspect.QueryNullCheck;
//import com.backendsys.aspect.QueryNullCheckAspect;
//import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
//import com.backendsys.service.Cms.CmsArticleCategoryService;
//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 CmsArticleCategoryController {
//
//    @Autowired
//    private CmsArticleCategoryService cmsArticleCategoryService;
//
//    @PreAuthorize("@sr.hasPermission('10.2')")
//    @GetMapping("/api/cms/article/getArticleCategory")
//    public Result getArticleCategory(@Validated PageDTO pageDTO, @Validated CmsArticleCategoryDTO cmsArticleCategoryDTO) {
//        return Result.success(cmsArticleCategoryService.queryArticleCategory(pageDTO.getPage_num(), pageDTO.getPage_size(), cmsArticleCategoryDTO));
//    }
//
//    @PreAuthorize("@sr.hasPermission('10.2.1')")
//    @QueryNullCheck(serviceClass = CmsArticleCategoryService.class, serviceMethod = "queryArticleCategoryDetail", argField = "article_category_id", message = "资讯分类不存在")
//    @GetMapping("/api/cms/article/getArticleCategoryDetail")
//    public Result getArticleCategoryDetail(@Validated(CmsArticleCategoryDTO.Detail.class) CmsArticleCategoryDTO cmsArticleCategoryDTO) {
//        return Result.success(QueryNullCheckAspect.getQueryResult());
//    }
//
//    @PreAuthorize("@sr.hasPermission('10.2.2')")
//    @PostMapping("/api/cms/article/createArticleCategory")
//    public Result createArticleCategory(@Validated(CmsArticleCategoryDTO.Create.class) @RequestBody CmsArticleCategoryDTO cmsArticleCategoryDTO) {
//        return Result.success(cmsArticleCategoryService.insertArticleCategory(cmsArticleCategoryDTO), "创建成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('10.2.3')")
//    @QueryNullCheck(serviceClass = CmsArticleCategoryService.class, serviceMethod = "queryArticleCategoryDetail", argField = "article_category_id", message = "资讯分类不存在")
//    @PutMapping("/api/cms/article/updateArticleCategory")
//    public Result updateArticleCategory(@Validated(CmsArticleCategoryDTO.Update.class) @RequestBody CmsArticleCategoryDTO cmsArticleCategoryDTO) {
//        return Result.success(cmsArticleCategoryService.updateArticleCategory(cmsArticleCategoryDTO), "更新成功");
//    }
//
//    @PreAuthorize("@sr.hasPermission('10.2.4')")
//    @QueryNullCheck(serviceClass = CmsArticleCategoryService.class, serviceMethod = "queryArticleCategoryDetail", argField = "article_category_id", message = "资讯分类不存在")
//    @DeleteMapping("/api/cms/article/deleteArticleCategory")
//    public Result deleteArticleCategory(@Validated(CmsArticleCategoryDTO.Delete.class) @RequestBody CmsArticleCategoryDTO cmsArticleCategoryDTO) {
//        return Result.success(cmsArticleCategoryService.deleteArticleCategory(cmsArticleCategoryDTO), "删除成功");
//    }
//
//    /**
//     * 资讯分类 (公共)
//     */
//    @GetMapping("/api/public/cms/article/getArticleCategory")
//    public Result getPublicArticleCategory(@Validated PageDTO pageDTO, @Validated CmsArticleCategoryDTO cmsArticleCategoryDTO) {
//        cmsArticleCategoryDTO.setStatus(1);
//        return Result.success(cmsArticleCategoryService.queryArticleCategory(pageDTO.getPage_num(), pageDTO.getPage_size(), cmsArticleCategoryDTO));
//    }
//
//}
