支付方法中的证书文件参数由File调整为InputStream

This commit is contained in:
jinyu
2015-07-08 09:02:17 +08:00
parent 7fe0b7b055
commit 7be1a45403
10 changed files with 116 additions and 147 deletions
@@ -579,8 +579,6 @@ public class WeixinProxy {
*
* @param code
* 通过员工授权获取到的code,每次员工授权带上的code将不一样,code只能使用一次,5分钟未被使用自动过期
* @param agentid
* 跳转链接时所在的企业应用ID
* @see com.foxinmy.weixin4j.qy.model.User
* @see com.foxinmy.weixin4j.qy.api.UserApi
* @return 成员对象
@@ -592,8 +590,8 @@ public class WeixinProxy {
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E6%A0%B9%E6%8D%AEcode%E8%8E%B7%E5%8F%96%E6%88%90%E5%91%98%E4%BF%A1%E6%81%AF">根据code获取成员信息</a>
* @throws WeixinException
*/
public User getUserByCode(String code, int agentid) throws WeixinException {
return userApi.getUserByCode(code, agentid);
public User getUserByCode(String code) throws WeixinException {
return userApi.getUserByCode(code);
}
/**
@@ -601,9 +599,8 @@ public class WeixinProxy {
*
* @param code
* 通过员工授权获取到的code,每次员工授权带上的code将不一样,code只能使用一次,5分钟未被使用自动过期
* @param agentid
* 跳转链接时所在的企业应用ID
* @return { "UserId":"USERID", "DeviceId":"DEVICEID" }
* @return { "UserId":"USERID", "DeviceId":"DEVICEID" } or
* {"OpenId":"OPENID","DeviceId":"DEVICEID"}
* @see com.foxinmy.weixin4j.qy.api.UserApi
* @see <a
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E4%BC%81%E4%B8%9A%E8%8E%B7%E5%8F%96code">企业获取code</a>
@@ -611,9 +608,8 @@ public class WeixinProxy {
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E6%A0%B9%E6%8D%AEcode%E8%8E%B7%E5%8F%96%E6%88%90%E5%91%98%E4%BF%A1%E6%81%AF">根据code获取成员信息</a>
* @throws WeixinException
*/
public JSONObject getUserIdByCode(String code, int agentid)
throws WeixinException {
return userApi.getUserIdByCode(code, agentid);
public JSONObject getUserIdByCode(String code) throws WeixinException {
return userApi.getUserIdByCode(code);
}
/**
@@ -156,8 +156,6 @@ public class UserApi extends QyApi {
*
* @param code
* 通过员工授权获取到的code,每次员工授权带上的code将不一样,code只能使用一次,5分钟未被使用自动过期
* @param agentid
* 跳转链接时所在的企业应用ID
* @see com.foxinmy.weixin4j.qy.model.User
* @see com.foxinmy.weixin4j.qy.api.UserApi
* @return 成员对象
@@ -169,8 +167,8 @@ public class UserApi extends QyApi {
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E6%A0%B9%E6%8D%AEcode%E8%8E%B7%E5%8F%96%E6%88%90%E5%91%98%E4%BF%A1%E6%81%AF">根据code获取成员信息</a>
* @throws WeixinException
*/
public User getUserByCode(String code, int agentid) throws WeixinException {
return getUser(getUserIdByCode(code, agentid).getString("UserId"));
public User getUserByCode(String code) throws WeixinException {
return getUser(getUserIdByCode(code).getString("UserId"));
}
/**
@@ -200,8 +198,6 @@ public class UserApi extends QyApi {
*
* @param code
* 通过员工授权获取到的code,每次员工授权带上的code将不一样,code只能使用一次,5分钟未被使用自动过期
* @param agentid
* 跳转链接时所在的企业应用ID
* @return { "UserId":"USERID", "DeviceId":"DEVICEID" }
* @see <a
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E4%BC%81%E4%B8%9A%E8%8E%B7%E5%8F%96code">企业获取code</a>
@@ -209,12 +205,11 @@ public class UserApi extends QyApi {
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E6%A0%B9%E6%8D%AEcode%E8%8E%B7%E5%8F%96%E6%88%90%E5%91%98%E4%BF%A1%E6%81%AF">根据code获取成员信息</a>
* @throws WeixinException
*/
public JSONObject getUserIdByCode(String code, int agentid)
throws WeixinException {
public JSONObject getUserIdByCode(String code) throws WeixinException {
String user_getid_uri = getRequestUri("user_getid_uri");
Token token = tokenHolder.getToken();
WeixinResponse response = weixinClient.post(String.format(
user_getid_uri, token.getAccessToken(), code, agentid));
user_getid_uri, token.getAccessToken(), code));
return response.getAsJson();
}
@@ -20,7 +20,7 @@ user_update_uri={api_base_url}/user/update?access_token=%s
# \u83b7\u53d6\u6210\u5458\u4fe1\u606f
user_get_uri={api_base_url}/user/get?access_token=%s&userid=%s
# code\u83b7\u53d6\u6210\u5458\u4fe1\u606f
user_getid_uri={api_base_url}/user/getuserinfo?access_token=%s&code=%s&agentid=%d
user_getid_uri={api_base_url}/user/getuserinfo?access_token=%s&code=%s
# \u83b7\u53d6\u90e8\u95e8\u6210\u5458
user_slist_uri={api_base_url}/user/simplelist?access_token=%s&department_id=%d&fetch_child=%d&status=%d
# \u83b7\u53d6\u90e8\u95e8\u6210\u5458(\u8be6\u60c5)