-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🆕 #1873 【企业微信】第三方应用增加网页授权登陆获取访问用户身份和获取访问用户敏感信息的接口
- Loading branch information
1 parent
64d67bb
commit c80e77c
Showing
5 changed files
with
157 additions
and
4 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package me.chanjar.weixin.cp.bean; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
||
/** | ||
* | ||
* @author huangxiaoming | ||
*/ | ||
@Data | ||
public class WxCpTpUserDetail extends WxCpBaseResp { | ||
|
||
private static final long serialVersionUID = -5028321625140879571L; | ||
/** | ||
* 用户所属企业的corpid | ||
*/ | ||
@SerializedName("corpid") | ||
private String corpId; | ||
|
||
/** | ||
* 成员UserID | ||
*/ | ||
@SerializedName("userid") | ||
private String userId; | ||
|
||
/** | ||
* 成员姓名 | ||
*/ | ||
@SerializedName("name") | ||
private String name; | ||
|
||
/** | ||
* 性别。0表示未定义,1表示男性,2表示女性 | ||
*/ | ||
@SerializedName("gender") | ||
private String gender; | ||
|
||
/** | ||
* 头像url。仅在用户同意snsapi_privateinfo授权时返回 | ||
*/ | ||
@SerializedName("avatar") | ||
private String avatar; | ||
|
||
/** | ||
* 员工个人二维码(扫描可添加为外部联系人),仅在用户同意snsapi_privateinfo授权时返回 | ||
*/ | ||
@SerializedName("qr_code") | ||
private String qrCode; | ||
|
||
public static WxCpTpUserDetail fromJson(String json) { | ||
return WxCpGsonBuilder.create().fromJson(json, WxCpTpUserDetail.class); | ||
} | ||
|
||
public String toJson() { | ||
return WxCpGsonBuilder.create().toJson(this); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package me.chanjar.weixin.cp.bean; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
||
/** | ||
* @author huangxiaoming | ||
*/ | ||
@Data | ||
public class WxCpTpUserInfo extends WxCpBaseResp { | ||
|
||
private static final long serialVersionUID = -5028321625140879571L; | ||
|
||
/** | ||
* 用户所属企业的corpid | ||
*/ | ||
@SerializedName("CorpId") | ||
private String corpId; | ||
|
||
/** | ||
* 用户在企业内的UserID,如果该企业与第三方应用有授权关系时,返回明文UserId,否则返回密文UserId | ||
*/ | ||
@SerializedName("UserId") | ||
private String userId; | ||
|
||
/** | ||
* 手机设备号(由企业微信在安装时随机生成,删除重装会改变,升级不受影响) | ||
*/ | ||
@SerializedName("DeviceId") | ||
private String deviceId; | ||
|
||
/** | ||
* 成员票据,最大为512字节。 | ||
* scope为snsapi_userinfo或snsapi_privateinfo,且用户在应用可见范围之内时返回此参数。 | ||
* 后续利用该参数可以获取用户信息或敏感信息,参见:https://work.weixin.qq.com/api/doc/90001/90143/91122 | ||
*/ | ||
@SerializedName("user_ticket") | ||
private String userTicket; | ||
|
||
/** | ||
* user_ticket的有效时间(秒),随user_ticket一起返回 | ||
*/ | ||
@SerializedName("expires_in") | ||
private String expiresIn; | ||
|
||
/** | ||
* 全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取 | ||
*/ | ||
@SerializedName("open_userid") | ||
private String openUserId; | ||
|
||
public static WxCpTpUserInfo fromJson(String json) { | ||
return WxCpGsonBuilder.create().fromJson(json, WxCpTpUserInfo.class); | ||
} | ||
|
||
public String toJson() { | ||
return WxCpGsonBuilder.create().toJson(this); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters