File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed
main/java/me/chanjar/weixin/cp/api
test/java/me/chanjar/weixin/cp/api/impl Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,12 @@ public interface WxCpHrService {
3737 * 权限说明:
3838 * 需要配置人事助手的secret,调用接口前需给对应成员赋予人事小助手应用的权限。
3939 *
40- * @param userids 员工userid列表,不超过20个
41- * @param fields 指定字段key列表,不填则返回全部字段
40+ * @param userid 员工userid
41+ * @param fields 指定字段key列表,不填则返回全部字段
4242 * @return 员工档案数据响应 wx cp hr employee field data resp
4343 * @throws WxErrorException the wx error exception
4444 */
45- WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo (List < String > userids , List <String > fields ) throws WxErrorException ;
45+ WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo (String userid , List <String > fields ) throws WxErrorException ;
4646
4747 /**
4848 * 更新员工档案数据.
Original file line number Diff line number Diff line change @@ -39,15 +39,12 @@ public WxCpHrEmployeeFieldInfoResp getFieldInfo(List<String> fields) throws WxEr
3939 }
4040
4141 @ Override
42- public WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo (List < String > userids , List <String > fields ) throws WxErrorException {
43- if (userids == null || userids .isEmpty ()) {
42+ public WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo (String userid , List <String > fields ) throws WxErrorException {
43+ if (userid == null || userid . trim () .isEmpty ()) {
4444 throw new IllegalArgumentException ("userid 不能为空" );
4545 }
46- if (userids .size () > 20 ) {
47- throw new IllegalArgumentException ("userid 每次最多传入20个" );
48- }
4946 JsonObject jsonObject = new JsonObject ();
50- jsonObject .add ("userid" , WxCpGsonBuilder . create (). toJsonTree ( userids ) );
47+ jsonObject .addProperty ("userid" , userid );
5148 if (fields != null && !fields .isEmpty ()) {
5249 jsonObject .add ("fields" , WxCpGsonBuilder .create ().toJsonTree (fields ));
5350 }
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public void testGetFieldInfoWithFilter() throws WxErrorException {
7575 public void testGetEmployeeFieldInfo () throws WxErrorException {
7676 WxCpHrService hrService = this .wxCpService .getHrService ();
7777 WxCpHrEmployeeFieldDataResp resp = hrService .getEmployeeFieldInfo (
78- Collections . singletonList ( this .configStorage .getUserId () ), null );
78+ this .configStorage .getUserId (), null );
7979 assertThat (resp ).isNotNull ();
8080 assertThat (resp .getEmployeeFieldList ()).isNotNull ();
8181 log .info ("获取员工档案数据: {}" , resp );
You can’t perform that action at this time.
0 commit comments