From 9f236f0a698cabf9fe98bac06bea88f0d5d72a9f Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期五, 22 七月 2022 11:46:32 +0800
Subject: [PATCH] 获取token

---
 phis-feign/src/main/java/com/hz/his/dto/token/GetTokenDto.java         |   13 ++++++
 phis-feign/src/main/java/com/hz/his/feign/service/SWxTokenService.java |   34 +++++++++++++++++
 phis-feign/src/main/java/com/hz/phis/dt/WxTokenDt.java                 |   23 +++++++++++
 3 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/phis-feign/src/main/java/com/hz/his/dto/token/GetTokenDto.java b/phis-feign/src/main/java/com/hz/his/dto/token/GetTokenDto.java
new file mode 100644
index 0000000..0623611
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/his/dto/token/GetTokenDto.java
@@ -0,0 +1,13 @@
+package com.hz.his.dto.token;
+
+import lombok.Data;
+
+@Data
+public class GetTokenDto {
+
+    /**浼佷笟id*/
+    private String corpId;
+    /**灏忕▼搴廰ppid*/
+    private String mpId;
+
+}
diff --git a/phis-feign/src/main/java/com/hz/his/feign/service/SWxTokenService.java b/phis-feign/src/main/java/com/hz/his/feign/service/SWxTokenService.java
new file mode 100644
index 0000000..28fd955
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/his/feign/service/SWxTokenService.java
@@ -0,0 +1,34 @@
+package com.hz.his.feign.service;
+
+import com.hx.resultTool.Result;
+import com.hz.his.dto.token.GetTokenDto;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * 杩欓噷杩欎釜name 闇�瑕佸~鍐� 璇锋眰鐨勬湇鍔℃彁渚涜�呯殑娉ㄥ唽鍒皀acos Server涓婇潰鐨勬湇鍔″悕锛宲ath 鏄姹傛帴鍙e墠缂�
+ */
+@FeignClient(name="phi-platfrom-service",path = "/phip",contextId = "cos-down")
+public interface SWxTokenService {
+
+    /**
+     *鑾峰彇灏忕▼搴忎紒涓氬井淇″簲鐢╰oken
+     * 杞寲浣跨敤 WxTokenVo
+     * @param GetTokenDto 瀵硅薄
+     * @return
+     */
+    @PostMapping(value = "/account_token/apply/get_toke")
+    Result corpApplyToken(@RequestBody GetTokenDto GetTokenDto);
+
+    /**
+     *鑾峰彇灏忕▼搴忓钩鍙皌oken
+     * 杞寲浣跨敤 WxTokenVo
+     * @param GetTokenDto 瀵硅薄
+     * @return
+     */
+    @PostMapping(value = "/account_token/mp/get_token")
+    Result mpToken(@RequestBody GetTokenDto GetTokenDto);
+
+
+}
\ No newline at end of file
diff --git a/phis-feign/src/main/java/com/hz/phis/dt/WxTokenDt.java b/phis-feign/src/main/java/com/hz/phis/dt/WxTokenDt.java
new file mode 100644
index 0000000..c0a3fe2
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/phis/dt/WxTokenDt.java
@@ -0,0 +1,23 @@
+package com.hz.phis.dt;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class WxTokenDt {
+
+    /**token鍙傛暟*/
+    @JSONField(name = "access_token")
+    private String accessToken;
+    /**鍒涘缓鏃堕棿*/
+    @JSONField(name = "create_time",format = "yyyy-MM-dd HH:mm:dd")
+    private Date createTime;
+    /**鏈夋晥鍓╀綑鏃堕棿锛堢锛�*/
+    @JSONField(name = "expires_in")
+    private long expiresIn;
+    /**鏈夋晥鍓╀綑鏃堕棿锛堢锛夛紝棰勭暀*/
+    @JSONField(name = "expires_surplus")
+    private long expiresSurplus;
+}

--
Gitblit v1.8.0