From c098f1e3a3e052aa3d65584aae6dc003a70d75ad Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期二, 16 十二月 2025 00:09:14 +0800
Subject: [PATCH] feat: 停止轮询 uncount

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java
index 7175013..d9545fe 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskAttachmentController.java
@@ -14,6 +14,7 @@
 import com.ruoyi.system.service.ISysTaskEmergencyService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.system.service.ITaskAttachmentSyncService;
+import com.ruoyi.system.service.IWechatAccessTokenService;
 import com.ruoyi.system.task.ITaskAttachmentService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -62,10 +63,12 @@
 
     @Autowired
     private ISysUserService userService;
+
+    @Autowired
+    private IWechatAccessTokenService wechatAccessTokenService;
     /**
      * 鏌ヨ浠诲姟闄勪欢鍒楄〃
      */
-    @PreAuthorize("@ss.hasPermi('task:general:query')")
     @GetMapping("/list/{taskId}")
     public AjaxResult list(@PathVariable("taskId") Long taskId) {
         SysTask task = sysTaskService.getTaskDetail(taskId);
@@ -75,12 +78,12 @@
     /**
      * 涓婁紶浠诲姟闄勪欢
      */
-    @PreAuthorize("@ss.hasPermi('task:general:edit')")
+
     @Log(title = "浠诲姟闄勪欢", businessType = BusinessType.INSERT)
     @PostMapping("/upload/{taskId}")
     public AjaxResult upload(@PathVariable("taskId") Long taskId, 
                             @RequestParam("file") MultipartFile file,
-                            @RequestParam(value = "category", required = false) String category) {
+                            @RequestParam(value = "category", required = true) String category) {
         try {
             Long attachmentId= sysTaskService.uploadAttachment(taskId, file, category);
             if (attachmentId > 0) {
@@ -119,7 +122,6 @@
     /**
      * 鍒犻櫎浠诲姟闄勪欢
      */
-    @PreAuthorize("@ss.hasPermi('task:general:edit')")
     @Log(title = "浠诲姟闄勪欢", businessType = BusinessType.DELETE)
     @DeleteMapping("/{attachmentId}")
     public AjaxResult remove(@PathVariable("attachmentId") Long attachmentId) {
@@ -137,19 +139,16 @@
     
     /**
      * 浠庡井淇ediaId涓婁紶闄勪欢锛堝井淇″皬绋嬪簭涓撶敤锛�
+     * 浣跨敤搴旂敤绾х紦瀛樼殑AccessToken
      */
-    @PreAuthorize("@ss.hasPermi('task:general:edit')")
     @Log(title = "浠诲姟闄勪欢", businessType = BusinessType.INSERT)
     @PostMapping("/uploadFromWechat/{taskId}")
     public AjaxResult uploadFromWechat(@PathVariable("taskId") Long taskId,
                                        @RequestParam("mediaId") String mediaId,
                                        @RequestParam(value = "category", required = false) String category) {
         try {
-            // 鑾峰彇寰俊AccessToken
-            String accessToken = WechatUtils.getAccessToken(
-                wechatConfig.getAppId(), 
-                wechatConfig.getAppSecret()
-            );
+            // 鑾峰彇寰俊AccessToken锛堜娇鐢ㄥ簲鐢ㄧ骇缂撳瓨锛�
+            String accessToken = wechatAccessTokenService.getAppAccessToken();
             if (accessToken == null || accessToken.isEmpty()) {
                 return error("鑾峰彇寰俊AccessToken澶辫触");
             }

--
Gitblit v1.9.1