wangrenhuang
2023-05-17 b3da718f9dbd3e1df279e8616ccd21e344e9005d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.hz.his.feign.service.platform;
 
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;
import org.springframework.web.bind.annotation.RequestHeader;
 
/**
 * 这里这个name 需要填写 请求的服务提供者的注册到nacos Server上面的服务名,path 是请求接口前缀
 * url :指定地址(token统一拿线上,所以需要指定)
 */
@FeignClient(name="phi-platform-service",url = "https://phiapi.phiskin.com",path = "/phip",contextId = "phip-token")
public interface SWxTokenService {
 
    /**
     *获取小程序企业微信应用token
     * 转化使用 WxTokenDt
     * @param getTokenDto 对象
     * @return
     */
    @PostMapping(value = "/account_token/apply/get_token")
    Result corpApplyToken(@RequestBody GetTokenDto getTokenDto,
                          @RequestHeader(name = "appId",required = true) String appId,
                          @RequestHeader(name = "sign",required = true) String sign,
                          @RequestHeader(name = "appIdCode",required = false) String appIdCode);
 
    /**
     *获取小程序普通token
     * 转化使用 WxTokenDt
     * @param getTokenDto 对象
     * @return
     */
    @PostMapping(value = "/account_token/mp/get_token")
    Result mpToken(@RequestBody GetTokenDto getTokenDto,
                   @RequestHeader(name = "appId",required = true) String appId,
                   @RequestHeader(name = "sign",required = true) String sign,
                   @RequestHeader(name = "appIdCode",required = false) String appIdCode);
 
 
    /**
     *获取公众号普通token
     * 转化使用 WxTokenDt
     * @param getTokenDto 对象
     * @return
     */
    @PostMapping(value = "/account_token/weChat/get_token")
    Result weChatToken(@RequestBody GetTokenDto getTokenDto,
                       @RequestHeader(name = "appId",required = true) String appId,
                       @RequestHeader(name = "sign",required = true) String sign,
                       @RequestHeader(name = "appIdCode",required = false) String appIdCode);
 
    /**
     *获取企业微信通讯录token
     * 转化使用 WxTokenDt
     * @param getTokenDto 对象
     * @return
     */
    @PostMapping(value = "/account_token/communi/get_token")
    Result corpCommonToken(@RequestBody GetTokenDto getTokenDto,
                           @RequestHeader(name = "appId",required = true) String appId,
                           @RequestHeader(name = "sign",required = true) String sign,
                           @RequestHeader(name = "appIdCode",required = false) String appIdCode);
 
    /**
     *获取企业微信联系我token
     * 转化使用 WxTokenDt
     * @param getTokenDto 对象
     * @return
     */
    @PostMapping(value = "/account_token/contact/get_token")
    Result corpContactToken(@RequestBody GetTokenDto getTokenDto,
                           @RequestHeader(name = "appId",required = true) String appId,
                           @RequestHeader(name = "sign",required = true) String sign,
                           @RequestHeader(name = "appIdCode",required = false) String appIdCode);
 
}