//package com.backendsys.controller.Cms;
//
//import com.backendsys.entity.Cms.CmsPageDTO;
//import com.backendsys.entity.PageDTO;
//import com.backendsys.service.Cms.CmsPageService;
//import com.backendsys.utils.response.Result;
//import com.backendsys.utils.response.ResultEnum;
//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.*;
//
//import java.util.Map;
//
///**
// * 资讯
// */
//@RestController
//public class CmsPageController {
//
//    @Autowired
//    private CmsPageService cmsPageService;
//
//    // @Validated @Translate CmsPageDTO cmsPageDTO
//    // 使用这个写法，让实体类自动添加 lang 参数，这个参数来自于 Cookie
//
//
////    @PreAuthorize("@sr.hasPermission('12.1')")
////    @GetMapping("/api/cms/page/getPage")
////    public Result getPage(@Validated PageDTO pageDTO, @Validated CmsPageDTO cmsPageDTO) {
////        return Result.success(cmsPageService.queryPage(pageDTO.getPage_num(), pageDTO.getPage_size(), cmsPageDTO));
////    }
//
////    /**
////     * 详情
////     */
////    @PreAuthorize("@sr.hasPermission('12.2')")
////    @GetMapping("/api/cms/page/getPageDetail")
////    public Result getPageDetail(@Validated CmsPageDTO cmsPageDTO) {
////
////        Map<String, Object> cmsPage = cmsPageService.queryPageDetail(cmsPageDTO);
////        if (cmsPage == null) {
////            return Result.error(ResultEnum.DATABASE_OPERATION_FAILED.getCode(), "内容不存在");
////        }
////        String page_sign = cmsPageDTO.getPage_sign();
////        cmsPage.put("page_sign", page_sign);
////
////        return Result.success(cmsPageService.queryPageDetail(cmsPageDTO));
////    }
//
////    @PreAuthorize("@sr.hasPermission('12.3')")
////    // @QueryNullCheck(serviceClass = CmsPageService.class, serviceMethod = "queryPageDetail", argField = "page_id", message = "资讯不存在")
////    @PutMapping("/api/cms/page/updatePage")
////    public Result updatePage(@Validated(CmsPageDTO.Update.class) @RequestBody CmsPageDTO cmsPageDTO) {
////        return Result.success(cmsPageService.updatePage(cmsPageDTO), "更新成功");
////    }
//
//    /**
//     * 详情 (公共)
//     */
//    @GetMapping("/api/public/cms/page/getPageDetail")
//    public Result getPageDetailPublic(@Validated CmsPageDTO cmsPageDTO) {
//
//        Map<String, Object> cmsPage = cmsPageService.queryPageDetailPublic(cmsPageDTO);
//        if (cmsPage == null) {
//            return Result.error(ResultEnum.DATABASE_OPERATION_FAILED.getCode(), "内容不存在");
//        }
//        String page_sign = cmsPageDTO.getPage_sign();
//        cmsPage.put("page_sign", page_sign);
//
//        return Result.success(cmsPage);
//    }
//
//}
