From 3c07961f1a4ff33824b7c98147efbb4d3a58b800 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Wed, 19 Feb 2025 04:36:28 +0000
Subject: [PATCH] 企微审批状态回调记录API添加
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/Temp.java | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/Temp.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/Temp.java
index 11efb70..828fd72 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/Temp.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/Temp.java
@@ -4,20 +4,22 @@
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
+import me.zhengjie.annotation.rest.AnonymousGetMapping;
+import me.zhengjie.annotation.rest.AnonymousPostMapping;
import me.zhengjie.annotation.rest.AnonymousPutMapping;
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.project.repository.ProjectRepository;
-import me.zhengjie.modules.project.repository.ProjectTypeRepository;
-import me.zhengjie.modules.project.service.ProjectService;
-import me.zhengjie.modules.project.service.dto.ProjectDto;
import me.zhengjie.modules.project.service.dto.ProjectQueryCriteria;
-import me.zhengjie.modules.project.service.mapstruct.ProjectMapper;
+import me.zhengjie.modules.temp.service.WechatSendHistoryService;
import me.zhengjie.utils.QueryHelp;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.util.List;
@RestController
@@ -27,6 +29,7 @@
public class Temp {
private final ProjectRepository projectRepository;
+ private final WechatSendHistoryService wechatSendHistoryService;
@AnonymousPutMapping(value = "/updateProjectLiableUserId")
@Log("修改项目责任人ID")
@@ -45,4 +48,21 @@
return new ResponseEntity<>("", HttpStatus.OK);
}
+
+ @AnonymousGetMapping(value = "/wechat/approval/back")
+ @Log("企业微信验证回调URL")
+ @ApiOperation("企业微信验证回调URL")
+ public ResponseEntity<Object> approvalBack(@RequestParam(value = "msg_signature") String msgSignature, @RequestParam(value = "timestamp") String timestamp,
+ @RequestParam(value = "nonce") String nonce, @RequestParam(value = "echostr") String echostr, HttpServletResponse response){
+ return new ResponseEntity<>(wechatSendHistoryService.approvalBack(msgSignature, timestamp, nonce, echostr, response), HttpStatus.OK);
+ }
+
+ @AnonymousPostMapping(value = "/wechat/approval/back")
+ @Log("处理企业微信审批回调事件")
+ @ApiOperation("处理企业微信审批回调事件")
+ public ResponseEntity<Object> handleApprovalCallback(@RequestParam(value = "msg_signature") String msgSignature, @RequestParam(value = "timestamp") String timestamp,
+ @RequestParam(value = "nonce") String nonce, HttpServletRequest request, HttpServletResponse response){
+ wechatSendHistoryService.handleApprovalCallback(msgSignature, timestamp, nonce, request, response);
+ return new ResponseEntity<>(HttpStatus.OK);
+ }
}
--
Gitblit v1.9.3