diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUnionidToExternalUseridResult.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUnionidToExternalUseridResult.java new file mode 100644 index 0000000000..f14fa45f6a --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUnionidToExternalUseridResult.java @@ -0,0 +1,27 @@ +package me.chanjar.weixin.cp.bean; + +import com.google.gson.annotations.SerializedName; +import lombok.*; +import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; + + +@Getter +@Setter +public class WxCpTpUnionidToExternalUseridResult extends WxCpBaseResp { + + + private static final long serialVersionUID = -6153589164415497369L; + + @SerializedName("external_userid") + private String externalUserid; + + @SerializedName("pending_id") + private String pendingId; + + + public static WxCpTpUnionidToExternalUseridResult fromJson(String json) { + return WxCpGsonBuilder.create().fromJson(json, WxCpTpUnionidToExternalUseridResult.class); + } + + +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpIdConverService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpIdConverService.java new file mode 100644 index 0000000000..c60e20a2c9 --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpIdConverService.java @@ -0,0 +1,25 @@ +package me.chanjar.weixin.cp.tp.service; + +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.cp.bean.WxCpTpUnionidToExternalUseridResult; + +/** + *
+ * 企业微信三方应用ID转换接口 + * + *+ */ +public interface WxCpTpIdConverService { + + + /** + * unionid与external_userid的关联 https://developer.work.weixin.qq.com/document/path/95900 + * @param unionid 微信客户的unionid + * @param openid 微信客户的openid + * @param subjectType 程序或公众号的主体类型: 0表示主体名称是企业的,1表示主体名称是服务商的 + * @throws WxErrorException + */ + WxCpTpUnionidToExternalUseridResult unionidToExternalUserid(String cropId,String unionid, String openid, Integer subjectType) throws WxErrorException; + + +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java index ecb7084c73..c20878a24d 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java @@ -605,4 +605,10 @@ public interface WxCpTpService { * @param wxCpTpEditionService the wx cp tp edition service */ void setWxCpTpOrderService(WxCpTpEditionService wxCpTpEditionService); + + + WxCpTpIdConverService getWxCpTpIdConverService(); + + void setWxCpTpIdConverService(WxCpTpIdConverService wxCpTpIdConverService); + } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java index c089cb3e22..f6b11794d5 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java @@ -57,6 +57,7 @@ public abstract class BaseWxCpTpServiceImpl