编程知识 cdmana.com

Java-demo版本免登服务,根据code获取userInfo API接口建议

我在API文档上看到,免登服务的服务端接口返回值如下:

{
    "errcode": 40029,
    "errmsg": "invalid code",
    "userid": "USERID",
    "deviceId":"DEVICEID",
    "is_sys": true,
    "sys_level": 0|1|2
}



[size=font-size: 1em !important,1em !important][font='Microsoft Yahei', 微软雅黑, Arial]

我看到client-sdk.api-1.0.0-SNAPSHOT.jar包下的函数调用方法:
[font='Microsoft Yahei', 微软雅黑, Arial]

@OpenAPI(httpMethod=OpenAPI.HttpMethod.GET, uriPath="/user/getuserinfo")
  public abstract CorpUserDetail getUserinfo(@ParamAttr(location=ParamAttr.Location.URL, paramKey="access_token") String paramString1, @ParamAttr(location=ParamAttr.Location.URL, paramKey="code") String paramString2)
    throws ServiceException;

在返回值CorpUserDetail类中,除了userid,并没有定义以上API中的返回字段
[font='Microsoft Yahei', 微软雅黑, Arial] private static final long serialVersionUID = 1L;
    private java.lang.String tel;
    private java.lang.String workPlace;
    private java.lang.String remark;
    private java.lang.String mobile;
    private java.lang.String email;
    private java.lang.String orderInDepts;
    private java.lang.Boolean isAdmin;
    private java.lang.Boolean isBoss;
    private java.lang.Boolean isSenior;
    private java.lang.String dingId;
    private java.lang.String isLeaderInDepts;
    private java.lang.Boolean isHide;
    private java.util.List<java.lang.Long> department;
    private java.lang.String position;
    private java.lang.String avatar;
    private java.lang.String jobnumber;
    private java.util.Map<java.lang.String,java.lang.String> extattr;



[font='Microsoft Yahei', 微软雅黑, Arial]

这样调用这个接口,就没办法确定用户到底是否是管理员,建议加上上面API定义接口的字段。
[font='Microsoft Yahei', 微软雅黑, Arial]

[font='Microsoft Yahei', 微软雅黑, Arial]





采纳答案1:
我们会尽快在sdk中补全相应字段。

版权声明
本文为[阿里云问答]所创,转载请带上原文链接,感谢
https://developer.aliyun.com/ask/243144

Scroll to Top