tsurumure hai 6 meses
pai
achega
a2b2986a0d
Modificáronse 30 ficheiros con 1648 adicións e 1570 borrados
  1. 65 65
      src/main/java/com/backendsys/controller/Cms/CmsArticleCategoryController.java
  2. 108 108
      src/main/java/com/backendsys/controller/Cms/CmsArticleController.java
  3. 39 39
      src/main/java/com/backendsys/controller/Cms/CmsSiteInfoController.java
  4. 81 84
      src/main/java/com/backendsys/controller/Upload/ResourceController.java
  5. 1 2
      src/main/java/com/backendsys/entity/Ai/AiChatDTO.java
  6. 37 37
      src/main/java/com/backendsys/entity/Cms/CmsArticleCategoryDTO.java
  7. 59 59
      src/main/java/com/backendsys/entity/Cms/CmsArticleDTO.java
  8. 31 31
      src/main/java/com/backendsys/entity/Cms/CmsArticleTranslationsDTO.java
  9. 36 36
      src/main/java/com/backendsys/entity/Cms/CmsSiteInfoDTO.java
  10. 16 16
      src/main/java/com/backendsys/mapper/Cms/CmsArticleCategoryMapper.java
  11. 75 75
      src/main/java/com/backendsys/mapper/Cms/CmsArticleCategoryMapper.xml
  12. 21 21
      src/main/java/com/backendsys/mapper/Cms/CmsArticleMapper.java
  13. 238 238
      src/main/java/com/backendsys/mapper/Cms/CmsArticleMapper.xml
  14. 14 14
      src/main/java/com/backendsys/mapper/Cms/CmsSiteInfoMapper.java
  15. 38 38
      src/main/java/com/backendsys/mapper/Cms/CmsSiteInfoMapper.xml
  16. 0 1
      src/main/java/com/backendsys/modules/cms/article/entity/ArticleCategory.java
  17. 1 0
      src/main/java/com/backendsys/modules/cms/siteinfo/controller/SiteInfoController.java
  18. 1 1
      src/main/java/com/backendsys/modules/cms/siteinfo/service/SiteInfoService.java
  19. 1 1
      src/main/java/com/backendsys/modules/cms/siteinfo/service/impl/SiteInfoServiceImpl.java
  20. 82 0
      src/main/java/com/backendsys/modules/download/controller/DownloadLocalController.java
  21. 13 13
      src/main/java/com/backendsys/service/Cms/CmsArticleCategoryService.java
  22. 74 74
      src/main/java/com/backendsys/service/Cms/CmsArticleCategoryServiceImpl.java
  23. 16 16
      src/main/java/com/backendsys/service/Cms/CmsArticleService.java
  24. 122 122
      src/main/java/com/backendsys/service/Cms/CmsArticleServiceImpl.java
  25. 10 10
      src/main/java/com/backendsys/service/Cms/CmsSiteInfoService.java
  26. 41 41
      src/main/java/com/backendsys/service/Cms/CmsSiteInfoServiceImpl.java
  27. 2 2
      src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentCOSService.java
  28. 50 50
      src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentCOSServiceImpl.java
  29. 24 24
      src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentSMSService.java
  30. 352 352
      src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentSMSServiceImpl.java

+ 65 - 65
src/main/java/com/backendsys/controller/Cms/CmsArticleCategoryController.java

@@ -1,65 +1,65 @@
-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));
-    }
-
-}
+//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));
+//    }
+//
+//}

+ 108 - 108
src/main/java/com/backendsys/controller/Cms/CmsArticleController.java

@@ -1,108 +1,108 @@
-package com.backendsys.controller.Cms;
-
-import com.backendsys.aspect.HttpRequestAspect;
-import com.backendsys.entity.Cms.CmsArticleDTO;
-import com.backendsys.entity.PageDTO;
-import com.backendsys.service.Cms.CmsArticleService;
-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 CmsArticleController {
-
-    @Autowired
-    private HttpRequestAspect httpRequestAspect;
-
-    @Autowired
-    private CmsArticleService cmsArticleService;
-
-    // @Validated @Translate CmsArticleDTO cmsArticleDTO
-    // 使用这个写法,让实体类自动添加 lang 参数,这个参数来自于 Cookie
-
-    @PreAuthorize("@sr.hasPermission('10.3')")
-    @GetMapping("/api/cms/article/getArticle")
-    public Result getArticle(@Validated PageDTO pageDTO, @Validated CmsArticleDTO cmsArticleDTO) {
-        return Result.success(cmsArticleService.queryArticle(pageDTO.getPage_num(), pageDTO.getPage_size(), cmsArticleDTO));
-    }
-
-    @PreAuthorize("@sr.hasPermission('10.3.1')")
-    @GetMapping("/api/cms/article/getArticleDetail")
-    public Result getArticleDetail(@Validated(CmsArticleDTO.Detail.class) CmsArticleDTO cmsArticleDTO) {
-        return Result.success(cmsArticleService.queryArticleDetail(cmsArticleDTO));
-    }
-
-    // @PreAuthorize("@sr.hasPermission('5.3.1')")
-    // @GetMapping("/api/cms/article/getArticleTranslation")
-    // public Result getArticleTranslation(@Validated(CmsArticleDTO.Detail.class) CmsArticleDTO cmsArticleDTO) {
-    //     return Result.success(cmsArticleService.queryArticleTranslation(cmsArticleDTO));
-    // }
-
-    @PreAuthorize("@sr.hasPermission('10.3.2')")
-    @PostMapping("/api/cms/article/createArticle")
-    public Result createArticle(@Validated(CmsArticleDTO.Create.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
-        // [查询] 自身 UserId
-        Long user_id = httpRequestAspect.getUserId();
-        cmsArticleDTO.setUser_id(user_id);
-        return Result.success(cmsArticleService.insertArticle(cmsArticleDTO), "创建成功");
-    }
-
-    @PreAuthorize("@sr.hasPermission('10.3.3')")
-    // @QueryNullCheck(serviceClass = CmsArticleService.class, serviceMethod = "queryArticleDetail", argField = "article_id", message = "资讯不存在")
-    @PutMapping("/api/cms/article/updateArticle")
-    public Result updateArticle(@Validated(CmsArticleDTO.Update.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
-        return Result.success(cmsArticleService.updateArticle(cmsArticleDTO), "更新成功");
-    }
-
-    @PreAuthorize("@sr.hasPermission('10.3.4')")
-    // @QueryNullCheck(serviceClass = CmsArticleService.class, serviceMethod = "queryArticleDetail", argField = "article_id", message = "资讯不存在")
-    @DeleteMapping("/api/cms/article/deleteArticle")
-    public Result deleteArticle(@Validated(CmsArticleDTO.Delete.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
-        return Result.success(cmsArticleService.deleteArticle(cmsArticleDTO), "删除成功");
-    }
-
-    @PreAuthorize("@sr.hasPermission('10.3.4')")
-    @DeleteMapping("/api/cms/article/deleteArticleBatch")
-    public Result deleteArticleBatch(@Validated(CmsArticleDTO.Delete.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
-        return Result.success(cmsArticleService.deleteArticleBatch(cmsArticleDTO.getArticle_ids()), "删除成功");
-    }
-
-    /**
-     * 资讯列表 (公共)
-     */
-    @GetMapping("/api/public/cms/article/getArticle")
-    public Result getPublicArticle(@Validated PageDTO pageDTO, @Validated CmsArticleDTO cmsArticleDTO) {
-        cmsArticleDTO.setStatus(1); // 已启用
-        // cmsArticleDTO.setAudit_status(2); // 审核通过
-        return Result.success(cmsArticleService.queryArticle(pageDTO.getPage_num(), pageDTO.getPage_size(), cmsArticleDTO));
-    }
-    /**
-     * 资讯详情 (公共)
-     */
-    @GetMapping("/api/public/cms/article/getArticleDetail")
-    public Result getPublicArticleDetail(@Validated CmsArticleDTO cmsArticleDTO) {
-
-        Map<String, Object> cmsArticle = cmsArticleService.queryArticleDetailPublic(cmsArticleDTO);
-        if (cmsArticle == null) {
-            return Result.error(ResultEnum.DATABASE_OPERATION_FAILED.getCode(), "资讯不存在");
-        }
-        if ((Integer) cmsArticle.get("status") != 1) {
-            return Result.error(ResultEnum.STATUS_ERROR.getCode(), ResultEnum.STATUS_ERROR.getMessage());
-        }
-        // if ((Integer) cmsArticle.get("audit_status") != 2) {
-        //     return Result.error(ResultEnum.STATUS_ERROR.getCode(), "资讯审核中");
-        // }
-        Long article_id = cmsArticleDTO.getArticle_id();
-        cmsArticle.put("article_id", article_id);
-        return Result.success(cmsArticle);
-    }
-
-}
+//package com.backendsys.controller.Cms;
+//
+//import com.backendsys.aspect.HttpRequestAspect;
+//import com.backendsys.entity.Cms.CmsArticleDTO;
+//import com.backendsys.entity.PageDTO;
+//import com.backendsys.service.Cms.CmsArticleService;
+//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 CmsArticleController {
+//
+//    @Autowired
+//    private HttpRequestAspect httpRequestAspect;
+//
+//    @Autowired
+//    private CmsArticleService cmsArticleService;
+//
+//    // @Validated @Translate CmsArticleDTO cmsArticleDTO
+//    // 使用这个写法,让实体类自动添加 lang 参数,这个参数来自于 Cookie
+//
+//    @PreAuthorize("@sr.hasPermission('10.3')")
+//    @GetMapping("/api/cms/article/getArticle")
+//    public Result getArticle(@Validated PageDTO pageDTO, @Validated CmsArticleDTO cmsArticleDTO) {
+//        return Result.success(cmsArticleService.queryArticle(pageDTO.getPage_num(), pageDTO.getPage_size(), cmsArticleDTO));
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('10.3.1')")
+//    @GetMapping("/api/cms/article/getArticleDetail")
+//    public Result getArticleDetail(@Validated(CmsArticleDTO.Detail.class) CmsArticleDTO cmsArticleDTO) {
+//        return Result.success(cmsArticleService.queryArticleDetail(cmsArticleDTO));
+//    }
+//
+//    // @PreAuthorize("@sr.hasPermission('5.3.1')")
+//    // @GetMapping("/api/cms/article/getArticleTranslation")
+//    // public Result getArticleTranslation(@Validated(CmsArticleDTO.Detail.class) CmsArticleDTO cmsArticleDTO) {
+//    //     return Result.success(cmsArticleService.queryArticleTranslation(cmsArticleDTO));
+//    // }
+//
+//    @PreAuthorize("@sr.hasPermission('10.3.2')")
+//    @PostMapping("/api/cms/article/createArticle")
+//    public Result createArticle(@Validated(CmsArticleDTO.Create.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
+//        // [查询] 自身 UserId
+//        Long user_id = httpRequestAspect.getUserId();
+//        cmsArticleDTO.setUser_id(user_id);
+//        return Result.success(cmsArticleService.insertArticle(cmsArticleDTO), "创建成功");
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('10.3.3')")
+//    // @QueryNullCheck(serviceClass = CmsArticleService.class, serviceMethod = "queryArticleDetail", argField = "article_id", message = "资讯不存在")
+//    @PutMapping("/api/cms/article/updateArticle")
+//    public Result updateArticle(@Validated(CmsArticleDTO.Update.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
+//        return Result.success(cmsArticleService.updateArticle(cmsArticleDTO), "更新成功");
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('10.3.4')")
+//    // @QueryNullCheck(serviceClass = CmsArticleService.class, serviceMethod = "queryArticleDetail", argField = "article_id", message = "资讯不存在")
+//    @DeleteMapping("/api/cms/article/deleteArticle")
+//    public Result deleteArticle(@Validated(CmsArticleDTO.Delete.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
+//        return Result.success(cmsArticleService.deleteArticle(cmsArticleDTO), "删除成功");
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('10.3.4')")
+//    @DeleteMapping("/api/cms/article/deleteArticleBatch")
+//    public Result deleteArticleBatch(@Validated(CmsArticleDTO.Delete.class) @RequestBody CmsArticleDTO cmsArticleDTO) {
+//        return Result.success(cmsArticleService.deleteArticleBatch(cmsArticleDTO.getArticle_ids()), "删除成功");
+//    }
+//
+//    /**
+//     * 资讯列表 (公共)
+//     */
+//    @GetMapping("/api/public/cms/article/getArticle")
+//    public Result getPublicArticle(@Validated PageDTO pageDTO, @Validated CmsArticleDTO cmsArticleDTO) {
+//        cmsArticleDTO.setStatus(1); // 已启用
+//        // cmsArticleDTO.setAudit_status(2); // 审核通过
+//        return Result.success(cmsArticleService.queryArticle(pageDTO.getPage_num(), pageDTO.getPage_size(), cmsArticleDTO));
+//    }
+//    /**
+//     * 资讯详情 (公共)
+//     */
+//    @GetMapping("/api/public/cms/article/getArticleDetail")
+//    public Result getPublicArticleDetail(@Validated CmsArticleDTO cmsArticleDTO) {
+//
+//        Map<String, Object> cmsArticle = cmsArticleService.queryArticleDetailPublic(cmsArticleDTO);
+//        if (cmsArticle == null) {
+//            return Result.error(ResultEnum.DATABASE_OPERATION_FAILED.getCode(), "资讯不存在");
+//        }
+//        if ((Integer) cmsArticle.get("status") != 1) {
+//            return Result.error(ResultEnum.STATUS_ERROR.getCode(), ResultEnum.STATUS_ERROR.getMessage());
+//        }
+//        // if ((Integer) cmsArticle.get("audit_status") != 2) {
+//        //     return Result.error(ResultEnum.STATUS_ERROR.getCode(), "资讯审核中");
+//        // }
+//        Long article_id = cmsArticleDTO.getArticle_id();
+//        cmsArticle.put("article_id", article_id);
+//        return Result.success(cmsArticle);
+//    }
+//
+//}

+ 39 - 39
src/main/java/com/backendsys/controller/Cms/CmsSiteInfoController.java

@@ -1,39 +1,39 @@
-package com.backendsys.controller.Cms;
-
-import com.backendsys.entity.Cms.CmsSiteInfoDTO;
-import com.backendsys.service.Cms.CmsSiteInfoService;
-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 CmsSiteInfoController {
-    
-    @Autowired
-    private CmsSiteInfoService cmsSiteInfoService;
-
-    @PreAuthorize("@sr.hasPermission('13')")
-    @GetMapping("/api/cms/site/getSiteInfo")
-    public Result getSiteInfo(@Validated CmsSiteInfoDTO cmsSiteInfoDTO) {
-        return Result.success(cmsSiteInfoService.querySiteInfo(cmsSiteInfoDTO));
-    }
-
-    @GetMapping("/api/public/cms/site/getSiteInfo")
-    public Result getSiteInfoPublic(@Validated CmsSiteInfoDTO cmsSiteInfoDTO) {
-        return Result.success(cmsSiteInfoService.querySiteInfo(cmsSiteInfoDTO));
-    }
-
-    @PreAuthorize("@sr.hasPermission('13.1')")
-    @PutMapping("/api/cms/site/updateSiteInfo")
-    public Result updateSiteInfo(@Validated(CmsSiteInfoDTO.Update.class) @RequestBody CmsSiteInfoDTO cmsSiteInfoDTO) {
-        cmsSiteInfoDTO.setId(Long.valueOf(1));
-        return Result.success(cmsSiteInfoService.updateSiteInfo(cmsSiteInfoDTO), "更新成功");
-    }
-
-}
+//package com.backendsys.controller.Cms;
+//
+//import com.backendsys.entity.Cms.CmsSiteInfoDTO;
+//import com.backendsys.service.Cms.CmsSiteInfoService;
+//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 CmsSiteInfoController {
+//
+//    @Autowired
+//    private CmsSiteInfoService cmsSiteInfoService;
+//
+//    @PreAuthorize("@sr.hasPermission('13')")
+//    @GetMapping("/api/cms/site/getSiteInfo")
+//    public Result getSiteInfo(@Validated CmsSiteInfoDTO cmsSiteInfoDTO) {
+//        return Result.success(cmsSiteInfoService.querySiteInfo(cmsSiteInfoDTO));
+//    }
+//
+//    @GetMapping("/api/public/cms/site/getSiteInfo")
+//    public Result getSiteInfoPublic(@Validated CmsSiteInfoDTO cmsSiteInfoDTO) {
+//        return Result.success(cmsSiteInfoService.querySiteInfo(cmsSiteInfoDTO));
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('13.1')")
+//    @PutMapping("/api/cms/site/updateSiteInfo")
+//    public Result updateSiteInfo(@Validated(CmsSiteInfoDTO.Update.class) @RequestBody CmsSiteInfoDTO cmsSiteInfoDTO) {
+//        cmsSiteInfoDTO.setId(Long.valueOf(1));
+//        return Result.success(cmsSiteInfoService.updateSiteInfo(cmsSiteInfoDTO), "更新成功");
+//    }
+//
+//}

+ 81 - 84
src/main/java/com/backendsys/controller/Upload/ResourceController.java

@@ -1,84 +1,81 @@
-package com.backendsys.controller.Upload;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.InputStreamResource;
-import org.springframework.core.io.Resource;
-import org.springframework.http.*;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.io.*;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-
-/**
- * 上传文件路径的显示/下载
- */
-@RestController
-public class ResourceController {
-
-    @Value("${file.upload.directory}") // 配置保存文件的目录
-    private String uploadDirectory;
-
-    // 判断文件是否为图片文件
-    private boolean isImageFile(File file) {
-        String extension = getExtension(file.getName());
-        return Arrays.asList("jpg", "jpeg", "png", "gif").contains(extension.toLowerCase());
-    }
-
-    // 获取图片文件对应的MediaType
-    private MediaType getImageMediaType(File file) {
-        String extension = getExtension(file.getName());
-        switch (extension.toLowerCase()) {
-            case "jpg":
-            case "jpeg": return MediaType.IMAGE_JPEG;
-            case "png": return MediaType.IMAGE_PNG;
-            case "gif": return MediaType.IMAGE_GIF;
-            default: return MediaType.APPLICATION_OCTET_STREAM;
-        }
-    }
-
-    public static String getExtension(String filename) {
-        if (filename == null) { return ""; }
-        int dotIndex = filename.lastIndexOf(".");
-        if (dotIndex > 0 && dotIndex < filename.length() - 1) {
-            return filename.substring(dotIndex + 1);
-        }
-        return "";
-    }
-
-    @GetMapping("/uploads/{folder}/{filename:.+}")
-    public ResponseEntity<Resource> serveFile(
-            @PathVariable String folder,
-            @PathVariable String filename
-    ) throws IOException {
-
-        File file = new File(uploadDirectory + folder + "/" + filename);
-        // 如果是图片,则直接显示;如果是文件,则是下载
-        HttpHeaders headers = new HttpHeaders();
-        if (isImageFile(file)) {
-            // 如果是图片文件,设置Content-Type为对应的图片MIME类型
-            headers.setContentType(getImageMediaType(file));
-        } else {
-            // 如果不是图片文件,设置Content-Disposition以附件形式下载
-            headers.setContentDisposition(ContentDisposition.attachment().filename(file.getName()).build());
-            headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
-        }
-        if (!file.exists()) {
-            String message = "图片不存在";
-            InputStream inputStream = new ByteArrayInputStream(message.getBytes(StandardCharsets.UTF_8));
-            InputStreamResource resource = new InputStreamResource(inputStream);
-            return ResponseEntity.status(HttpStatus.NOT_FOUND)
-                .contentType(MediaType.valueOf("text/plain; charset=UTF-8"))
-                .body(resource);
-        }
-        InputStreamResource resource = new InputStreamResource(new FileInputStream(file));
-        return ResponseEntity.ok()
-            .headers(headers)
-            .contentLength(file.length())
-            //.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"")
-            //.contentType(MediaType.APPLICATION_OCTET_STREAM)
-            .body(resource);
-    }
-}
+//package com.backendsys.controller.Upload;
+//
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.core.io.InputStreamResource;
+//import org.springframework.core.io.Resource;
+//import org.springframework.http.*;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.PathVariable;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.io.*;
+//import java.nio.charset.StandardCharsets;
+//import java.util.Arrays;
+//
+///**
+// * 下载本地文件
+// */
+//@RestController
+//public class ResourceController {
+//
+//    @Value("${file.upload.directory}") // 配置保存文件的目录
+//    private String uploadDirectory;
+//
+//    // 判断文件是否为图片文件
+//    private boolean isImageFile(File file) {
+//        String extension = getExtension(file.getName());
+//        return Arrays.asList("jpg", "jpeg", "png", "gif").contains(extension.toLowerCase());
+//    }
+//
+//    // 获取图片文件对应的MediaType
+//    private MediaType getImageMediaType(File file) {
+//        String extension = getExtension(file.getName());
+//        switch (extension.toLowerCase()) {
+//            case "jpg":
+//            case "jpeg": return MediaType.IMAGE_JPEG;
+//            case "png": return MediaType.IMAGE_PNG;
+//            case "gif": return MediaType.IMAGE_GIF;
+//            default: return MediaType.APPLICATION_OCTET_STREAM;
+//        }
+//    }
+//
+//    public static String getExtension(String filename) {
+//        if (filename == null) { return ""; }
+//        int dotIndex = filename.lastIndexOf(".");
+//        if (dotIndex > 0 && dotIndex < filename.length() - 1) {
+//            return filename.substring(dotIndex + 1);
+//        }
+//        return "";
+//    }
+//
+//    @GetMapping("/uploads/{folder}/{filename:.+}")
+//    public ResponseEntity<Resource> serveFile(@PathVariable String folder, @PathVariable String filename) throws IOException {
+//
+//        File file = new File(uploadDirectory + folder + "/" + filename);
+//        // 如果是图片,则直接显示;如果是文件,则是下载
+//        HttpHeaders headers = new HttpHeaders();
+//        if (isImageFile(file)) {
+//            // 如果是图片文件,设置Content-Type为对应的图片MIME类型
+//            headers.setContentType(getImageMediaType(file));
+//        } else {
+//            // 如果不是图片文件,设置Content-Disposition以附件形式下载
+//            headers.setContentDisposition(ContentDisposition.attachment().filename(file.getName()).build());
+//            headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+//        }
+//        if (!file.exists()) {
+//            String message = "图片不存在";
+//            InputStream inputStream = new ByteArrayInputStream(message.getBytes(StandardCharsets.UTF_8));
+//            InputStreamResource resource = new InputStreamResource(inputStream);
+//            return ResponseEntity.status(HttpStatus.NOT_FOUND)
+//                .contentType(MediaType.valueOf("text/plain; charset=UTF-8"))
+//                .body(resource);
+//        }
+//        InputStreamResource resource = new InputStreamResource(new FileInputStream(file));
+//        return ResponseEntity.ok()
+//            .headers(headers)
+//            .contentLength(file.length())
+//            //.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"")
+//            //.contentType(MediaType.APPLICATION_OCTET_STREAM)
+//            .body(resource);
+//    }
+//}

+ 1 - 2
src/main/java/com/backendsys/entity/Ai/AiChatDTO.java

@@ -1,6 +1,5 @@
 package com.backendsys.entity.Ai;
 
-import com.backendsys.entity.Cms.CmsArticleDTO;
 import com.backendsys.entity.validator.RangeStringArray;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Size;
@@ -34,7 +33,7 @@ public class AiChatDTO {
     @Size(max = 255, message = "机器人编码长度不超过 {max} 字符", groups = { AiChatDTO.Create.class, AiChatDTO.Update.class })
     private String robot_code;
 
-    @RangeStringArray(message="对话角色取值有误,范围应是(user, assistant)", value = {"user", "assistant"}, groups = {CmsArticleDTO.Create.class, CmsArticleDTO.Update.class})
+    @RangeStringArray(message="对话角色取值有误,范围应是(user, assistant)", value = {"user", "assistant"}, groups = { Create.class, Update.class })
     private String role;
 
     @Size(max = 2500, message = "对话内容长度不超过 {max} 字符", groups = { AiChatDTO.Create.class, AiChatDTO.Update.class })

+ 37 - 37
src/main/java/com/backendsys/entity/Cms/CmsArticleCategoryDTO.java

@@ -1,37 +1,37 @@
-package com.backendsys.entity.Cms;
-
-import com.backendsys.entity.validator.RangeArray;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Size;
-import lombok.Data;
-import org.hibernate.validator.constraints.Range;
-
-@Data
-public class CmsArticleCategoryDTO {
-    public static interface Detail{}
-    public static interface Create{}
-    public static interface Update{}
-    public static interface Delete{}
-
-    /**
-     * cms_article_category
-     */
-    private Long id;
-    @NotNull(message="article_category_id 不能为空", groups = { CmsArticleCategoryDTO.Detail.class, CmsArticleCategoryDTO.Update.class, CmsArticleCategoryDTO.Delete.class})
-    private Long article_category_id;
-
-    private Long parent_id;
-
-    @Size(max = 20, message = "资讯分类名称长度不超过 {max} 字符", groups = {CmsArticleCategoryDTO.Create.class, CmsArticleCategoryDTO.Update.class})
-    @NotBlank(message="资讯分类名称不能为空", groups = {CmsArticleCategoryDTO.Create.class, CmsArticleCategoryDTO.Update.class, })
-    private String category_name;
-
-    @Size(max = 200, message = "资讯分类描述长度不超过 {max} 字符", groups = {CmsArticleCategoryDTO.Create.class, CmsArticleCategoryDTO.Update.class})
-    private String category_description;
-    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间", groups = {CmsArticleCategoryDTO.Create.class, CmsArticleCategoryDTO.Update.class})
-    private Integer sort;
-    @RangeArray(message="状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = {CmsArticleCategoryDTO.Create.class, CmsArticleCategoryDTO.Update.class})
-    private Integer status;
-
-}
+//package com.backendsys.entity.Cms;
+//
+//import com.backendsys.entity.validator.RangeArray;
+//import jakarta.validation.constraints.NotBlank;
+//import jakarta.validation.constraints.NotNull;
+//import jakarta.validation.constraints.Size;
+//import lombok.Data;
+//import org.hibernate.validator.constraints.Range;
+//
+//@Data
+//public class CmsArticleCategoryDTO {
+//    public static interface Detail{}
+//    public static interface Create{}
+//    public static interface Update{}
+//    public static interface Delete{}
+//
+//    /**
+//     * cms_article_category
+//     */
+//    private Long id;
+//    @NotNull(message="article_category_id 不能为空", groups = { Detail.class, Update.class, Delete.class})
+//    private Long article_category_id;
+//
+//    private Long parent_id;
+//
+//    @Size(max = 20, message = "资讯分类名称长度不超过 {max} 字符", groups = {Create.class, Update.class})
+//    @NotBlank(message="资讯分类名称不能为空", groups = {Create.class, Update.class, })
+//    private String category_name;
+//
+//    @Size(max = 200, message = "资讯分类描述长度不超过 {max} 字符", groups = {Create.class, Update.class})
+//    private String category_description;
+//    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间", groups = {Create.class, Update.class})
+//    private Integer sort;
+//    @RangeArray(message="状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = {Create.class, Update.class})
+//    private Integer status;
+//
+//}

+ 59 - 59
src/main/java/com/backendsys/entity/Cms/CmsArticleDTO.java

@@ -1,59 +1,59 @@
-package com.backendsys.entity.Cms;
-
-import com.backendsys.entity.validator.RangeArray;
-import jakarta.validation.constraints.NotEmpty;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Size;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class CmsArticleDTO {
-    public static interface Detail{}
-    public static interface Create{}
-    public static interface Update{}
-    public static interface Delete{}
-
-    /**
-     * cms_article
-     */
-
-    private String lang;
-
-    private Long id;
-    @NotNull(message="article_id 不能为空", groups = { CmsArticleDTO.Detail.class, CmsArticleDTO.Update.class })
-    private Long article_id;
-    private List<Long> article_ids;
-    // @NotNull(message="作者/用户ID不能为空", groups = { CmsArticleDTO.Create.class, CmsArticleDTO.Update.class })
-    private Long user_id;
-    private String user_nickname; // 简易写法
-    //private Map<String, Object> user;
-
-    @NotNull(message="资讯分类ID不能为空", groups = {CmsArticleDTO.Create.class, CmsArticleDTO.Update.class })
-    private Long category_id;
-    private String category_name; // 简易写法
-
-    private String title;
-    private String description;
-    private String content;
-
-    @NotEmpty(message="内容不能为空", groups = {CmsArticleDTO.Create.class, CmsArticleDTO.Update.class})
-    private List<CmsArticleTranslationsDTO> translations;
-
-    // 建议 5-8 个关键字
-    @Size(max = 100, message = "关键词长度不超过 {max} 字符", groups = {CmsArticleDTO.Create.class, CmsArticleDTO.Update.class})
-    private String meta_keyword;
-    @Size(max = 200, message = "关键词描述长度不超过 {max} 字符", groups = {CmsArticleDTO.Create.class, CmsArticleDTO.Update.class})
-    private String meta_description;
-
-    @RangeArray(message="资讯状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = {CmsArticleDTO.Create.class, CmsArticleDTO.Update.class})
-    private Integer status;
-    // @RangeArray(message="资讯审核状态取值有误,范围应是(-1审核拒绝, 1待审核, 2审核通过)", value = {"-1", "1", "2"}, groups = {CmsArticleDTO.Update.class})
-    // private Integer audit_status;
-
-    private Integer is_top;
-    private String create_time;
-    private String update_time;
-
-}
+//package com.backendsys.entity.Cms;
+//
+//import com.backendsys.entity.validator.RangeArray;
+//import jakarta.validation.constraints.NotEmpty;
+//import jakarta.validation.constraints.NotNull;
+//import jakarta.validation.constraints.Size;
+//import lombok.Data;
+//
+//import java.util.List;
+//
+//@Data
+//public class CmsArticleDTO {
+//    public static interface Detail{}
+//    public static interface Create{}
+//    public static interface Update{}
+//    public static interface Delete{}
+//
+//    /**
+//     * cms_article
+//     */
+//
+//    private String lang;
+//
+//    private Long id;
+//    @NotNull(message="article_id 不能为空", groups = { Detail.class, Update.class })
+//    private Long article_id;
+//    private List<Long> article_ids;
+//    // @NotNull(message="作者/用户ID不能为空", groups = { Create.class, Update.class })
+//    private Long user_id;
+//    private String user_nickname; // 简易写法
+//    //private Map<String, Object> user;
+//
+//    @NotNull(message="资讯分类ID不能为空", groups = {Create.class, Update.class })
+//    private Long category_id;
+//    private String category_name; // 简易写法
+//
+//    private String title;
+//    private String description;
+//    private String content;
+//
+//    @NotEmpty(message="内容不能为空", groups = {Create.class, Update.class})
+//    private List<CmsArticleTranslationsDTO> translations;
+//
+//    // 建议 5-8 个关键字
+//    @Size(max = 100, message = "关键词长度不超过 {max} 字符", groups = {Create.class, Update.class})
+//    private String meta_keyword;
+//    @Size(max = 200, message = "关键词描述长度不超过 {max} 字符", groups = {Create.class, Update.class})
+//    private String meta_description;
+//
+//    @RangeArray(message="资讯状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = {Create.class, Update.class})
+//    private Integer status;
+//    // @RangeArray(message="资讯审核状态取值有误,范围应是(-1审核拒绝, 1待审核, 2审核通过)", value = {"-1", "1", "2"}, groups = {Update.class})
+//    // private Integer audit_status;
+//
+//    private Integer is_top;
+//    private String create_time;
+//    private String update_time;
+//
+//}

+ 31 - 31
src/main/java/com/backendsys/entity/Cms/CmsArticleTranslationsDTO.java

@@ -1,31 +1,31 @@
-package com.backendsys.entity.Cms;
-
-import jakarta.validation.constraints.NotEmpty;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Size;
-import lombok.Data;
-
-@Data
-public class CmsArticleTranslationsDTO {
-
-    /**
-     * cms_article_i18n
-     */
-    @NotNull(message="article_id 不能为空")
-    private Long article_id;
-
-    @NotEmpty(message="语言不能为空")
-    private String language;
-
-    @Size(max = 100, message = "资讯标题长度不超过 {max} 字符")
-    @NotEmpty(message="资讯标题不能为空")
-    private String title;
-
-    @Size(max = 200, message = "资讯描述长度不超过 {max} 字符")
-    private String description;
-
-    @Size(max = 10000, message = "资讯内容长度不超过 {max} 字符")
-    @NotEmpty(message="资讯内容不能为空")
-    private String content;
-
-}
+//package com.backendsys.entity.Cms;
+//
+//import jakarta.validation.constraints.NotEmpty;
+//import jakarta.validation.constraints.NotNull;
+//import jakarta.validation.constraints.Size;
+//import lombok.Data;
+//
+//@Data
+//public class CmsArticleTranslationsDTO {
+//
+//    /**
+//     * cms_article_i18n
+//     */
+//    @NotNull(message="article_id 不能为空")
+//    private Long article_id;
+//
+//    @NotEmpty(message="语言不能为空")
+//    private String language;
+//
+//    @Size(max = 100, message = "资讯标题长度不超过 {max} 字符")
+//    @NotEmpty(message="资讯标题不能为空")
+//    private String title;
+//
+//    @Size(max = 200, message = "资讯描述长度不超过 {max} 字符")
+//    private String description;
+//
+//    @Size(max = 10000, message = "资讯内容长度不超过 {max} 字符")
+//    @NotEmpty(message="资讯内容不能为空")
+//    private String content;
+//
+//}

+ 36 - 36
src/main/java/com/backendsys/entity/Cms/CmsSiteInfoDTO.java

@@ -1,36 +1,36 @@
-package com.backendsys.entity.Cms;
-
-import com.backendsys.entity.validator.RangeArray;
-
-import jakarta.validation.constraints.*;
-import lombok.Data;
-
-@Data
-public class CmsSiteInfoDTO {
-    public static interface Detail{}
-    public static interface Update{}
-
-    private Long id;
-    @NotNull(message="site_info_id 不能为空", groups = { Detail.class })
-
-    @NotEmpty(message="网站名称不能为空", groups = { Update.class })
-    @Size(min = 2, max = 20, message = "网站名称长度在 {min}-{max} 字符", groups = { Update.class })
-    private String name;
-
-    @Size(max = 100, message = "关键词长度不超过 {max} 字符", groups = { Update.class })
-    private String meta_keyword;
-    @Size(max = 200, message = "关键词描述长度不超过 {max} 字符", groups = { Update.class })
-    private String meta_description;
-
-    @Size(max = 100, message = "版权信息长度不超过 {max} 字符", groups = { Update.class })
-    private String copyright;
-
-    @Size(max = 20, message = "备案信息长度不超过 {max} 字符", groups = { Update.class })
-    private String icp;
-
-    @RangeArray(message="状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = { Update.class })
-    private Integer status;
-
-    private String create_time;
-    private String update_time;
-}
+//package com.backendsys.entity.Cms;
+//
+//import com.backendsys.entity.validator.RangeArray;
+//
+//import jakarta.validation.constraints.*;
+//import lombok.Data;
+//
+//@Data
+//public class CmsSiteInfoDTO {
+//    public static interface Detail{}
+//    public static interface Update{}
+//
+//    private Long id;
+//    @NotNull(message="site_info_id 不能为空", groups = { Detail.class })
+//
+//    @NotEmpty(message="网站名称不能为空", groups = { Update.class })
+//    @Size(min = 2, max = 20, message = "网站名称长度在 {min}-{max} 字符", groups = { Update.class })
+//    private String name;
+//
+//    @Size(max = 100, message = "关键词长度不超过 {max} 字符", groups = { Update.class })
+//    private String meta_keyword;
+//    @Size(max = 200, message = "关键词描述长度不超过 {max} 字符", groups = { Update.class })
+//    private String meta_description;
+//
+//    @Size(max = 100, message = "版权信息长度不超过 {max} 字符", groups = { Update.class })
+//    private String copyright;
+//
+//    @Size(max = 20, message = "备案信息长度不超过 {max} 字符", groups = { Update.class })
+//    private String icp;
+//
+//    @RangeArray(message="状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = { Update.class })
+//    private Integer status;
+//
+//    private String create_time;
+//    private String update_time;
+//}

+ 16 - 16
src/main/java/com/backendsys/mapper/Cms/CmsArticleCategoryMapper.java

@@ -1,16 +1,16 @@
-package com.backendsys.mapper.Cms;
-
-import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface CmsArticleCategoryMapper {
-    List<Map<String, Object>> queryArticleCategoryList(CmsArticleCategoryDTO cmsArticleCategoryDTO);
-    Map<String, Object> queryArticleCategoryDetail(Long article_category_id);
-    long insertArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
-    long deleteArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
-    long updateArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
-}
+//package com.backendsys.mapper.Cms;
+//
+//import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface CmsArticleCategoryMapper {
+//    List<Map<String, Object>> queryArticleCategoryList(CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//    Map<String, Object> queryArticleCategoryDetail(Long article_category_id);
+//    long insertArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//    long deleteArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//    long updateArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//}

+ 75 - 75
src/main/java/com/backendsys/mapper/Cms/CmsArticleCategoryMapper.xml

@@ -1,84 +1,84 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.backendsys.mapper.Cms.CmsArticleCategoryMapper">
+<!--<?xml version="1.0" encoding="utf-8" ?>-->
+<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >-->
+<!--<mapper namespace="com.backendsys.mapper.Cms.CmsArticleCategoryMapper">-->
 
-    <sql id="includeArticleCategory">
-        id,
-        id article_category_id,
-        COALESCE(parent_id, '') parent_id,
-        category_name,
-        COALESCE(category_description, '') category_description,
-        sort,
-        status
-    </sql>
+<!--    <sql id="includeArticleCategory">-->
+<!--        id,-->
+<!--        id article_category_id,-->
+<!--        COALESCE(parent_id, '') parent_id,-->
+<!--        category_name,-->
+<!--        COALESCE(category_description, '') category_description,-->
+<!--        sort,-->
+<!--        status-->
+<!--    </sql>-->
 
-    <resultMap id="resultMapArticleCategory" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT"/>
-        <result property="parent_id" column="parent_id" javaType="java.lang.Long"/>
-        <result property="category_name" column="category_name" />
-        <result property="category_description" column="category_description" />
-        <result property="sort" column="sort" javaType="java.lang.Integer" />
-        <result property="status" column="status" javaType="java.lang.Integer" />
-    </resultMap>
+<!--    <resultMap id="resultMapArticleCategory" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT"/>-->
+<!--        <result property="parent_id" column="parent_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_name" column="category_name" />-->
+<!--        <result property="category_description" column="category_description" />-->
+<!--        <result property="sort" column="sort" javaType="java.lang.Integer" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer" />-->
+<!--    </resultMap>-->
 
-    <resultMap id="resultMapArticleCategoryDetail" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT"/>
-        <result property="parent_id" column="parent_id" javaType="java.lang.Long"/>
-        <result property="category_name" column="category_name" />
-        <result property="category_description" column="category_description" />
-        <result property="sort" column="sort" javaType="java.lang.Integer" />
-        <result property="status" column="status" javaType="java.lang.Integer" />
-    </resultMap>
+<!--    <resultMap id="resultMapArticleCategoryDetail" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT"/>-->
+<!--        <result property="parent_id" column="parent_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_name" column="category_name" />-->
+<!--        <result property="category_description" column="category_description" />-->
+<!--        <result property="sort" column="sort" javaType="java.lang.Integer" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer" />-->
+<!--    </resultMap>-->
 
-    <select id="queryArticleCategoryList" resultMap="resultMapArticleCategory">
-        SELECT <include refid="includeArticleCategory" />
-        FROM cms_article_category
-        <where>
-            <if test="category_name != null and category_name != ''">
-                AND category_name LIKE CONCAT('%', #{category_name}, '%')
-            </if>
-            <if test="status != null and status != ''">
-                AND status = #{status}
-            </if>
-        </where>
-        ORDER BY sort DESC
-    </select>
+<!--    <select id="queryArticleCategoryList" resultMap="resultMapArticleCategory">-->
+<!--        SELECT <include refid="includeArticleCategory" />-->
+<!--        FROM cms_article_category-->
+<!--        <where>-->
+<!--            <if test="category_name != null and category_name != ''">-->
+<!--                AND category_name LIKE CONCAT('%', #{category_name}, '%')-->
+<!--            </if>-->
+<!--            <if test="status != null and status != ''">-->
+<!--                AND status = #{status}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--        ORDER BY sort DESC-->
+<!--    </select>-->
 
-    <select id="queryArticleCategoryDetail" resultMap="resultMapArticleCategoryDetail">
-        SELECT <include refid="includeArticleCategory" />
-        FROM cms_article_category
-        WHERE id = #{article_category_id}
-    </select>
+<!--    <select id="queryArticleCategoryDetail" resultMap="resultMapArticleCategoryDetail">-->
+<!--        SELECT <include refid="includeArticleCategory" />-->
+<!--        FROM cms_article_category-->
+<!--        WHERE id = #{article_category_id}-->
+<!--    </select>-->
 
-    <insert id="insertArticleCategory" parameterType="com.backendsys.entity.Cms.CmsArticleCategoryDTO"
-        useGeneratedKeys="true" keyProperty="article_category_id">
-        INSERT INTO cms_article_category (category_name
-            <if test="category_description != null and category_description != ''">, category_description</if>
-            <if test="parent_id != null and parent_id != ''">, parent_id</if>
-            <if test="sort != null and sort != ''">, sort</if>
-            <if test="status != null and status != ''">, status</if>
-        )
-        VALUES (#{category_name}
-            <if test="category_description != null and category_description != ''">, #{category_description}</if>
-            <if test="parent_id != null and parent_id != ''">, #{parent_id}</if>
-            <if test="sort != null and sort != ''">, #{sort}</if>
-            <if test="status != null and status != ''">, #{status}</if>
-        )
-    </insert>
+<!--    <insert id="insertArticleCategory" parameterType="com.backendsys.entity.Cms.CmsArticleCategoryDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="article_category_id">-->
+<!--        INSERT INTO cms_article_category (category_name-->
+<!--            <if test="category_description != null and category_description != ''">, category_description</if>-->
+<!--            <if test="parent_id != null and parent_id != ''">, parent_id</if>-->
+<!--            <if test="sort != null and sort != ''">, sort</if>-->
+<!--            <if test="status != null and status != ''">, status</if>-->
+<!--        )-->
+<!--        VALUES (#{category_name}-->
+<!--            <if test="category_description != null and category_description != ''">, #{category_description}</if>-->
+<!--            <if test="parent_id != null and parent_id != ''">, #{parent_id}</if>-->
+<!--            <if test="sort != null and sort != ''">, #{sort}</if>-->
+<!--            <if test="status != null and status != ''">, #{status}</if>-->
+<!--        )-->
+<!--    </insert>-->
 
-    <update id="updateArticleCategory" parameterType="com.backendsys.entity.Cms.CmsArticleCategoryDTO"
-        useGeneratedKeys="true" keyProperty="article_category_id">
-        UPDATE cms_article_category
-        SET category_name = #{category_name}
-            <if test="category_description != null and category_description != ''">, category_description = #{category_description}</if>
-            <if test="parent_id != null and parent_id != ''">, parent_id = #{parent_id}</if>
-            <if test="sort != null and sort != ''">, sort = #{sort}</if>
-            <if test="status != null and status != ''">, status = #{status}</if>
-        WHERE id = #{article_category_id}
-    </update>
+<!--    <update id="updateArticleCategory" parameterType="com.backendsys.entity.Cms.CmsArticleCategoryDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="article_category_id">-->
+<!--        UPDATE cms_article_category-->
+<!--        SET category_name = #{category_name}-->
+<!--            <if test="category_description != null and category_description != ''">, category_description = #{category_description}</if>-->
+<!--            <if test="parent_id != null and parent_id != ''">, parent_id = #{parent_id}</if>-->
+<!--            <if test="sort != null and sort != ''">, sort = #{sort}</if>-->
+<!--            <if test="status != null and status != ''">, status = #{status}</if>-->
+<!--        WHERE id = #{article_category_id}-->
+<!--    </update>-->
 
-    <delete id="deleteArticleCategory">
-        DELETE FROM cms_article_category WHERE id = #{article_category_id}
-    </delete>
+<!--    <delete id="deleteArticleCategory">-->
+<!--        DELETE FROM cms_article_category WHERE id = #{article_category_id}-->
+<!--    </delete>-->
 
-</mapper>
+<!--</mapper>-->

+ 21 - 21
src/main/java/com/backendsys/mapper/Cms/CmsArticleMapper.java

@@ -1,21 +1,21 @@
-package com.backendsys.mapper.Cms;
-
-import com.backendsys.entity.Cms.CmsArticleDTO;
-import com.backendsys.entity.Cms.CmsArticleTranslationsDTO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface CmsArticleMapper {
-    List<Map<String, Object>> queryArticleList(CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> queryArticleDetail(CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> queryArticleDetailPublic(CmsArticleDTO cmsArticleDTO);
-    long insertArticle(CmsArticleDTO cmsArticleDTO);
-    long insertArticleTranslations(List<Map<String, Object>> translations);
-    long deleteArticle(CmsArticleDTO cmsArticleDTO);
-    long deleteArticleBatch(List<Long> ids);
-    long updateArticle(CmsArticleDTO cmsArticleDTO);
-    long updateArticleTranslations(List<CmsArticleTranslationsDTO> translations);
-}
+//package com.backendsys.mapper.Cms;
+//
+//import com.backendsys.entity.Cms.CmsArticleDTO;
+//import com.backendsys.entity.Cms.CmsArticleTranslationsDTO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface CmsArticleMapper {
+//    List<Map<String, Object>> queryArticleList(CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> queryArticleDetail(CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> queryArticleDetailPublic(CmsArticleDTO cmsArticleDTO);
+//    long insertArticle(CmsArticleDTO cmsArticleDTO);
+//    long insertArticleTranslations(List<Map<String, Object>> translations);
+//    long deleteArticle(CmsArticleDTO cmsArticleDTO);
+//    long deleteArticleBatch(List<Long> ids);
+//    long updateArticle(CmsArticleDTO cmsArticleDTO);
+//    long updateArticleTranslations(List<CmsArticleTranslationsDTO> translations);
+//}

+ 238 - 238
src/main/java/com/backendsys/mapper/Cms/CmsArticleMapper.xml

@@ -1,238 +1,238 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.backendsys.mapper.Cms.CmsArticleMapper">
-
-    <!--ac.user,-->
-    <!--ac.category,-->
-    <!-- a.audit_status audit_status, -->
-    <sql id="includeArticle">
-        a.id id,
-        a.id article_id,
-        uf.user_id user_id,
-        COALESCE(uf.nickname, '') user_nickname,
-        ac.id category_id,
-        ac.category_name category_name,
-        at.title title,
-        COALESCE(at.description, '') description,
-        a.status status,
-        a.is_top is_top,
-        a.create_time create_time,
-        a.update_time update_time
-    </sql>
-
-    <!-- at.title title,
-    at.content content,
-    COALESCE(at.description, '') description, -->
-    <!-- a.audit_status audit_status, -->
-    <sql id="includeArticleDetail">
-        a.id id,
-        a.id article_id,
-        uf.user_id user_id,
-        COALESCE(uf.nickname, '') user_nickname,
-        ac.id category_id,
-        ac.category_name category_name,
-        COALESCE(a.meta_keyword, '') meta_keyword,
-        COALESCE(a.meta_description, '') meta_description,
-        a.status status,
-        a.is_top is_top,
-        a.create_time create_time,
-        a.update_time update_time
-    </sql>
-    
-    
-    <sql id="includeArticleTranslation">
-        id,
-        article_id,
-        language,
-        title,
-        description,
-        content
-    </sql>
-
-    <resultMap id="resultMapArticle" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="article_id" column="article_id" javaType="java.lang.Long"/>
-        <result property="user_id" column="user_id" javaType="java.lang.Long"/>
-        <result property="category_id" column="category_id" javaType="java.lang.Long"/>
-        <result property="category_name" column="category_name" />
-        <result property="title" column="title" />
-        <result property="description" column="description" />
-        <result property="status" column="status" javaType="java.lang.Integer"/>
-        <!-- <result property="audit_status" column="audit_status" javaType="java.lang.Integer"/> -->
-        <result property="is_top" column="is_top" javaType="java.lang.Integer"/>
-        <result property="create_time" column="create_time" />
-        <result property="update_time" column="update_time" />
-    </resultMap>
-
-    <resultMap id="resultMapArticleDetail" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="article_id" column="article_id" javaType="java.lang.Long"/>
-        <result property="user_id" column="user_id" javaType="java.lang.Long"/>
-        <result property="category_id" column="category_id" javaType="java.lang.Long"/>
-        <result property="category_name" column="category_name" />
-        <!-- <result property="title" column="title" />
-        <result property="content" column="content" />
-        <result property="description" column="description" /> -->
-        <result property="meta_keyword" column="meta_keyword" />
-        <result property="meta_description" column="meta_description" />
-        <result property="status" column="status" javaType="java.lang.Integer"/>
-        <!-- <result property="audit_status" column="audit_status" javaType="java.lang.Integer"/> -->
-        <result property="is_top" column="is_top" javaType="java.lang.Integer"/>
-        <result property="create_time" column="create_time" />
-        <result property="update_time" column="update_time" />
-        <collection property="translations" javaType="java.util.List"
-            select="queryTranslationsById" column="id">
-            <id property="id" column="id" />
-            <result property="title" column="title" />
-            <result property="content" column="content" />
-            <result property="description" column="description" />
-        </collection>
-    </resultMap>
-
-    <sql id="leftJoinCategory">
-        LEFT JOIN cms_article_category ac ON a.category_id = ac.id
-    </sql>
-    <sql id="leftJoinUser">
-        LEFT JOIN sys_user_info uf ON a.user_id = uf.user_id
-    </sql>
-    <sql id="leftJoinTranslations">
-        LEFT JOIN cms_article_i18n at ON a.id = at.article_id
-    </sql>
-
-    <!-- 查 列表 -->
-    <select id="queryArticleList" resultMap="resultMapArticle">
-        SELECT
-           <include refid="includeArticle" />
-        FROM cms_article a
-        <include refid="leftJoinCategory" />
-        <include refid="leftJoinUser" />
-        <include refid="leftJoinTranslations" />
-        <where>
-            at.language = #{lang}
-            <if test="title != null and title != ''">
-                AND at.title LIKE CONCAT('%', #{title}, '%')
-            </if>
-            <if test="user_id != null and user_id != ''">
-                AND a.user_id = #{user_id}
-            </if>
-            <if test="category_id != null and category_id != ''">
-                AND a.category_id = #{category_id}
-            </if>
-            <if test="status != null and status != ''">
-                AND a.status = #{status}
-            </if>
-
-            <if test="create_time != null and create_time != ''">
-                AND a.create_time >= #{create_time}
-            </if>
-        </where>
-        ORDER BY a.is_top = 1 DESC, a.update_time DESC
-    </select>
-    <!-- <if test="audit_status != null and audit_status != ''">
-        AND a.audit_status = #{audit_status}
-    </if> -->
-
-    <!-- 查 详情 (带翻译 Array) (二次查询) -->
-    <select id="queryArticleDetail" resultMap="resultMapArticleDetail">
-        SELECT <include refid="includeArticleDetail" />
-        FROM cms_article a
-        <include refid="leftJoinCategory" />
-        <include refid="leftJoinUser" />
-        WHERE a.id = #{article_id}
-    </select>
-     <!-- and at.language = #{lang} -->
-     <!-- 查 翻译集合 (子查询) -->
-    <select id="queryTranslationsById" resultType="java.util.LinkedHashMap">
-        SELECT <include refid="includeArticleTranslation" />
-        FROM cms_article_i18n
-        WHERE article_id = #{id}
-    </select>
-
-
-    <!-- 查 详情 (公共) (带翻译 Object) (关联查询) -->
-    <select id="queryArticleDetailPublic" resultMap="resultMapArticle">
-        SELECT <include refid="includeArticle" />, content
-        FROM cms_article a
-        <include refid="leftJoinCategory" />
-        <include refid="leftJoinUser" />
-        <include refid="leftJoinTranslations" />
-        WHERE a.id = #{article_id} AND at.language = #{lang}
-    </select>
-
-
-    <!-- 审核功能,参考 /System/SysUserMapper.xml -->
-
-    <insert id="insertArticle" parameterType="com.backendsys.entity.Cms.CmsArticleDTO"
-        useGeneratedKeys="true" keyProperty="article_id">
-        INSERT INTO cms_article (
-            user_id, category_id
-            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword</if>
-            <if test="meta_description != null and meta_description != ''">, meta_description</if>
-            <if test="status != null and status != ''">, status</if>
-            <if test="is_top != null and is_top != ''">, is_top</if>
-        )
-        VALUES (
-            #{user_id}, #{category_id}
-            <if test="meta_keyword != null and meta_keyword != ''">, #{meta_keyword}</if>
-            <if test="meta_description != null and meta_description != ''">, #{meta_description}</if>
-            <if test="status != null and status != ''">, #{status}</if>
-            <if test="is_top != null and is_top != ''">, #{is_top}</if>
-        );
-    </insert>
-    <insert id="insertArticleTranslations" parameterType="java.util.List">
-        INSERT INTO cms_article_i18n (
-            article_id, language, title, content, description
-        )
-        VALUES 
-        <foreach collection="translations" item="translation" separator=",">
-            (#{translation.article_id}, #{translation.language}, #{translation.title}, #{translation.content}, #{translation.description})
-        </foreach>
-    </insert>
-
-
-    <update id="updateArticle" parameterType="com.backendsys.entity.Cms.CmsArticleDTO"
-        useGeneratedKeys="true" keyProperty="article_id">
-        UPDATE cms_article
-        SET
-            category_id = #{category_id}
-            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword = #{meta_keyword}</if>
-            <if test="meta_description != null and meta_description != ''">, meta_description = #{meta_description}</if>
-            <if test="status != null and status != ''">, status = #{status}</if>
-            <if test="is_top != null and is_top != ''">, is_top = #{is_top}</if>
-        WHERE id = #{article_id};
-
-        <foreach collection="translations" item="translation" separator=";">
-            UPDATE cms_article_i18n
-            <set>
-                title = #{translation.title},
-                content = #{translation.content},
-                <if test="translation.description != null and translation.description != ''">
-                    description = #{translation.description}
-                </if>
-            </set>
-            WHERE article_id = ${article_id} AND language = #{translation.language}
-        </foreach>
-
-    </update>
-    <!-- <if test="audit_status != null and audit_status != ''">, audit_status = #{audit_status}</if> -->
-
-    <!-- 删除 -->
-    <delete id="deleteArticle" parameterType="java.lang.Long">
-        DELETE FROM cms_article WHERE id = #{article_id};
-        DELETE FROM cms_article_i18n WHERE article_id = #{article_id};
-    </delete>
-
-    <!-- 删除 (批量) -->
-    <delete id="deleteArticleBatch" parameterType="java.lang.Long">
-        DELETE FROM cms_article WHERE id IN
-        <foreach collection="ids" item="id" open="(" separator="," close=")">
-            #{id}
-        </foreach>;
-
-        DELETE FROM cms_article_i18n WHERE article_id IN
-        <foreach collection="ids" item="id" open="(" separator="," close=")">
-            #{id}
-        </foreach>;
-    </delete>
-
-</mapper>
+<!--<?xml version="1.0" encoding="utf-8" ?>-->
+<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >-->
+<!--<mapper namespace="com.backendsys.mapper.Cms.CmsArticleMapper">-->
+
+<!--    &lt;!&ndash;ac.user,&ndash;&gt;-->
+<!--    &lt;!&ndash;ac.category,&ndash;&gt;-->
+<!--    &lt;!&ndash; a.audit_status audit_status, &ndash;&gt;-->
+<!--    <sql id="includeArticle">-->
+<!--        a.id id,-->
+<!--        a.id article_id,-->
+<!--        uf.user_id user_id,-->
+<!--        COALESCE(uf.nickname, '') user_nickname,-->
+<!--        ac.id category_id,-->
+<!--        ac.category_name category_name,-->
+<!--        at.title title,-->
+<!--        COALESCE(at.description, '') description,-->
+<!--        a.status status,-->
+<!--        a.is_top is_top,-->
+<!--        a.create_time create_time,-->
+<!--        a.update_time update_time-->
+<!--    </sql>-->
+
+<!--    &lt;!&ndash; at.title title,-->
+<!--    at.content content,-->
+<!--    COALESCE(at.description, '') description, &ndash;&gt;-->
+<!--    &lt;!&ndash; a.audit_status audit_status, &ndash;&gt;-->
+<!--    <sql id="includeArticleDetail">-->
+<!--        a.id id,-->
+<!--        a.id article_id,-->
+<!--        uf.user_id user_id,-->
+<!--        COALESCE(uf.nickname, '') user_nickname,-->
+<!--        ac.id category_id,-->
+<!--        ac.category_name category_name,-->
+<!--        COALESCE(a.meta_keyword, '') meta_keyword,-->
+<!--        COALESCE(a.meta_description, '') meta_description,-->
+<!--        a.status status,-->
+<!--        a.is_top is_top,-->
+<!--        a.create_time create_time,-->
+<!--        a.update_time update_time-->
+<!--    </sql>-->
+<!--    -->
+<!--    -->
+<!--    <sql id="includeArticleTranslation">-->
+<!--        id,-->
+<!--        article_id,-->
+<!--        language,-->
+<!--        title,-->
+<!--        description,-->
+<!--        content-->
+<!--    </sql>-->
+
+<!--    <resultMap id="resultMapArticle" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="article_id" column="article_id" javaType="java.lang.Long"/>-->
+<!--        <result property="user_id" column="user_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_id" column="category_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_name" column="category_name" />-->
+<!--        <result property="title" column="title" />-->
+<!--        <result property="description" column="description" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer"/>-->
+<!--        &lt;!&ndash; <result property="audit_status" column="audit_status" javaType="java.lang.Integer"/> &ndash;&gt;-->
+<!--        <result property="is_top" column="is_top" javaType="java.lang.Integer"/>-->
+<!--        <result property="create_time" column="create_time" />-->
+<!--        <result property="update_time" column="update_time" />-->
+<!--    </resultMap>-->
+
+<!--    <resultMap id="resultMapArticleDetail" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="article_id" column="article_id" javaType="java.lang.Long"/>-->
+<!--        <result property="user_id" column="user_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_id" column="category_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_name" column="category_name" />-->
+<!--        &lt;!&ndash; <result property="title" column="title" />-->
+<!--        <result property="content" column="content" />-->
+<!--        <result property="description" column="description" /> &ndash;&gt;-->
+<!--        <result property="meta_keyword" column="meta_keyword" />-->
+<!--        <result property="meta_description" column="meta_description" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer"/>-->
+<!--        &lt;!&ndash; <result property="audit_status" column="audit_status" javaType="java.lang.Integer"/> &ndash;&gt;-->
+<!--        <result property="is_top" column="is_top" javaType="java.lang.Integer"/>-->
+<!--        <result property="create_time" column="create_time" />-->
+<!--        <result property="update_time" column="update_time" />-->
+<!--        <collection property="translations" javaType="java.util.List"-->
+<!--            select="queryTranslationsById" column="id">-->
+<!--            <id property="id" column="id" />-->
+<!--            <result property="title" column="title" />-->
+<!--            <result property="content" column="content" />-->
+<!--            <result property="description" column="description" />-->
+<!--        </collection>-->
+<!--    </resultMap>-->
+
+<!--    <sql id="leftJoinCategory">-->
+<!--        LEFT JOIN cms_article_category ac ON a.category_id = ac.id-->
+<!--    </sql>-->
+<!--    <sql id="leftJoinUser">-->
+<!--        LEFT JOIN sys_user_info uf ON a.user_id = uf.user_id-->
+<!--    </sql>-->
+<!--    <sql id="leftJoinTranslations">-->
+<!--        LEFT JOIN cms_article_i18n at ON a.id = at.article_id-->
+<!--    </sql>-->
+
+<!--    &lt;!&ndash; 查 列表 &ndash;&gt;-->
+<!--    <select id="queryArticleList" resultMap="resultMapArticle">-->
+<!--        SELECT-->
+<!--           <include refid="includeArticle" />-->
+<!--        FROM cms_article a-->
+<!--        <include refid="leftJoinCategory" />-->
+<!--        <include refid="leftJoinUser" />-->
+<!--        <include refid="leftJoinTranslations" />-->
+<!--        <where>-->
+<!--            at.language = #{lang}-->
+<!--            <if test="title != null and title != ''">-->
+<!--                AND at.title LIKE CONCAT('%', #{title}, '%')-->
+<!--            </if>-->
+<!--            <if test="user_id != null and user_id != ''">-->
+<!--                AND a.user_id = #{user_id}-->
+<!--            </if>-->
+<!--            <if test="category_id != null and category_id != ''">-->
+<!--                AND a.category_id = #{category_id}-->
+<!--            </if>-->
+<!--            <if test="status != null and status != ''">-->
+<!--                AND a.status = #{status}-->
+<!--            </if>-->
+
+<!--            <if test="create_time != null and create_time != ''">-->
+<!--                AND a.create_time >= #{create_time}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--        ORDER BY a.is_top = 1 DESC, a.update_time DESC-->
+<!--    </select>-->
+<!--    &lt;!&ndash; <if test="audit_status != null and audit_status != ''">-->
+<!--        AND a.audit_status = #{audit_status}-->
+<!--    </if> &ndash;&gt;-->
+
+<!--    &lt;!&ndash; 查 详情 (带翻译 Array) (二次查询) &ndash;&gt;-->
+<!--    <select id="queryArticleDetail" resultMap="resultMapArticleDetail">-->
+<!--        SELECT <include refid="includeArticleDetail" />-->
+<!--        FROM cms_article a-->
+<!--        <include refid="leftJoinCategory" />-->
+<!--        <include refid="leftJoinUser" />-->
+<!--        WHERE a.id = #{article_id}-->
+<!--    </select>-->
+<!--     &lt;!&ndash; and at.language = #{lang} &ndash;&gt;-->
+<!--     &lt;!&ndash; 查 翻译集合 (子查询) &ndash;&gt;-->
+<!--    <select id="queryTranslationsById" resultType="java.util.LinkedHashMap">-->
+<!--        SELECT <include refid="includeArticleTranslation" />-->
+<!--        FROM cms_article_i18n-->
+<!--        WHERE article_id = #{id}-->
+<!--    </select>-->
+
+
+<!--    &lt;!&ndash; 查 详情 (公共) (带翻译 Object) (关联查询) &ndash;&gt;-->
+<!--    <select id="queryArticleDetailPublic" resultMap="resultMapArticle">-->
+<!--        SELECT <include refid="includeArticle" />, content-->
+<!--        FROM cms_article a-->
+<!--        <include refid="leftJoinCategory" />-->
+<!--        <include refid="leftJoinUser" />-->
+<!--        <include refid="leftJoinTranslations" />-->
+<!--        WHERE a.id = #{article_id} AND at.language = #{lang}-->
+<!--    </select>-->
+
+
+<!--    &lt;!&ndash; 审核功能,参考 /System/SysUserMapper.xml &ndash;&gt;-->
+
+<!--    <insert id="insertArticle" parameterType="com.backendsys.entity.Cms.CmsArticleDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="article_id">-->
+<!--        INSERT INTO cms_article (-->
+<!--            user_id, category_id-->
+<!--            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword</if>-->
+<!--            <if test="meta_description != null and meta_description != ''">, meta_description</if>-->
+<!--            <if test="status != null and status != ''">, status</if>-->
+<!--            <if test="is_top != null and is_top != ''">, is_top</if>-->
+<!--        )-->
+<!--        VALUES (-->
+<!--            #{user_id}, #{category_id}-->
+<!--            <if test="meta_keyword != null and meta_keyword != ''">, #{meta_keyword}</if>-->
+<!--            <if test="meta_description != null and meta_description != ''">, #{meta_description}</if>-->
+<!--            <if test="status != null and status != ''">, #{status}</if>-->
+<!--            <if test="is_top != null and is_top != ''">, #{is_top}</if>-->
+<!--        );-->
+<!--    </insert>-->
+<!--    <insert id="insertArticleTranslations" parameterType="java.util.List">-->
+<!--        INSERT INTO cms_article_i18n (-->
+<!--            article_id, language, title, content, description-->
+<!--        )-->
+<!--        VALUES -->
+<!--        <foreach collection="translations" item="translation" separator=",">-->
+<!--            (#{translation.article_id}, #{translation.language}, #{translation.title}, #{translation.content}, #{translation.description})-->
+<!--        </foreach>-->
+<!--    </insert>-->
+
+
+<!--    <update id="updateArticle" parameterType="com.backendsys.entity.Cms.CmsArticleDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="article_id">-->
+<!--        UPDATE cms_article-->
+<!--        SET-->
+<!--            category_id = #{category_id}-->
+<!--            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword = #{meta_keyword}</if>-->
+<!--            <if test="meta_description != null and meta_description != ''">, meta_description = #{meta_description}</if>-->
+<!--            <if test="status != null and status != ''">, status = #{status}</if>-->
+<!--            <if test="is_top != null and is_top != ''">, is_top = #{is_top}</if>-->
+<!--        WHERE id = #{article_id};-->
+
+<!--        <foreach collection="translations" item="translation" separator=";">-->
+<!--            UPDATE cms_article_i18n-->
+<!--            <set>-->
+<!--                title = #{translation.title},-->
+<!--                content = #{translation.content},-->
+<!--                <if test="translation.description != null and translation.description != ''">-->
+<!--                    description = #{translation.description}-->
+<!--                </if>-->
+<!--            </set>-->
+<!--            WHERE article_id = ${article_id} AND language = #{translation.language}-->
+<!--        </foreach>-->
+
+<!--    </update>-->
+<!--    &lt;!&ndash; <if test="audit_status != null and audit_status != ''">, audit_status = #{audit_status}</if> &ndash;&gt;-->
+
+<!--    &lt;!&ndash; 删除 &ndash;&gt;-->
+<!--    <delete id="deleteArticle" parameterType="java.lang.Long">-->
+<!--        DELETE FROM cms_article WHERE id = #{article_id};-->
+<!--        DELETE FROM cms_article_i18n WHERE article_id = #{article_id};-->
+<!--    </delete>-->
+
+<!--    &lt;!&ndash; 删除 (批量) &ndash;&gt;-->
+<!--    <delete id="deleteArticleBatch" parameterType="java.lang.Long">-->
+<!--        DELETE FROM cms_article WHERE id IN-->
+<!--        <foreach collection="ids" item="id" open="(" separator="," close=")">-->
+<!--            #{id}-->
+<!--        </foreach>;-->
+
+<!--        DELETE FROM cms_article_i18n WHERE article_id IN-->
+<!--        <foreach collection="ids" item="id" open="(" separator="," close=")">-->
+<!--            #{id}-->
+<!--        </foreach>;-->
+<!--    </delete>-->
+
+<!--</mapper>-->

+ 14 - 14
src/main/java/com/backendsys/mapper/Cms/CmsSiteInfoMapper.java

@@ -1,14 +1,14 @@
-package com.backendsys.mapper.Cms;
-
-import org.apache.ibatis.annotations.Mapper;
-
-import com.backendsys.entity.Cms.CmsSiteInfoDTO;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface CmsSiteInfoMapper {
-    List<Map<String, Object>> querySiteInfoList(CmsSiteInfoDTO cmsSiteInfoDTO);
-    long updateSiteInfo(CmsSiteInfoDTO cmsSiteInfoDTO);
-}
+//package com.backendsys.mapper.Cms;
+//
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import com.backendsys.entity.Cms.CmsSiteInfoDTO;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface CmsSiteInfoMapper {
+//    List<Map<String, Object>> querySiteInfoList(CmsSiteInfoDTO cmsSiteInfoDTO);
+//    long updateSiteInfo(CmsSiteInfoDTO cmsSiteInfoDTO);
+//}

+ 38 - 38
src/main/java/com/backendsys/mapper/Cms/CmsSiteInfoMapper.xml

@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.backendsys.mapper.Cms.CmsSiteInfoMapper">
+<!--<?xml version="1.0" encoding="utf-8" ?>-->
+<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >-->
+<!--<mapper namespace="com.backendsys.mapper.Cms.CmsSiteInfoMapper">-->
 
-    <sql id="includeSiteInfo">
-        id,
-        name,
-        COALESCE(meta_keyword, '') meta_keyword,
-        COALESCE(meta_description, '') meta_description,
-        COALESCE(copyright, '') copyright,
-        COALESCE(icp, '') icp,
-        status
-    </sql>
+<!--    <sql id="includeSiteInfo">-->
+<!--        id,-->
+<!--        name,-->
+<!--        COALESCE(meta_keyword, '') meta_keyword,-->
+<!--        COALESCE(meta_description, '') meta_description,-->
+<!--        COALESCE(copyright, '') copyright,-->
+<!--        COALESCE(icp, '') icp,-->
+<!--        status-->
+<!--    </sql>-->
 
-    <resultMap id="resultMapSiteInfo" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT"/>
-        <result property="name" column="name" />
-        <result property="meta_keyword" column="meta_keyword" />
-        <result property="meta_description" column="meta_description" />
-        <result property="copyright" column="copyright" />
-        <result property="icp" column="icp" />
-        <result property="status" column="status" javaType="java.lang.Integer" />
-    </resultMap>
+<!--    <resultMap id="resultMapSiteInfo" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT"/>-->
+<!--        <result property="name" column="name" />-->
+<!--        <result property="meta_keyword" column="meta_keyword" />-->
+<!--        <result property="meta_description" column="meta_description" />-->
+<!--        <result property="copyright" column="copyright" />-->
+<!--        <result property="icp" column="icp" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer" />-->
+<!--    </resultMap>-->
 
-    <select id="querySiteInfoList" resultMap="resultMapSiteInfo">
-        SELECT <include refid="includeSiteInfo" />
-        FROM cms_site_info
-        LIMIT 1
-    </select>
+<!--    <select id="querySiteInfoList" resultMap="resultMapSiteInfo">-->
+<!--        SELECT <include refid="includeSiteInfo" />-->
+<!--        FROM cms_site_info-->
+<!--        LIMIT 1-->
+<!--    </select>-->
 
-    <update id="updateSiteInfo" parameterType="com.backendsys.entity.Cms.CmsSiteInfoDTO"
-        useGeneratedKeys="true" keyProperty="site_info_id">
-        UPDATE cms_site_info
-        SET name = #{name}
-            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword = #{meta_keyword}</if>
-            <if test="meta_description != null and meta_description != ''">, meta_description = #{meta_description}</if>
-            <if test="copyright != null and copyright != ''">, copyright = #{copyright}</if>
-            <if test="icp != null and icp != ''">, icp = #{icp}</if>
-            <if test="status != null and status != ''">, status = #{status}</if>
-        WHERE id = #{id}
-    </update>
+<!--    <update id="updateSiteInfo" parameterType="com.backendsys.entity.Cms.CmsSiteInfoDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="site_info_id">-->
+<!--        UPDATE cms_site_info-->
+<!--        SET name = #{name}-->
+<!--            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword = #{meta_keyword}</if>-->
+<!--            <if test="meta_description != null and meta_description != ''">, meta_description = #{meta_description}</if>-->
+<!--            <if test="copyright != null and copyright != ''">, copyright = #{copyright}</if>-->
+<!--            <if test="icp != null and icp != ''">, icp = #{icp}</if>-->
+<!--            <if test="status != null and status != ''">, status = #{status}</if>-->
+<!--        WHERE id = #{id}-->
+<!--    </update>-->
 
-</mapper>
+<!--</mapper>-->

+ 0 - 1
src/main/java/com/backendsys/modules/cms/article/entity/ArticleCategory.java

@@ -1,6 +1,5 @@
 package com.backendsys.modules.cms.article.entity;
 
-import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
 import com.backendsys.entity.validator.RangeArray;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;

+ 1 - 0
src/main/java/com/backendsys/modules/cms/siteinfo/controller/SiteInfoController.java

@@ -28,6 +28,7 @@ public class SiteInfoController {
         return Result.success().put("data", siteInfoService.selectSiteInfo());
     }
 
+    @Operation(summary = "编辑站点信息")
     @PreAuthorize("@sr.hasPermission('13.1')")
     @PutMapping("/api/v2/cms/site/updateSiteInfo")
     public Result updateSiteInfo(@Validated(SiteInfo.Update.class) @RequestBody SiteInfo siteInfo) {

+ 1 - 1
src/main/java/com/backendsys/modules/cms/siteinfo/service/SiteInfoService.java

@@ -9,7 +9,7 @@ public interface SiteInfoService {
 
     // 获取站点信息
     SiteInfo selectSiteInfo();
-    // 更新站点信息
+    // 编辑站点信息
     Map<String, Object> updateSiteInfo(SiteInfo siteInfo);
 
 }

+ 1 - 1
src/main/java/com/backendsys/modules/cms/siteinfo/service/impl/SiteInfoServiceImpl.java

@@ -23,7 +23,7 @@ public class SiteInfoServiceImpl implements SiteInfoService {
     }
 
     /**
-     * 更新站点信息
+     * 编辑站点信息
      */
     @Override
     public Map<String, Object> updateSiteInfo(SiteInfo siteInfo) {

+ 82 - 0
src/main/java/com/backendsys/modules/download/controller/DownloadLocalController.java

@@ -0,0 +1,82 @@
+package com.backendsys.modules.download.controller;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.InputStreamResource;
+import org.springframework.core.io.Resource;
+import org.springframework.http.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.*;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+
+/**
+ * 下载本地文件
+ */
+@RestController
+public class DownloadLocalController {
+
+    @Value("${file.upload.directory}") // 配置保存文件的目录
+    private String uploadDirectory;
+
+    // 判断文件是否为图片文件
+    private boolean isImageFile(File file) {
+        String extension = getExtension(file.getName());
+        return Arrays.asList("jpg", "jpeg", "png", "gif").contains(extension.toLowerCase());
+    }
+
+    // 获取图片文件对应的MediaType
+    private MediaType getImageMediaType(File file) {
+        String extension = getExtension(file.getName());
+        switch (extension.toLowerCase()) {
+            case "jpg":
+            case "jpeg": return MediaType.IMAGE_JPEG;
+            case "png": return MediaType.IMAGE_PNG;
+            case "gif": return MediaType.IMAGE_GIF;
+            default: return MediaType.APPLICATION_OCTET_STREAM;
+        }
+    }
+
+    public static String getExtension(String filename) {
+        if (filename == null) { return ""; }
+        int dotIndex = filename.lastIndexOf(".");
+        if (dotIndex > 0 && dotIndex < filename.length() - 1) {
+            return filename.substring(dotIndex + 1);
+        }
+        return "";
+    }
+
+    @GetMapping("/uploads/{folder}/{filename:.+}")
+    public ResponseEntity<Resource> serveFile(@PathVariable String folder, @PathVariable String filename) throws IOException {
+
+        File file = new File(uploadDirectory + folder + "/" + filename);
+        // 如果是图片,则直接显示;如果是文件,则是下载
+        HttpHeaders headers = new HttpHeaders();
+        if (isImageFile(file)) {
+            // 如果是图片文件,设置Content-Type为对应的图片MIME类型
+            headers.setContentType(getImageMediaType(file));
+        } else {
+            // 如果不是图片文件,设置Content-Disposition以附件形式下载
+            headers.setContentDisposition(ContentDisposition.attachment().filename(file.getName()).build());
+            headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+        }
+        if (!file.exists()) {
+            String message = "图片不存在";
+            InputStream inputStream = new ByteArrayInputStream(message.getBytes(StandardCharsets.UTF_8));
+            InputStreamResource resource = new InputStreamResource(inputStream);
+            return ResponseEntity.status(HttpStatus.NOT_FOUND)
+                    .contentType(MediaType.valueOf("text/plain; charset=UTF-8"))
+                    .body(resource);
+        }
+        InputStreamResource resource = new InputStreamResource(new FileInputStream(file));
+        return ResponseEntity.ok()
+                .headers(headers)
+                .contentLength(file.length())
+                //.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"")
+                //.contentType(MediaType.APPLICATION_OCTET_STREAM)
+                .body(resource);
+    }
+
+}

+ 13 - 13
src/main/java/com/backendsys/service/Cms/CmsArticleCategoryService.java

@@ -1,13 +1,13 @@
-package com.backendsys.service.Cms;
-
-import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
-
-import java.util.Map;
-
-public interface CmsArticleCategoryService<T> {
-    Map<String, Object> queryArticleCategory(Integer pageNum, Integer pageSize, CmsArticleCategoryDTO cmsArticleCategoryDTO);
-    Map<String, Object> queryArticleCategoryDetail(Long article_category_id);
-    Map<String, Object> insertArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
-    Map<String, Object> updateArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
-    Map<String, Object> deleteArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
-}
+//package com.backendsys.service.Cms;
+//
+//import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
+//
+//import java.util.Map;
+//
+//public interface CmsArticleCategoryService<T> {
+//    Map<String, Object> queryArticleCategory(Integer pageNum, Integer pageSize, CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//    Map<String, Object> queryArticleCategoryDetail(Long article_category_id);
+//    Map<String, Object> insertArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//    Map<String, Object> updateArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//    Map<String, Object> deleteArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO);
+//}

+ 74 - 74
src/main/java/com/backendsys/service/Cms/CmsArticleCategoryServiceImpl.java

@@ -1,74 +1,74 @@
-package com.backendsys.service.Cms;
-
-import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
-import com.backendsys.mapper.Cms.CmsArticleCategoryMapper;
-import com.backendsys.utils.response.PageInfoResult;
-import com.github.pagehelper.PageHelper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.Map;
-
-@Service
-public class CmsArticleCategoryServiceImpl<T> implements CmsArticleCategoryService {
-
-    @Autowired
-    private CmsArticleCategoryMapper cmsArticleCategoryMapper;
-
-    /**
-     * 查询 资讯分类列表
-     */
-    @Override
-    public Map<String, Object> queryArticleCategory(Integer pageNum, Integer pageSize, CmsArticleCategoryDTO cmsArticleCategoryDTO) {
-        // 分页查询
-        if (pageNum != null && pageSize != null) {
-            PageHelper.startPage(pageNum, pageSize);
-            PageHelper.getLocalPage().setPageSizeZero(true);
-        }
-        // 分页输出 (自定义)
-        List<Map<String, Object>> list = cmsArticleCategoryMapper.queryArticleCategoryList(cmsArticleCategoryDTO);
-        PageInfoResult pageInfoResult = new PageInfoResult(list);
-        return pageInfoResult.toMap();
-    }
-
-    /**
-     * 查询 资讯分类详情
-     */
-    @Override
-    public Map<String, Object> queryArticleCategoryDetail(Long article_category_id) {
-        return cmsArticleCategoryMapper.queryArticleCategoryDetail(article_category_id);
-    }
-
-    /**
-     * 创建 资讯分类
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> insertArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO) {
-        cmsArticleCategoryMapper.insertArticleCategory(cmsArticleCategoryDTO);
-        return Map.of("article_category_id", cmsArticleCategoryDTO.getArticle_category_id());
-    }
-
-    /**
-     * 更新 资讯分类
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> updateArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO) {
-        cmsArticleCategoryMapper.updateArticleCategory(cmsArticleCategoryDTO);
-        return Map.of("article_category_id", cmsArticleCategoryDTO.getArticle_category_id());
-    }
-
-    /**
-     * 删除 资讯分类
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> deleteArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO) {
-        cmsArticleCategoryMapper.deleteArticleCategory(cmsArticleCategoryDTO);
-        return Map.of("article_category_id", cmsArticleCategoryDTO.getArticle_category_id());
-    }
-
-}
+//package com.backendsys.service.Cms;
+//
+//import com.backendsys.entity.Cms.CmsArticleCategoryDTO;
+//import com.backendsys.mapper.Cms.CmsArticleCategoryMapper;
+//import com.backendsys.utils.response.PageInfoResult;
+//import com.github.pagehelper.PageHelper;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Service
+//public class CmsArticleCategoryServiceImpl<T> implements CmsArticleCategoryService {
+//
+//    @Autowired
+//    private CmsArticleCategoryMapper cmsArticleCategoryMapper;
+//
+//    /**
+//     * 查询 资讯分类列表
+//     */
+//    @Override
+//    public Map<String, Object> queryArticleCategory(Integer pageNum, Integer pageSize, CmsArticleCategoryDTO cmsArticleCategoryDTO) {
+//        // 分页查询
+//        if (pageNum != null && pageSize != null) {
+//            PageHelper.startPage(pageNum, pageSize);
+//            PageHelper.getLocalPage().setPageSizeZero(true);
+//        }
+//        // 分页输出 (自定义)
+//        List<Map<String, Object>> list = cmsArticleCategoryMapper.queryArticleCategoryList(cmsArticleCategoryDTO);
+//        PageInfoResult pageInfoResult = new PageInfoResult(list);
+//        return pageInfoResult.toMap();
+//    }
+//
+//    /**
+//     * 查询 资讯分类详情
+//     */
+//    @Override
+//    public Map<String, Object> queryArticleCategoryDetail(Long article_category_id) {
+//        return cmsArticleCategoryMapper.queryArticleCategoryDetail(article_category_id);
+//    }
+//
+//    /**
+//     * 创建 资讯分类
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> insertArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO) {
+//        cmsArticleCategoryMapper.insertArticleCategory(cmsArticleCategoryDTO);
+//        return Map.of("article_category_id", cmsArticleCategoryDTO.getArticle_category_id());
+//    }
+//
+//    /**
+//     * 更新 资讯分类
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> updateArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO) {
+//        cmsArticleCategoryMapper.updateArticleCategory(cmsArticleCategoryDTO);
+//        return Map.of("article_category_id", cmsArticleCategoryDTO.getArticle_category_id());
+//    }
+//
+//    /**
+//     * 删除 资讯分类
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> deleteArticleCategory(CmsArticleCategoryDTO cmsArticleCategoryDTO) {
+//        cmsArticleCategoryMapper.deleteArticleCategory(cmsArticleCategoryDTO);
+//        return Map.of("article_category_id", cmsArticleCategoryDTO.getArticle_category_id());
+//    }
+//
+//}

+ 16 - 16
src/main/java/com/backendsys/service/Cms/CmsArticleService.java

@@ -1,16 +1,16 @@
-package com.backendsys.service.Cms;
-
-import com.backendsys.entity.Cms.CmsArticleDTO;
-
-import java.util.List;
-import java.util.Map;
-
-public interface CmsArticleService {
-    Map<String, Object> queryArticle(Integer pageNum, Integer pageSize, CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> queryArticleDetail(CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> queryArticleDetailPublic(CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> insertArticle(CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> updateArticle(CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> deleteArticle(CmsArticleDTO cmsArticleDTO);
-    Map<String, Object> deleteArticleBatch(List<Long> ids);
-}
+//package com.backendsys.service.Cms;
+//
+//import com.backendsys.entity.Cms.CmsArticleDTO;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//public interface CmsArticleService {
+//    Map<String, Object> queryArticle(Integer pageNum, Integer pageSize, CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> queryArticleDetail(CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> queryArticleDetailPublic(CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> insertArticle(CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> updateArticle(CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> deleteArticle(CmsArticleDTO cmsArticleDTO);
+//    Map<String, Object> deleteArticleBatch(List<Long> ids);
+//}

+ 122 - 122
src/main/java/com/backendsys/service/Cms/CmsArticleServiceImpl.java

@@ -1,122 +1,122 @@
-package com.backendsys.service.Cms;
-
-import com.backendsys.utils.LanguageUtil;
-import com.backendsys.entity.Cms.CmsArticleDTO;
-import com.backendsys.entity.Cms.CmsArticleTranslationsDTO;
-import com.backendsys.mapper.Cms.CmsArticleMapper;
-import com.backendsys.utils.response.PageInfoResult;
-import com.github.pagehelper.PageHelper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Collections;
-
-@Service
-public class CmsArticleServiceImpl implements CmsArticleService {
-
-    @Autowired
-    private CmsArticleMapper cmsArticleMapper;
-
-    /**
-     * 查询 资讯列表
-     */
-    @Override
-    public Map<String, Object> queryArticle(Integer pageNum, Integer pageSize, CmsArticleDTO cmsArticleDTO) {
-        // 分页查询
-        if (pageNum != null && pageSize != null) {
-            PageHelper.startPage(pageNum, pageSize);
-            PageHelper.getLocalPage().setPageSizeZero(true);
-        }
-        // 分页输出 (自定义)
-        List<Map<String, Object>> list = cmsArticleMapper.queryArticleList(cmsArticleDTO);
-        PageInfoResult pageInfoResult = new PageInfoResult(list);
-        return pageInfoResult.toMap();
-    }
-
-    /**
-     * 查询 资讯翻译 (无分页)
-     */
-    // @Override
-    // public List<Map<String, Object>> queryArticleTranslation(CmsArticleDTO cmsArticleDTO) {
-    //     return cmsArticleMapper.queryArticleTranslation(cmsArticleDTO);
-    // }
-
-    /**
-     * 查询 资讯详情
-     */
-    @Override
-    public Map<String, Object> queryArticleDetail(CmsArticleDTO cmsArticleDTO) {
-        return cmsArticleMapper.queryArticleDetail(cmsArticleDTO);
-    }
-
-    @Override
-    public Map<String, Object> queryArticleDetailPublic(CmsArticleDTO cmsArticleDTO) {
-        return cmsArticleMapper.queryArticleDetailPublic(cmsArticleDTO);
-    }
-    
-
-
-    @Autowired
-    private LanguageUtil languageUtil;
-
-    /**
-     * 创建 资讯
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> insertArticle(CmsArticleDTO cmsArticleDTO) {
-
-        cmsArticleMapper.insertArticle(cmsArticleDTO);
-        
-        // 获得翻译字段数组,并批量添加
-        Map<String, Object> fieldPrimary = Collections.singletonMap("article_id", cmsArticleDTO.getArticle_id());
-        cmsArticleMapper.insertArticleTranslations(languageUtil.getTranslationsField(fieldPrimary, cmsArticleDTO, CmsArticleTranslationsDTO.class));
-
-        // 相当于
-        // List<CmsArticleTranslationsDTO> translations = cmsArticleDTO.getTranslations().stream().map(dto -> {
-        //     CmsArticleTranslationsDTO translation = new CmsArticleTranslationsDTO();
-        //     translation.setArticle_id(cmsArticleDTO.getArticle_id());
-        //     translation.setLanguage(dto.getLanguage());
-        //     translation.setTitle(dto.getTitle());
-        //     translation.setDescription(dto.getDescription());
-        //     translation.setContent(dto.getContent());
-        //     return translation;
-        // }).collect(Collectors.toList());
-
-        return Map.of("article_id", cmsArticleDTO.getArticle_id());
-    }
-
-    /**
-     * 更新 资讯
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> updateArticle(CmsArticleDTO cmsArticleDTO) {
-        cmsArticleMapper.updateArticle(cmsArticleDTO);
-        return Map.of("article_id", cmsArticleDTO.getArticle_id());
-    }
-
-    /**
-     * 删除 资讯
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> deleteArticle(CmsArticleDTO cmsArticleDTO) {
-        cmsArticleMapper.deleteArticle(cmsArticleDTO);
-        return Map.of("article_id", cmsArticleDTO.getArticle_id());
-    }
-
-    /**
-     * 删除 资讯 (批量)
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> deleteArticleBatch(List<Long> ids) {
-        cmsArticleMapper.deleteArticleBatch(ids);
-        return Map.of("article_ids", ids);
-    }
-
-}
+//package com.backendsys.service.Cms;
+//
+//import com.backendsys.utils.LanguageUtil;
+//import com.backendsys.entity.Cms.CmsArticleDTO;
+//import com.backendsys.entity.Cms.CmsArticleTranslationsDTO;
+//import com.backendsys.mapper.Cms.CmsArticleMapper;
+//import com.backendsys.utils.response.PageInfoResult;
+//import com.github.pagehelper.PageHelper;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.util.List;
+//import java.util.Map;
+//import java.util.Collections;
+//
+//@Service
+//public class CmsArticleServiceImpl implements CmsArticleService {
+//
+//    @Autowired
+//    private CmsArticleMapper cmsArticleMapper;
+//
+//    /**
+//     * 查询 资讯列表
+//     */
+//    @Override
+//    public Map<String, Object> queryArticle(Integer pageNum, Integer pageSize, CmsArticleDTO cmsArticleDTO) {
+//        // 分页查询
+//        if (pageNum != null && pageSize != null) {
+//            PageHelper.startPage(pageNum, pageSize);
+//            PageHelper.getLocalPage().setPageSizeZero(true);
+//        }
+//        // 分页输出 (自定义)
+//        List<Map<String, Object>> list = cmsArticleMapper.queryArticleList(cmsArticleDTO);
+//        PageInfoResult pageInfoResult = new PageInfoResult(list);
+//        return pageInfoResult.toMap();
+//    }
+//
+//    /**
+//     * 查询 资讯翻译 (无分页)
+//     */
+//    // @Override
+//    // public List<Map<String, Object>> queryArticleTranslation(CmsArticleDTO cmsArticleDTO) {
+//    //     return cmsArticleMapper.queryArticleTranslation(cmsArticleDTO);
+//    // }
+//
+//    /**
+//     * 查询 资讯详情
+//     */
+//    @Override
+//    public Map<String, Object> queryArticleDetail(CmsArticleDTO cmsArticleDTO) {
+//        return cmsArticleMapper.queryArticleDetail(cmsArticleDTO);
+//    }
+//
+//    @Override
+//    public Map<String, Object> queryArticleDetailPublic(CmsArticleDTO cmsArticleDTO) {
+//        return cmsArticleMapper.queryArticleDetailPublic(cmsArticleDTO);
+//    }
+//
+//
+//
+//    @Autowired
+//    private LanguageUtil languageUtil;
+//
+//    /**
+//     * 创建 资讯
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> insertArticle(CmsArticleDTO cmsArticleDTO) {
+//
+//        cmsArticleMapper.insertArticle(cmsArticleDTO);
+//
+//        // 获得翻译字段数组,并批量添加
+//        Map<String, Object> fieldPrimary = Collections.singletonMap("article_id", cmsArticleDTO.getArticle_id());
+//        cmsArticleMapper.insertArticleTranslations(languageUtil.getTranslationsField(fieldPrimary, cmsArticleDTO, CmsArticleTranslationsDTO.class));
+//
+//        // 相当于
+//        // List<CmsArticleTranslationsDTO> translations = cmsArticleDTO.getTranslations().stream().map(dto -> {
+//        //     CmsArticleTranslationsDTO translation = new CmsArticleTranslationsDTO();
+//        //     translation.setArticle_id(cmsArticleDTO.getArticle_id());
+//        //     translation.setLanguage(dto.getLanguage());
+//        //     translation.setTitle(dto.getTitle());
+//        //     translation.setDescription(dto.getDescription());
+//        //     translation.setContent(dto.getContent());
+//        //     return translation;
+//        // }).collect(Collectors.toList());
+//
+//        return Map.of("article_id", cmsArticleDTO.getArticle_id());
+//    }
+//
+//    /**
+//     * 更新 资讯
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> updateArticle(CmsArticleDTO cmsArticleDTO) {
+//        cmsArticleMapper.updateArticle(cmsArticleDTO);
+//        return Map.of("article_id", cmsArticleDTO.getArticle_id());
+//    }
+//
+//    /**
+//     * 删除 资讯
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> deleteArticle(CmsArticleDTO cmsArticleDTO) {
+//        cmsArticleMapper.deleteArticle(cmsArticleDTO);
+//        return Map.of("article_id", cmsArticleDTO.getArticle_id());
+//    }
+//
+//    /**
+//     * 删除 资讯 (批量)
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> deleteArticleBatch(List<Long> ids) {
+//        cmsArticleMapper.deleteArticleBatch(ids);
+//        return Map.of("article_ids", ids);
+//    }
+//
+//}

+ 10 - 10
src/main/java/com/backendsys/service/Cms/CmsSiteInfoService.java

@@ -1,10 +1,10 @@
-package com.backendsys.service.Cms;
-
-import java.util.Map;
-
-import com.backendsys.entity.Cms.CmsSiteInfoDTO;
-
-public interface CmsSiteInfoService {
-    Map<String, Object> querySiteInfo(CmsSiteInfoDTO sysSiteInfoDTO);
-    Map<String, Object> updateSiteInfo(CmsSiteInfoDTO sysSiteInfoDTO);
-}
+//package com.backendsys.service.Cms;
+//
+//import java.util.Map;
+//
+//import com.backendsys.entity.Cms.CmsSiteInfoDTO;
+//
+//public interface CmsSiteInfoService {
+//    Map<String, Object> querySiteInfo(CmsSiteInfoDTO sysSiteInfoDTO);
+//    Map<String, Object> updateSiteInfo(CmsSiteInfoDTO sysSiteInfoDTO);
+//}

+ 41 - 41
src/main/java/com/backendsys/service/Cms/CmsSiteInfoServiceImpl.java

@@ -1,41 +1,41 @@
-package com.backendsys.service.Cms;
-
-import com.backendsys.entity.Cms.CmsSiteInfoDTO;
-import com.backendsys.mapper.Cms.CmsSiteInfoMapper;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.Map;
-
-@Service
-public class CmsSiteInfoServiceImpl implements CmsSiteInfoService {
-
-    @Autowired
-    private CmsSiteInfoMapper cmsSiteInfoMapper;
-
-    /**
-     * 查询
-     */
-    @Override
-    public Map<String, Object> querySiteInfo(CmsSiteInfoDTO cmsSiteInfoDTO) {
-        List<Map<String, Object>> list = cmsSiteInfoMapper.querySiteInfoList(cmsSiteInfoDTO);
-        if (!list.isEmpty()) {
-            return list.get(0); // 返回第一条记录
-        }
-        return null;
-    }
-
-    /**
-     * 更新
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> updateSiteInfo(CmsSiteInfoDTO cmsSiteInfoDTO) {
-        cmsSiteInfoMapper.updateSiteInfo(cmsSiteInfoDTO);
-        return Map.of("site_info_id", cmsSiteInfoDTO.getId());
-    }
-
-}
+//package com.backendsys.service.Cms;
+//
+//import com.backendsys.entity.Cms.CmsSiteInfoDTO;
+//import com.backendsys.mapper.Cms.CmsSiteInfoMapper;
+//
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Service
+//public class CmsSiteInfoServiceImpl implements CmsSiteInfoService {
+//
+//    @Autowired
+//    private CmsSiteInfoMapper cmsSiteInfoMapper;
+//
+//    /**
+//     * 查询
+//     */
+//    @Override
+//    public Map<String, Object> querySiteInfo(CmsSiteInfoDTO cmsSiteInfoDTO) {
+//        List<Map<String, Object>> list = cmsSiteInfoMapper.querySiteInfoList(cmsSiteInfoDTO);
+//        if (!list.isEmpty()) {
+//            return list.get(0); // 返回第一条记录
+//        }
+//        return null;
+//    }
+//
+//    /**
+//     * 更新
+//     */
+//    @Override
+//    @Transactional
+//    public Map<String, Object> updateSiteInfo(CmsSiteInfoDTO cmsSiteInfoDTO) {
+//        cmsSiteInfoMapper.updateSiteInfo(cmsSiteInfoDTO);
+//        return Map.of("site_info_id", cmsSiteInfoDTO.getId());
+//    }
+//
+//}

+ 2 - 2
src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentCOSService.java

@@ -43,8 +43,8 @@ public interface SDKTencentCOSService {
     // 将 远程文件 异步保存到 储存桶 (小文件) (仅内部使用,有内存泄露的风险)
     UploadOriginResp uploadOrigin(UploadOriginDTO uploadOriginDTO) throws IOException;
 
-    // 压缩图片
-    File compressImage(InputStream inputStream, String suffix) throws IOException;
+//    // 压缩图片
+//    File compressImage(InputStream inputStream, String suffix) throws IOException;
 
 
 //    // -- 简单上传 -------------------------------------------------------

+ 50 - 50
src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentCOSServiceImpl.java

@@ -422,56 +422,56 @@ public class SDKTencentCOSServiceImpl implements SDKTencentCOSService {
     }
 
 
-    /**
-     * 压缩图片 (入参 InputStream,出参 File)
-     */
-    public File compressImage(InputStream inputStream, String suffix) throws IOException {
-
-        System.out.println("suffix: " + suffix);
-
-        // 将文件内容写入临时文件
-//        String tempFilename = CommonUtil.generateFilename(suffix);
-//        String tempFilenameThumb = tempFilename.replaceAll("." + suffix, "-thumb." + suffix);
-
-//        System.out.println("tempFilename: " + tempFilename);
-//        System.out.println("tempFilenameThumb: " + tempFilenameThumb);
-        System.out.println("-------------------------------------------");
-
-        File tempFile = File.createTempFile("tmp", "." + suffix);
-        File tempFileThumb = File.createTempFile("tmp", "." + suffix);
-
-        System.out.println("tempFile: " + tempFile);
-        System.out.println("tempFileThumb: " + tempFileThumb);
-
-        try (FileOutputStream outputStream = new FileOutputStream(tempFile)) {
-            System.out.println("IOUtils.copy start: ");
-            IOUtils.copy(inputStream, outputStream);
-        } catch (Exception e) {
-            System.out.println("IOUtils.copy Error:");
-            System.out.println(e);
-        }
-        // 创建缩略图
-        boolean isImage = Arrays.asList("jpg", "jpeg", "png", "gif", "bmp", "tiff", "webp").contains(suffix.toLowerCase());
-        if (isImage) {
-            File sourceFile = new File(tempFile.getPath());
-            File sourceFileThumb = new File(tempFileThumb.getPath());
-            // 使用Thumbnailator生成缩略图并写入到临时文件
-            System.out.println("Thumbnails start");
-            try {
-                System.out.println("sourceFile:");
-                System.out.println(sourceFile);
-                System.out.println("sourceFileThumb:");
-                System.out.println(sourceFileThumb);
-                Thumbnails.of(sourceFile).size(60, 60).outputQuality(0.2).toFile(sourceFileThumb);
-                tempFileThumb.delete();
-            } catch (Exception e) {
-                System.out.println(e);
-            }
-            System.out.println("Thumbnails end");
-            return sourceFile;
-        }
-        return null;
-    }
+//    /**
+//     * 压缩图片 (入参 InputStream,出参 File)
+//     */
+//    public File compressImage(InputStream inputStream, String suffix) throws IOException {
+//
+//        System.out.println("suffix: " + suffix);
+//
+//        // 将文件内容写入临时文件
+////        String tempFilename = CommonUtil.generateFilename(suffix);
+////        String tempFilenameThumb = tempFilename.replaceAll("." + suffix, "-thumb." + suffix);
+//
+////        System.out.println("tempFilename: " + tempFilename);
+////        System.out.println("tempFilenameThumb: " + tempFilenameThumb);
+//        System.out.println("-------------------------------------------");
+//
+//        File tempFile = File.createTempFile("tmp", "." + suffix);
+//        File tempFileThumb = File.createTempFile("tmp", "." + suffix);
+//
+//        System.out.println("tempFile: " + tempFile);
+//        System.out.println("tempFileThumb: " + tempFileThumb);
+//
+//        try (FileOutputStream outputStream = new FileOutputStream(tempFile)) {
+//            System.out.println("IOUtils.copy start: ");
+//            IOUtils.copy(inputStream, outputStream);
+//        } catch (Exception e) {
+//            System.out.println("IOUtils.copy Error:");
+//            System.out.println(e);
+//        }
+//        // 创建缩略图
+//        boolean isImage = Arrays.asList("jpg", "jpeg", "png", "gif", "bmp", "tiff", "webp").contains(suffix.toLowerCase());
+//        if (isImage) {
+//            File sourceFile = new File(tempFile.getPath());
+//            File sourceFileThumb = new File(tempFileThumb.getPath());
+//            // 使用Thumbnailator生成缩略图并写入到临时文件
+//            System.out.println("Thumbnails start");
+//            try {
+//                System.out.println("sourceFile:");
+//                System.out.println(sourceFile);
+//                System.out.println("sourceFileThumb:");
+//                System.out.println(sourceFileThumb);
+//                Thumbnails.of(sourceFile).size(60, 60).outputQuality(0.2).toFile(sourceFileThumb);
+//                tempFileThumb.delete();
+//            } catch (Exception e) {
+//                System.out.println(e);
+//            }
+//            System.out.println("Thumbnails end");
+//            return sourceFile;
+//        }
+//        return null;
+//    }
 
     /**
      * [小文件] 将 远程文件 异步保存到 COS储存桶

+ 24 - 24
src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentSMSService.java

@@ -1,24 +1,24 @@
-package com.backendsys.service.SDKService.SDKTencent;
-
-import com.backendsys.entity.System.SysSMSDTO;
-
-import java.util.Map;
-
-public interface SDKTencentSMSService {
-
-    // [腾讯云] 发送短信
-    Map<String, Object> sendSMS(SysSMSDTO sysSMSDTO);
-
-    // [腾讯云] 短信回执数据统计
-    Map<String, Object> getSMSCallbackStatistics(String beginTime, String endTime, String limit);
-
-    // [腾讯云] 短信发送数据统计
-    Map<String, Object> getSMSStatistics(String beginTime, String endTime);
-
-    // [腾讯云] 套餐包信息统计
-//    List<Map<String, Object>> getSmsPackagesStatistics(String beginTime, String endTime);
-
-//    // [腾讯云] 号码信息查询
-//    List<Map<String, Object>> getDescribePhoneNumberInfo(String phones);
-
-}
+//package com.backendsys.service.SDKService.SDKTencent;
+//
+//import com.backendsys.entity.System.SysSMSDTO;
+//
+//import java.util.Map;
+//
+//public interface SDKTencentSMSService {
+//
+//    // [腾讯云] 发送短信
+//    Map<String, Object> sendSMS(SysSMSDTO sysSMSDTO);
+//
+//    // [腾讯云] 短信回执数据统计
+//    Map<String, Object> getSMSCallbackStatistics(String beginTime, String endTime, String limit);
+//
+//    // [腾讯云] 短信发送数据统计
+//    Map<String, Object> getSMSStatistics(String beginTime, String endTime);
+//
+//    // [腾讯云] 套餐包信息统计
+////    List<Map<String, Object>> getSmsPackagesStatistics(String beginTime, String endTime);
+//
+////    // [腾讯云] 号码信息查询
+////    List<Map<String, Object>> getDescribePhoneNumberInfo(String phones);
+//
+//}

+ 352 - 352
src/main/java/com/backendsys/service/SDKService/SDKTencent/SDKTencentSMSServiceImpl.java

@@ -1,324 +1,203 @@
-package com.backendsys.service.SDKService.SDKTencent;
-
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.RandomUtil;
-import cn.hutool.json.JSONArray;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.backendsys.modules.common.config.redis.utils.RedisUtil;
-import com.backendsys.entity.System.SysSMSDTO;
-import com.backendsys.exception.CustException;
-import com.backendsys.mapper.System.SysMobileSMSHistoryMapper;
-import com.backendsys.utils.MapUtil;
-import com.tencentcloudapi.common.Credential;
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
-import com.tencentcloudapi.common.profile.ClientProfile;
-import com.tencentcloudapi.sms.v20210111.SmsClient;
-import com.tencentcloudapi.sms.v20210111.models.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-@Service
-public class SDKTencentSMSServiceImpl implements SDKTencentSMSService {
-
-    @Value("${tencent.sms.secret-id}")
-    private String SECRET_ID;
-    @Value("${tencent.sms.secret-key}")
-    private String SECRET_KEY;
-
-    /* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId*/
-    @Value("${tencent.sms.sdk-app-id}")
-    private String sdkAppId;
-
-    /* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名 */
-    @Value("${tencent.sms.sign-name}")
-    private String signName;
-
-    /* 模板 ID: 必须填写已审核通过的模板 ID */
-    @Value("${tencent.sms.template-id-of-common}")
-    private String templateIdOfCommon;
-
-    @Autowired
-    private RedisUtil redisUtil;
-
-    @Autowired
-    private SysMobileSMSHistoryMapper sysMobileSMSHistoryMapper;
-
-    /** 腾讯云文档:https://cloud.tencent.com/document/product/382/43194 */
-
-
-    /**
-     * [方法] 获得当前时间与 n 天前的时间
-     */
-    private Map<String, Object> getCurrentAndBeforeDate(String beginTime, String endTime, Integer n) {
-
-        if (beginTime != null && endTime != null && Long.valueOf(beginTime) > Long.valueOf(endTime)) {
-            throw new CustException("开始时间不能大于结束时间");
-        }
-        // 获取当前时间
-        Date now = new Date();
-        String currentDateFormatted = DateUtil.format(now, "yyyyMMddHH");
-        // 从当前时间减去7天
-        Date sevenDaysAgo = DateUtil.offsetDay(now, -n);
-        String sevenDaysAgoFormatted = DateUtil.format(sevenDaysAgo, "yyyyMMddHH");
-
-        /* 开始时间,yyyymmddhh 需要拉取的起始时间,精确到小时 */
-        String beginTimeData = beginTime != null ? beginTime : sevenDaysAgoFormatted;
-
-        /* 结束时间,yyyymmddhh 需要拉取的截止时间,精确到小时 */
-        String endTimeData = endTime != null ? endTime : currentDateFormatted;
-
-        Map<String, Object> result = new LinkedHashMap<>();
-        result.put("beginTime", beginTimeData);
-        result.put("endTime", endTimeData);
-
-        return result;
-    }
-
-    /**
-     * [腾讯云] 发送短信
-     */
-    @Transactional
-    public Map<String, Object> sendSMS(SysSMSDTO sysSMSDTO) {
-
-        try {
-
-            String origin = sysSMSDTO.getOrigin();
-            String phone = sysSMSDTO.getPhone();
-            Integer phoneAreaCode = sysSMSDTO.getPhone_area_code();
-
-//            // [腾讯云] 号码信息查询 (判断手机号码是否有效)
-//            List<Map<String, Object>> phoneInfoList = getDescribePhoneNumberInfo(phoneAreaCode + phone);
-//            if (phoneInfoList != null) {
-//                Map<String, Object> phoneInfo = phoneInfoList.get(0);
-//                String code = (String) phoneInfo.get("code");
-//                if (!"Ok".equals(code)) {
-//                    String message = (String) phoneInfo.get("message");
-//                    throw new CustException("发送失败,请检查手机号码格式", 6001, phoneInfo);
-//                }
+//package com.backendsys.service.SDKService.SDKTencent;
+//
+//import cn.hutool.core.date.DateUtil;
+//import cn.hutool.core.util.RandomUtil;
+//import cn.hutool.json.JSONArray;
+//import cn.hutool.json.JSONObject;
+//import cn.hutool.json.JSONUtil;
+//import com.backendsys.modules.common.config.redis.utils.RedisUtil;
+//import com.backendsys.entity.System.SysSMSDTO;
+//import com.backendsys.exception.CustException;
+//import com.backendsys.mapper.System.SysMobileSMSHistoryMapper;
+//import com.backendsys.utils.MapUtil;
+//import com.tencentcloudapi.common.Credential;
+//import com.tencentcloudapi.common.exception.TencentCloudSDKException;
+//import com.tencentcloudapi.common.profile.ClientProfile;
+//import com.tencentcloudapi.sms.v20210111.SmsClient;
+//import com.tencentcloudapi.sms.v20210111.models.*;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.util.Date;
+//import java.util.LinkedHashMap;
+//import java.util.Map;
+//import java.util.concurrent.TimeUnit;
+//
+//@Service
+//public class SDKTencentSMSServiceImpl implements SDKTencentSMSService {
+//
+//    @Value("${tencent.sms.secret-id}")
+//    private String SECRET_ID;
+//    @Value("${tencent.sms.secret-key}")
+//    private String SECRET_KEY;
+//
+//    /* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId*/
+//    @Value("${tencent.sms.sdk-app-id}")
+//    private String sdkAppId;
+//
+//    /* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名 */
+//    @Value("${tencent.sms.sign-name}")
+//    private String signName;
+//
+//    /* 模板 ID: 必须填写已审核通过的模板 ID */
+//    @Value("${tencent.sms.template-id-of-common}")
+//    private String templateIdOfCommon;
+//
+//    @Autowired
+//    private RedisUtil redisUtil;
+//
+//    @Autowired
+//    private SysMobileSMSHistoryMapper sysMobileSMSHistoryMapper;
+//
+//    /** 腾讯云文档:https://cloud.tencent.com/document/product/382/43194 */
+//
+//
+//    /**
+//     * [方法] 获得当前时间与 n 天前的时间
+//     */
+//    private Map<String, Object> getCurrentAndBeforeDate(String beginTime, String endTime, Integer n) {
+//
+//        if (beginTime != null && endTime != null && Long.valueOf(beginTime) > Long.valueOf(endTime)) {
+//            throw new CustException("开始时间不能大于结束时间");
+//        }
+//        // 获取当前时间
+//        Date now = new Date();
+//        String currentDateFormatted = DateUtil.format(now, "yyyyMMddHH");
+//        // 从当前时间减去7天
+//        Date sevenDaysAgo = DateUtil.offsetDay(now, -n);
+//        String sevenDaysAgoFormatted = DateUtil.format(sevenDaysAgo, "yyyyMMddHH");
+//
+//        /* 开始时间,yyyymmddhh 需要拉取的起始时间,精确到小时 */
+//        String beginTimeData = beginTime != null ? beginTime : sevenDaysAgoFormatted;
+//
+//        /* 结束时间,yyyymmddhh 需要拉取的截止时间,精确到小时 */
+//        String endTimeData = endTime != null ? endTime : currentDateFormatted;
+//
+//        Map<String, Object> result = new LinkedHashMap<>();
+//        result.put("beginTime", beginTimeData);
+//        result.put("endTime", endTimeData);
+//
+//        return result;
+//    }
+//
+//    /**
+//     * [腾讯云] 发送短信
+//     */
+//    @Transactional
+//    public Map<String, Object> sendSMS(SysSMSDTO sysSMSDTO) {
+//
+//        try {
+//
+//            String origin = sysSMSDTO.getOrigin();
+//            String phone = sysSMSDTO.getPhone();
+//            Integer phoneAreaCode = sysSMSDTO.getPhone_area_code();
+//
+////            // [腾讯云] 号码信息查询 (判断手机号码是否有效)
+////            List<Map<String, Object>> phoneInfoList = getDescribePhoneNumberInfo(phoneAreaCode + phone);
+////            if (phoneInfoList != null) {
+////                Map<String, Object> phoneInfo = phoneInfoList.get(0);
+////                String code = (String) phoneInfo.get("code");
+////                if (!"Ok".equals(code)) {
+////                    String message = (String) phoneInfo.get("message");
+////                    throw new CustException("发送失败,请检查手机号码格式", 6001, phoneInfo);
+////                }
+////            }
+//
+//            // ----------------------------------------------------------------------
+//            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
+//            ClientProfile clientProfile = new ClientProfile();
+//            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
+//
+//            SendSmsRequest req = new SendSmsRequest();
+//            req.setSmsSdkAppId(sdkAppId);
+//            req.setSignName(signName);
+//            req.setTemplateId(templateIdOfCommon);
+//
+//            // 生成一个6位的随机整数 (验证码)
+//            Integer smsCode =  RandomUtil.randomInt(100000, 999999);
+//            Integer smsExpire = 5;
+//            sysSMSDTO.setSms_code(String.valueOf(smsCode));
+//
+//            /* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 */
+//            // {1} 验证码, {2} 过期时间(5分钟)
+//            String[] templateParamSet = {String.valueOf(smsCode), String.valueOf(smsExpire)};
+//            req.setTemplateParamSet(templateParamSet);
+//            String redisKey = "sms-" + origin + "-" + phone;
+//            redisUtil.setCacheObject(redisKey, smsCode, smsExpire, TimeUnit.MINUTES);
+//
+//            /* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]
+//             * 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号 */
+//            String[] phoneNumberSet = {"+" + phoneAreaCode + phone};
+//            req.setPhoneNumberSet(phoneNumberSet);
+//
+//    //        /* 用户的 session 内容(无需要可忽略): 可以携带用户侧 ID 等上下文信息,server 会原样返回 */
+//    //        String sessionContext = "";
+//    //        req.setSessionContext(sessionContext);
+//
+//    //        /* 国内短信无需填写该项;国际/港澳台短信已申请独立 SenderId 需要填写该字段,默认使用公共 SenderId,无需填写该字段。注:月度使用量达到指定量级可申请独立 SenderId 使用,详情请联系 [腾讯云短信小助手](https://cloud.tencent.com/document/product/382/3773#.E6.8A.80.E6.9C.AF.E4.BA.A4.E6.B5.81)。*/
+//    //        String senderid = "";
+//    //        req.setSenderId(senderid);
+//
+//
+//            /* 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的
+//             * 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
+//            SendSmsResponse res = client.SendSms(req);
+//
+//            // 输出json格式的字符串回包
+//            String resString = SendSmsResponse.toJsonString(res);
+//            System.out.println(resString);
+//
+//            JSONObject resp = JSONUtil.parseObj(resString);
+//            JSONArray sendStatusSet = JSONUtil.parseArray(resp.get("SendStatusSet"));
+//
+//            JSONObject statusSet = JSONUtil.parseObj(sendStatusSet.get(0));
+//            String code = (String) statusSet.get("Code");
+//            String message = (String) statusSet.get("Message");
+//
+//            if ("Ok".equals(code)) {
+//                // 发送成功后,留下记录
+//                sysMobileSMSHistoryMapper.insertMobileSMSHistory(sysSMSDTO);
+//            } else {
+//                throw new CustException(message);
 //            }
-
-            // ----------------------------------------------------------------------
-            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
-            ClientProfile clientProfile = new ClientProfile();
-            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
-
-            SendSmsRequest req = new SendSmsRequest();
-            req.setSmsSdkAppId(sdkAppId);
-            req.setSignName(signName);
-            req.setTemplateId(templateIdOfCommon);
-
-            // 生成一个6位的随机整数 (验证码)
-            Integer smsCode =  RandomUtil.randomInt(100000, 999999);
-            Integer smsExpire = 5;
-            sysSMSDTO.setSms_code(String.valueOf(smsCode));
-
-            /* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 */
-            // {1} 验证码, {2} 过期时间(5分钟)
-            String[] templateParamSet = {String.valueOf(smsCode), String.valueOf(smsExpire)};
-            req.setTemplateParamSet(templateParamSet);
-            String redisKey = "sms-" + origin + "-" + phone;
-            redisUtil.setCacheObject(redisKey, smsCode, smsExpire, TimeUnit.MINUTES);
-
-            /* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]
-             * 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号 */
-            String[] phoneNumberSet = {"+" + phoneAreaCode + phone};
-            req.setPhoneNumberSet(phoneNumberSet);
-
-    //        /* 用户的 session 内容(无需要可忽略): 可以携带用户侧 ID 等上下文信息,server 会原样返回 */
-    //        String sessionContext = "";
-    //        req.setSessionContext(sessionContext);
-
-    //        /* 国内短信无需填写该项;国际/港澳台短信已申请独立 SenderId 需要填写该字段,默认使用公共 SenderId,无需填写该字段。注:月度使用量达到指定量级可申请独立 SenderId 使用,详情请联系 [腾讯云短信小助手](https://cloud.tencent.com/document/product/382/3773#.E6.8A.80.E6.9C.AF.E4.BA.A4.E6.B5.81)。*/
-    //        String senderid = "";
-    //        req.setSenderId(senderid);
-
-
-            /* 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的
-             * 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
-            SendSmsResponse res = client.SendSms(req);
-
-            // 输出json格式的字符串回包
-            String resString = SendSmsResponse.toJsonString(res);
-            System.out.println(resString);
-
-            JSONObject resp = JSONUtil.parseObj(resString);
-            JSONArray sendStatusSet = JSONUtil.parseArray(resp.get("SendStatusSet"));
-
-            JSONObject statusSet = JSONUtil.parseObj(sendStatusSet.get(0));
-            String code = (String) statusSet.get("Code");
-            String message = (String) statusSet.get("Message");
-
-            if ("Ok".equals(code)) {
-                // 发送成功后,留下记录
-                sysMobileSMSHistoryMapper.insertMobileSMSHistory(sysSMSDTO);
-            } else {
-                throw new CustException(message);
-            }
-
-        } catch (TencentCloudSDKException e) {
-            e.printStackTrace();
-        }
-
-        return Map.of("phone", sysSMSDTO.getPhone());
-    }
-
-    /**
-     * [腾讯云] 短信回执数据统计
-     */
-    @Override
-    public Map<String, Object> getSMSCallbackStatistics(String beginTime, String endTime, String limit) {
-        try {
-
-            // 设置拉取最大条数,最多100条 (默认100条)
-            Long limitCount = limit != null ? Long.valueOf(limit) : null;
-            if (limitCount == null) {
-                limitCount = 100L;
-            } else if (limitCount <= 0 || limitCount > 100) {
-                throw new CustException("limit 范围在 1~100");
-            }
-
-            // ----------------------------------------------------------------------
-            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
-            ClientProfile clientProfile = new ClientProfile();
-            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
-
-            CallbackStatusStatisticsRequest req = new CallbackStatusStatisticsRequest();
-            req.setSmsSdkAppId(sdkAppId);
-            req.setLimit(limitCount);
-            req.setOffset(0L);
-            req.setBeginTime((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("beginTime"));
-            req.setEndTime(((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("endTime")));
-
-            CallbackStatusStatisticsResponse res = client.CallbackStatusStatistics(req);
-
-            // 输出json格式的字符串回包
-            String resString = SendStatusStatisticsResponse.toJsonString(res);
-            JSONObject resp = JSONUtil.parseObj(resString);
-
-            System.out.println(resp);
-            /*
-            {
-                "CallbackStatusStatistics": {
-                    "CallbackCount": 0,
-                    "RequestSuccessCount": 0,
-                    "CallbackFailCount": 0,
-                    "CallbackSuccessCount": 0,
-                    "InternalErrorCount": 0,
-                    "InvalidNumberCount": 0,
-                    "ShutdownErrorCount": 0,
-                    "BlackListCount": 0,
-                    "FrequencyLimitCount": 0
-                },
-                "RequestId": "b8ace58a-20cc-4829-9cb7-0681a82450fb"
-            }
-             */
-            Map<String, Object> result = new LinkedHashMap<>();
-            result.put("callback_count", MapUtil.get(resp, "CallbackStatusStatistics.CallbackCount"));
-            result.put("request_success_count", MapUtil.get(resp, "CallbackStatusStatistics.RequestSuccessCount"));
-            result.put("callback_fail_count", MapUtil.get(resp, "CallbackStatusStatistics.CallbackFailCount"));
-            result.put("callback_success_count", MapUtil.get(resp, "CallbackStatusStatistics.CallbackSuccessCount"));
-            result.put("internal_error_count", MapUtil.get(resp, "CallbackStatusStatistics.InternalErrorCount"));
-            result.put("invalid_number_count", MapUtil.get(resp, "CallbackStatusStatistics.InvalidNumberCount"));
-            result.put("shutdown_error_count", MapUtil.get(resp, "CallbackStatusStatistics.ShutdownErrorCount"));
-            result.put("black_list_count", MapUtil.get(resp, "CallbackStatusStatistics.BlackListCount"));
-            result.put("frequency_limit_count", MapUtil.get(resp, "CallbackStatusStatistics.FrequencyLimitCount"));
-
-            return result;
-
-        } catch (TencentCloudSDKException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    /**
-     * [腾讯云] 短信发送数据统计
-     */
-    @Override
-    public Map<String, Object> getSMSStatistics(String beginTime, String endTime) {
-        try {
-
-            // ----------------------------------------------------------------------
-            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
-            ClientProfile clientProfile = new ClientProfile();
-            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
-
-            SendStatusStatisticsRequest req = new SendStatusStatisticsRequest();
-            req.setSmsSdkAppId(sdkAppId);
-
-            // 设置拉取最大条数,最多100条
-            Long limit = 5L;
-            req.setLimit(limit);
-
-            /* 偏移量 注:目前固定设置为0 */
-            Long offset = 0L;
-            req.setOffset(offset);
-            req.setBeginTime((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("beginTime"));
-            req.setEndTime(((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("endTime")));
-
-            /* 通过 client 对象调用 SendStatusStatistics 方法发起请求。注意请求方法名与请求对象是对应的
-             * 返回的 res 是一个 SendStatusStatisticsResponse 类的实例,与请求对象对应 */
-            SendStatusStatisticsResponse res = client.SendStatusStatistics(req);
-
-            // 输出json格式的字符串回包
-            String resString = SendStatusStatisticsResponse.toJsonString(res);
-            JSONObject resp = JSONUtil.parseObj(resString);
-
-            System.out.println(resp);
-            /*
-            {
-                "SendStatusStatistics": {
-                    "FeeCount": 12,                 // 短信计费条数统计,例如提交成功量为100条,其中有20条是长短信(长度为80字)被拆分成2条,则计费条数为: 80 * 1 + 20 * 2 = 120 条。
-                    "RequestCount": 23,             // 短信提交量统计
-                    "RequestSuccessCount": 12       // 短信提交成功量统计
-                },
-                "RequestId": "9ef2b426-ee33-4a3d-80f0-b31876f82fb8"
-            }
-            */
-
-            Map<String, Object> result = new LinkedHashMap<>();
-            result.put("fee_count", MapUtil.get(resp, "SendStatusStatistics.FeeCount"));
-            result.put("request_count", MapUtil.get(resp, "SendStatusStatistics.RequestCount"));
-            result.put("request_success_count", MapUtil.get(resp, "SendStatusStatistics.RequestSuccessCount"));
-
-            return result;
-
-        } catch (TencentCloudSDKException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    /**
-     * [腾讯云] 套餐包信息统计
-     */
+//
+//        } catch (TencentCloudSDKException e) {
+//            e.printStackTrace();
+//        }
+//
+//        return Map.of("phone", sysSMSDTO.getPhone());
+//    }
+//
+//    /**
+//     * [腾讯云] 短信回执数据统计
+//     */
 //    @Override
-//    public List<Map<String, Object>> getSmsPackagesStatistics(String beginTime, String endTime) {
+//    public Map<String, Object> getSMSCallbackStatistics(String beginTime, String endTime, String limit) {
 //        try {
 //
+//            // 设置拉取最大条数,最多100条 (默认100条)
+//            Long limitCount = limit != null ? Long.valueOf(limit) : null;
+//            if (limitCount == null) {
+//                limitCount = 100L;
+//            } else if (limitCount <= 0 || limitCount > 100) {
+//                throw new CustException("limit 范围在 1~100");
+//            }
+//
 //            // ----------------------------------------------------------------------
 //            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
 //            ClientProfile clientProfile = new ClientProfile();
 //            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
 //
-//            SmsPackagesStatisticsRequest req = new SmsPackagesStatisticsRequest();
+//            CallbackStatusStatisticsRequest req = new CallbackStatusStatisticsRequest();
 //            req.setSmsSdkAppId(sdkAppId);
-//            req.setLimit(100L);
+//            req.setLimit(limitCount);
 //            req.setOffset(0L);
 //            req.setBeginTime((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("beginTime"));
 //            req.setEndTime(((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("endTime")));
 //
-//            /* 通过 client 对象调用 SendStatusStatistics 方法发起请求。注意请求方法名与请求对象是对应的
-//             * 返回的 res 是一个 SendStatusStatisticsResponse 类的实例,与请求对象对应 */
-//            SmsPackagesStatisticsResponse res = client.SmsPackagesStatistics(req);
+//            CallbackStatusStatisticsResponse res = client.CallbackStatusStatistics(req);
 //
 //            // 输出json格式的字符串回包
 //            String resString = SendStatusStatisticsResponse.toJsonString(res);
@@ -327,83 +206,204 @@ public class SDKTencentSMSServiceImpl implements SDKTencentSMSService {
 //            System.out.println(resp);
 //            /*
 //            {
-//                "SmsPackagesStatisticsSet": [
-//                    {
-//                        "PackageCreateTime": 1713863741,
-//                        "PackageEffectiveTime": 1713863741,
-//                        "PackageExpiredTime": 1721726141,
-//                        "PackageAmount": 500,
-//                        "PackageType": 0,
-//                        "PackageId": 1002730611,
-//                        "CurrentUsage": 13
-//                    }
-//                ],
-//                "RequestId": "15f81795-7a14-43cc-9215-efcc8886e1af"
+//                "CallbackStatusStatistics": {
+//                    "CallbackCount": 0,
+//                    "RequestSuccessCount": 0,
+//                    "CallbackFailCount": 0,
+//                    "CallbackSuccessCount": 0,
+//                    "InternalErrorCount": 0,
+//                    "InvalidNumberCount": 0,
+//                    "ShutdownErrorCount": 0,
+//                    "BlackListCount": 0,
+//                    "FrequencyLimitCount": 0
+//                },
+//                "RequestId": "b8ace58a-20cc-4829-9cb7-0681a82450fb"
 //            }
 //             */
-//            List<Map<String, Object>> list = (List<Map<String, Object>>) MapUtil.get(resp, "SmsPackagesStatisticsSet");
-//            List<Map<String, Object>> result = ListUtil.convertToUnderscoreCase(list);
+//            Map<String, Object> result = new LinkedHashMap<>();
+//            result.put("callback_count", MapUtil.get(resp, "CallbackStatusStatistics.CallbackCount"));
+//            result.put("request_success_count", MapUtil.get(resp, "CallbackStatusStatistics.RequestSuccessCount"));
+//            result.put("callback_fail_count", MapUtil.get(resp, "CallbackStatusStatistics.CallbackFailCount"));
+//            result.put("callback_success_count", MapUtil.get(resp, "CallbackStatusStatistics.CallbackSuccessCount"));
+//            result.put("internal_error_count", MapUtil.get(resp, "CallbackStatusStatistics.InternalErrorCount"));
+//            result.put("invalid_number_count", MapUtil.get(resp, "CallbackStatusStatistics.InvalidNumberCount"));
+//            result.put("shutdown_error_count", MapUtil.get(resp, "CallbackStatusStatistics.ShutdownErrorCount"));
+//            result.put("black_list_count", MapUtil.get(resp, "CallbackStatusStatistics.BlackListCount"));
+//            result.put("frequency_limit_count", MapUtil.get(resp, "CallbackStatusStatistics.FrequencyLimitCount"));
 //
 //            return result;
 //
-//
 //        } catch (TencentCloudSDKException e) {
 //            e.printStackTrace();
 //        }
 //        return null;
 //    }
-
-    /**
-     * [腾讯云] 号码信息查询
-     */
+//
+//    /**
+//     * [腾讯云] 短信发送数据统计
+//     */
 //    @Override
-//    public List<Map<String, Object>> getDescribePhoneNumberInfo(String phones) {
+//    public Map<String, Object> getSMSStatistics(String beginTime, String endTime) {
 //        try {
 //
-//            if (phones == null) {
-//                throw new CustException("手机号码不能为空");
-//            }
-//            String[] phoneNumberSet = phones.split(",");
-//
 //            // ----------------------------------------------------------------------
 //            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
 //            ClientProfile clientProfile = new ClientProfile();
 //            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
 //
-//            DescribePhoneNumberInfoRequest req = new DescribePhoneNumberInfoRequest();
-//            req.setPhoneNumberSet(phoneNumberSet);
+//            SendStatusStatisticsRequest req = new SendStatusStatisticsRequest();
+//            req.setSmsSdkAppId(sdkAppId);
+//
+//            // 设置拉取最大条数,最多100条
+//            Long limit = 5L;
+//            req.setLimit(limit);
+//
+//            /* 偏移量 注:目前固定设置为0 */
+//            Long offset = 0L;
+//            req.setOffset(offset);
+//            req.setBeginTime((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("beginTime"));
+//            req.setEndTime(((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("endTime")));
 //
-//            DescribePhoneNumberInfoResponse res = client.DescribePhoneNumberInfo(req);
+//            /* 通过 client 对象调用 SendStatusStatistics 方法发起请求。注意请求方法名与请求对象是对应的
+//             * 返回的 res 是一个 SendStatusStatisticsResponse 类的实例,与请求对象对应 */
+//            SendStatusStatisticsResponse res = client.SendStatusStatistics(req);
 //
 //            // 输出json格式的字符串回包
 //            String resString = SendStatusStatisticsResponse.toJsonString(res);
 //            JSONObject resp = JSONUtil.parseObj(resString);
+//
+//            System.out.println(resp);
 //            /*
 //            {
-//                "PhoneNumberInfoSet": [
-//                    {
-//                        "Code": "InvalidParameterValue.IncorrectPhoneNumber",
-//                        "Message": "incorrect phoneNumber format",
-//                        "NationCode": "",
-//                        "SubscriberNumber": "",
-//                        "PhoneNumber": "13670511519",
-//                        "IsoCode": "DEF",
-//                        "IsoName": ""
-//                    }
-//                ],
-//                "RequestId": "b49704fe-5286-4d4a-87eb-f560a72320ab"
+//                "SendStatusStatistics": {
+//                    "FeeCount": 12,                 // 短信计费条数统计,例如提交成功量为100条,其中有20条是长短信(长度为80字)被拆分成2条,则计费条数为: 80 * 1 + 20 * 2 = 120 条。
+//                    "RequestCount": 23,             // 短信提交量统计
+//                    "RequestSuccessCount": 12       // 短信提交成功量统计
+//                },
+//                "RequestId": "9ef2b426-ee33-4a3d-80f0-b31876f82fb8"
 //            }
-//             */
+//            */
 //
-//            List<Map<String, Object>> list = (List<Map<String, Object>>) MapUtil.get(resp, "PhoneNumberInfoSet");
-//            List<Map<String, Object>> result = ListUtil.convertToUnderscoreCase(list);
+//            Map<String, Object> result = new LinkedHashMap<>();
+//            result.put("fee_count", MapUtil.get(resp, "SendStatusStatistics.FeeCount"));
+//            result.put("request_count", MapUtil.get(resp, "SendStatusStatistics.RequestCount"));
+//            result.put("request_success_count", MapUtil.get(resp, "SendStatusStatistics.RequestSuccessCount"));
 //
 //            return result;
 //
-//
 //        } catch (TencentCloudSDKException e) {
 //            e.printStackTrace();
 //        }
 //        return null;
 //    }
-}
+//
+//    /**
+//     * [腾讯云] 套餐包信息统计
+//     */
+////    @Override
+////    public List<Map<String, Object>> getSmsPackagesStatistics(String beginTime, String endTime) {
+////        try {
+////
+////            // ----------------------------------------------------------------------
+////            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
+////            ClientProfile clientProfile = new ClientProfile();
+////            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
+////
+////            SmsPackagesStatisticsRequest req = new SmsPackagesStatisticsRequest();
+////            req.setSmsSdkAppId(sdkAppId);
+////            req.setLimit(100L);
+////            req.setOffset(0L);
+////            req.setBeginTime((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("beginTime"));
+////            req.setEndTime(((String) getCurrentAndBeforeDate(beginTime, endTime, 7).get("endTime")));
+////
+////            /* 通过 client 对象调用 SendStatusStatistics 方法发起请求。注意请求方法名与请求对象是对应的
+////             * 返回的 res 是一个 SendStatusStatisticsResponse 类的实例,与请求对象对应 */
+////            SmsPackagesStatisticsResponse res = client.SmsPackagesStatistics(req);
+////
+////            // 输出json格式的字符串回包
+////            String resString = SendStatusStatisticsResponse.toJsonString(res);
+////            JSONObject resp = JSONUtil.parseObj(resString);
+////
+////            System.out.println(resp);
+////            /*
+////            {
+////                "SmsPackagesStatisticsSet": [
+////                    {
+////                        "PackageCreateTime": 1713863741,
+////                        "PackageEffectiveTime": 1713863741,
+////                        "PackageExpiredTime": 1721726141,
+////                        "PackageAmount": 500,
+////                        "PackageType": 0,
+////                        "PackageId": 1002730611,
+////                        "CurrentUsage": 13
+////                    }
+////                ],
+////                "RequestId": "15f81795-7a14-43cc-9215-efcc8886e1af"
+////            }
+////             */
+////            List<Map<String, Object>> list = (List<Map<String, Object>>) MapUtil.get(resp, "SmsPackagesStatisticsSet");
+////            List<Map<String, Object>> result = ListUtil.convertToUnderscoreCase(list);
+////
+////            return result;
+////
+////
+////        } catch (TencentCloudSDKException e) {
+////            e.printStackTrace();
+////        }
+////        return null;
+////    }
+//
+//    /**
+//     * [腾讯云] 号码信息查询
+//     */
+////    @Override
+////    public List<Map<String, Object>> getDescribePhoneNumberInfo(String phones) {
+////        try {
+////
+////            if (phones == null) {
+////                throw new CustException("手机号码不能为空");
+////            }
+////            String[] phoneNumberSet = phones.split(",");
+////
+////            // ----------------------------------------------------------------------
+////            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
+////            ClientProfile clientProfile = new ClientProfile();
+////            SmsClient client = new SmsClient(cred, "ap-guangzhou",clientProfile);
+////
+////            DescribePhoneNumberInfoRequest req = new DescribePhoneNumberInfoRequest();
+////            req.setPhoneNumberSet(phoneNumberSet);
+////
+////            DescribePhoneNumberInfoResponse res = client.DescribePhoneNumberInfo(req);
+////
+////            // 输出json格式的字符串回包
+////            String resString = SendStatusStatisticsResponse.toJsonString(res);
+////            JSONObject resp = JSONUtil.parseObj(resString);
+////            /*
+////            {
+////                "PhoneNumberInfoSet": [
+////                    {
+////                        "Code": "InvalidParameterValue.IncorrectPhoneNumber",
+////                        "Message": "incorrect phoneNumber format",
+////                        "NationCode": "",
+////                        "SubscriberNumber": "",
+////                        "PhoneNumber": "13670511519",
+////                        "IsoCode": "DEF",
+////                        "IsoName": ""
+////                    }
+////                ],
+////                "RequestId": "b49704fe-5286-4d4a-87eb-f560a72320ab"
+////            }
+////             */
+////
+////            List<Map<String, Object>> list = (List<Map<String, Object>>) MapUtil.get(resp, "PhoneNumberInfoSet");
+////            List<Map<String, Object>> result = ListUtil.convertToUnderscoreCase(list);
+////
+////            return result;
+////
+////
+////        } catch (TencentCloudSDKException e) {
+////            e.printStackTrace();
+////        }
+////        return null;
+////    }
+//}