-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HR助手getEmployeeFieldInfo,getAll参数问题,没有此参数 #3925
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
Changes from all commits
5567348
4ddad91
5313f17
3da4e37
a553c9b
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 |
|---|---|---|
|
|
@@ -40,11 +40,17 @@ public WxCpHrEmployeeFieldInfoResp getFieldInfo(List<String> fields) throws WxEr | |
|
|
||
| @Override | ||
| public WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo(String userid, List<String> fields) throws WxErrorException { | ||
| return getEmployeeFieldInfo(userid,false,fields); | ||
| } | ||
|
Comment on lines
42
to
+44
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. 这里的格式与本文件其余部分不一致(逗号后缺少空格)。建议按既有风格调整为在逗号后留空格,避免 checkstyle/可读性问题。 |
||
|
|
||
| @Override | ||
| public WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo(String userid, boolean getAll, List<String> fields) throws WxErrorException { | ||
| if (userid == null || userid.trim().isEmpty()) { | ||
| throw new IllegalArgumentException("userid 不能为空"); | ||
| } | ||
| JsonObject jsonObject = new JsonObject(); | ||
| jsonObject.addProperty("userid", userid); | ||
| jsonObject.addProperty("get_all", getAll); | ||
| if (fields != null && !fields.isEmpty()) { | ||
|
Comment on lines
52
to
54
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. 这里无条件向请求体写入了 |
||
| jsonObject.add("fields", WxCpGsonBuilder.create().toJsonTree(fields)); | ||
| } | ||
|
|
||
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.
该接口原注释曾表明
fields可不填以返回全部字段;并且测试用例也以fields=null调用。这里把fields描述改成必填会造成文档与实际/既有用法不一致。建议在 Javadoc 中明确fields为空时的行为(例如:不填则返回全部字段)。