-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
企业微信人事助手api响应序列化问题 #3977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
企业微信人事助手api响应序列化问题 #3977
Changes from all commits
5567348
4ddad91
5313f17
3da4e37
a553c9b
55b11b8
d69067c
09d72a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,9 @@ | |
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * 人事助手-员工档案数据(单个员工). | ||
| * 人事助手-员工档案数据(单个字段). | ||
| * | ||
| * @author <a href="https://github.com/leejoker">leejoker</a> created on 2024-01-01 | ||
| */ | ||
|
|
@@ -18,35 +17,120 @@ public class WxCpHrEmployeeFieldData implements Serializable { | |
| private static final long serialVersionUID = 4593693598671765396L; | ||
|
|
||
| /** | ||
| * 员工userid. | ||
| * 字段ID. | ||
| */ | ||
| @SerializedName("fieldid") | ||
| private Integer fieldId; | ||
|
|
||
| /** | ||
| * 子字段索引. | ||
| */ | ||
| @SerializedName("sub_idx") | ||
| private Integer subIdx; | ||
|
|
||
| /** | ||
| * 结果状态,1表示成功. | ||
| */ | ||
| @SerializedName("result") | ||
| private Integer result; | ||
|
|
||
| /** | ||
| * 值类型:1-字符串,2-uint64,3-uint32,4-int64,5-mobile. | ||
| */ | ||
| @SerializedName("value_type") | ||
| private Integer valueType; | ||
|
|
||
| /** | ||
| * 字符串值(value_type=1时使用). | ||
| */ | ||
| @SerializedName("value_string") | ||
| private String valueString; | ||
|
|
||
| /** | ||
| * 无符号32位整数值(value_type=3时使用). | ||
| */ | ||
| @SerializedName("value_uint32") | ||
| private Long valueUint32; | ||
|
|
||
| /** | ||
| * 有符号64位整数值(value_type=4时使用). | ||
| */ | ||
| @SerializedName("value_int64") | ||
| private Long valueInt64; | ||
|
|
||
| /** | ||
| * 无符号64位整数值(value_type=2时使用). | ||
| */ | ||
| @SerializedName("value_uint64") | ||
| private Long valueUint64; | ||
|
|
||
| /** | ||
| * 手机号值(value_type=5时使用). | ||
| */ | ||
| @SerializedName("value_mobile") | ||
| private MobileValue valueMobile; | ||
|
|
||
| /** | ||
| * 手机号值. | ||
| */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| public static class MobileValue implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 国家代码. | ||
| */ | ||
| @SerializedName("value_country_code") | ||
| private String valueCountryCode; | ||
|
|
||
| /** | ||
| * 手机号. | ||
| */ | ||
| @SerializedName("value_mobile") | ||
| private String valueMobile; | ||
| } | ||
|
|
||
| /** | ||
| * 员工userid(兼容旧版本,实际API不返回此字段). | ||
| * @deprecated 此字段在API响应中不存在 | ||
| */ | ||
| @Deprecated | ||
| @SerializedName("userid") | ||
| private String userid; | ||
|
|
||
| /** | ||
| * 字段数据列表. | ||
| * 字段数据列表(兼容旧版本,实际API不返回此字段). | ||
| * @deprecated 此字段在API响应中不存在 | ||
| */ | ||
| @Deprecated | ||
| @SerializedName("field_list") | ||
| private List<FieldItem> fieldList; | ||
| private java.util.List<FieldItem> fieldList; | ||
|
|
||
| /** | ||
| * 字段数据项. | ||
| * 字段数据项(用于更新员工档案). | ||
| */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| public static class FieldItem implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 字段key. | ||
| * 字段ID. | ||
| */ | ||
| @SerializedName("field_key") | ||
| private String fieldKey; | ||
| @SerializedName("fieldid") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldData.java:121: Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| private Integer fieldId; | ||
|
|
||
| /** | ||
| * 字段值. | ||
| * 字段值对象(推荐使用,支持多种类型). | ||
| */ | ||
| @SerializedName("field_value") | ||
| private WxCpHrEmployeeFieldValue fieldValue; | ||
|
|
||
| /** | ||
| * 字符串值(简化用法,适用于文本类型字段). | ||
| */ | ||
| @SerializedName("value_string") | ||
| private String valueString; | ||
|
Comment on lines
118
to
+134
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,30 +18,43 @@ public class WxCpHrEmployeeFieldInfo implements Serializable { | |
| private static final long serialVersionUID = 2593693598671765396L; | ||
|
|
||
| /** | ||
| * 字段key. | ||
| * 字段ID. | ||
| */ | ||
| @SerializedName("field_key") | ||
| private String fieldKey; | ||
|
|
||
| /** | ||
| * 字段英文名称. | ||
| */ | ||
| @SerializedName("field_en_name") | ||
| private String fieldEnName; | ||
| @SerializedName("fieldid") | ||
| private Integer fieldId; | ||
|
|
||
| /** | ||
| * 字段中文名称. | ||
| * 字段名称. | ||
| */ | ||
| @SerializedName("field_zh_name") | ||
| private String fieldZhName; | ||
| @SerializedName("field_name") | ||
| private String fieldName; | ||
|
|
||
| /** | ||
| * 字段类型. | ||
| * 具体取值参见 {@link WxCpHrFieldType} | ||
| * 1: 文本 | ||
| * 2: 单选/多选 | ||
| * 3: 日期 | ||
| */ | ||
| @SerializedName("field_type") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldInfo.java:38: The new Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| private Integer fieldType; | ||
|
|
||
| /** | ||
| * 是否必填. | ||
| */ | ||
| @SerializedName("is_must") | ||
| private Boolean isMust; | ||
|
|
||
| /** | ||
| * 值类型. | ||
| * 1: 字符串 | ||
| * 2: uint64 | ||
| * 3: uint32 | ||
| * 4: int64 | ||
| * 5: mobile | ||
| */ | ||
| @SerializedName("value_type") | ||
| private Integer valueType; | ||
|
|
||
| /** | ||
| * 获取字段类型枚举. | ||
| * | ||
|
|
@@ -52,22 +65,79 @@ public WxCpHrFieldType getFieldTypeEnum() { | |
| } | ||
|
|
||
| /** | ||
| * 是否系统字段. | ||
| * 0: 否 | ||
| * 1: 是 | ||
| * 选项列表(单选/多选字段专用). | ||
| */ | ||
| @SerializedName("option_list") | ||
| private List<Option> optionList; | ||
|
|
||
| /** | ||
| * 选项. | ||
| */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| public static class Option implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 选项ID. | ||
| */ | ||
| @SerializedName("id") | ||
| private Integer id; | ||
|
|
||
| /** | ||
| * 选项值. | ||
| */ | ||
| @SerializedName("value") | ||
| private String value; | ||
|
Comment on lines
+82
to
+91
|
||
| } | ||
|
|
||
| // ===== 以下字段为兼容旧版本 ===== | ||
|
|
||
| /** | ||
| * 字段key(兼容旧版本,实际API不返回此字段). | ||
| * @deprecated 使用 fieldId 代替 | ||
| */ | ||
| @Deprecated | ||
| @SerializedName("field_key") | ||
| private String fieldKey; | ||
|
|
||
| /** | ||
| * 字段英文名称(兼容旧版本,实际API不返回此字段). | ||
| * @deprecated 此字段在API响应中不存在 | ||
| */ | ||
| @Deprecated | ||
| @SerializedName("field_en_name") | ||
| private String fieldEnName; | ||
|
|
||
| /** | ||
| * 字段中文名称(兼容旧版本). | ||
| * @deprecated 使用 fieldName 代替 | ||
| */ | ||
| @Deprecated | ||
| @SerializedName("field_zh_name") | ||
| private String fieldZhName; | ||
|
|
||
| /** | ||
| * 是否系统字段(兼容旧版本,实际API不返回此字段). | ||
| * @deprecated 此字段在API响应中不存在 | ||
| */ | ||
| @Deprecated | ||
| @SerializedName("is_sys") | ||
| private Integer isSys; | ||
|
|
||
| /** | ||
| * 字段详情. | ||
| * 字段详情(兼容旧版本). | ||
| * @deprecated 使用 optionList 直接访问选项列表 | ||
| */ | ||
| @Deprecated | ||
| @SerializedName("field_detail") | ||
| private FieldDetail fieldDetail; | ||
|
|
||
| /** | ||
| * 字段详情. | ||
| * 字段详情(兼容旧版本). | ||
| * @deprecated 使用 optionList 代替 | ||
| */ | ||
| @Deprecated | ||
| @Data | ||
| @NoArgsConstructor | ||
| public static class FieldDetail implements Serializable { | ||
|
|
@@ -77,15 +147,17 @@ public static class FieldDetail implements Serializable { | |
| * 选项列表(单选/多选字段专用). | ||
| */ | ||
| @SerializedName("option_list") | ||
| private List<Option> optionList; | ||
| private List<OldOption> optionList; | ||
|
|
||
| } | ||
|
|
||
| /** | ||
| * 选项. | ||
| * 旧版选项(兼容旧版本). | ||
| * @deprecated 使用 Option 代替 | ||
| */ | ||
| @Deprecated | ||
| @Data | ||
| @NoArgsConstructor | ||
| public static class Option implements Serializable { | ||
| public static class OldOption implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weixin-java-cp/pom.xml:128: These
--add-opensJVM args are only supported on Java 9+, so if this module’s tests are ever executed on JDK8 the forked test JVM will fail to start. Consider guarding this configuration so it only applies on JDK9+ runs.Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.