| | |
| | | public final static String[] GET_USER_DETAIL =new String[]{ "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=${accesstoken}&userid=${id}","获取成员详情"}; |
| | | //发送应用消息,access_token=调用接口凭证 POST请求, |
| | | public final static String[] SEND_MSG =new String[]{ "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}","发生推送消息"}; |
| | | public final static String[] GET_USER_BY_AUTH_CODE =new String[]{ "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=${accesstoken}&code=${code}","获取用户登录身份"}; |
| | | |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | public static QywxBaseResponse<String> getUserInfoByCode(String token,String code) { |
| | | String[] interfaceUrl = QywxConstant.GET_USER_BY_AUTH_CODE; |
| | | String url = interfaceUrl[0].replace("${accesstoken}",token).replace("${code}",code); |
| | | QywxBaseResponse<String> response = sendHttpRequest(url,interfaceUrl[1],"" |
| | | ,new TypeReference<QywxBaseResponse<String>>(){}); |
| | | if(response.getErrcode()!=null && response.getErrcode() ==0){ |
| | | return response; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 发起wms接口请求 |
| | |
| | | public class QywxBaseResponse<T> { |
| | | public static final String CODE_SUCCESS = "1"; |
| | | @ApiModelProperty(value = "返回参数" ) |
| | | @JSONField(name="records",alternateNames = {"department","userlist","userFavoriteList","userBehaviorList","customerFavoritesList"}) |
| | | @JSONField(name="records",alternateNames = {"department","userlist","userid"}) |
| | | private T data; |
| | | @ApiModelProperty(value = "出错返回码,为0表示成功,非0表示调用失败") |
| | | private Integer errcode; |