主要改进了部分API的名称
This commit is contained in:
@@ -695,8 +695,8 @@ public class WeixinProxy {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%9B%9E%E8%B0%83%E6%A8%A1%E5%BC%8F#.E8.8E.B7.E5.8F.96.E5.BE.AE.E4.BF.A1.E6.9C.8D.E5.8A.A1.E5.99.A8.E7.9A.84ip.E6.AE.B5">获取IP地址</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<String> getcallbackip() throws WeixinException {
|
||||
return helperApi.getcallbackip();
|
||||
public List<String> getCallbackip() throws WeixinException {
|
||||
return helperApi.getCallbackip();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -762,9 +762,9 @@ public class WeixinProxy {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E9.82.80.E8.AF.B7.E6.88.90.E5.91.98.E5.85.B3.E6.B3.A8">邀请成员关注</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String inviteuser(IdParameter parameter, Callback callback,
|
||||
public String batchInviteUser(IdParameter parameter, Callback callback,
|
||||
String tips) throws WeixinException {
|
||||
return batchApi.inviteuser(parameter, callback, tips);
|
||||
return batchApi.inviteUser(parameter, callback, tips);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -786,9 +786,9 @@ public class WeixinProxy {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E5.A2.9E.E9.87.8F.E6.9B.B4.E6.96.B0.E6.88.90.E5.91.98">批量更新成员</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String syncuser(String mediaId, Callback callback)
|
||||
public String batchSyncUser(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
return batchApi.syncuser(mediaId, callback);
|
||||
return batchApi.syncUser(mediaId, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -811,9 +811,9 @@ public class WeixinProxy {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E5.85.A8.E9.87.8F.E8.A6.86.E7.9B.96.E6.88.90.E5.91.98">批量覆盖成员</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String replaceuser(String mediaId, Callback callback)
|
||||
public String batchReplaceUser(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
return batchApi.replaceuser(mediaId, callback);
|
||||
return batchApi.replaceUser(mediaId, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -853,9 +853,9 @@ public class WeixinProxy {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E5.85.A8.E9.87.8F.E8.A6.86.E7.9B.96.E9.83.A8.E9.97.A8">批量覆盖部门</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String replaceparty(String mediaId, Callback callback)
|
||||
public String batchReplaceParty(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
return batchApi.replaceparty(mediaId, callback);
|
||||
return batchApi.replaceParty(mediaId, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@ public class BatchApi extends QyApi {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E9.82.80.E8.AF.B7.E6.88.90.E5.91.98.E5.85.B3.E6.B3.A8">邀请成员关注</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String inviteuser(IdParameter parameter, Callback callback,
|
||||
public String inviteUser(IdParameter parameter, Callback callback,
|
||||
String tips) throws WeixinException {
|
||||
String batch_inviteuser_uri = getRequestUri("batch_inviteuser_uri");
|
||||
Token token = tokenHolder.getToken();
|
||||
@@ -81,7 +81,7 @@ public class BatchApi extends QyApi {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E5.A2.9E.E9.87.8F.E6.9B.B4.E6.96.B0.E6.88.90.E5.91.98">批量更新成员</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String syncuser(String mediaId, Callback callback)
|
||||
public String syncUser(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
String batch_syncuser_uri = getRequestUri("batch_syncuser_uri");
|
||||
return batch(batch_syncuser_uri, mediaId, callback);
|
||||
@@ -119,7 +119,7 @@ public class BatchApi extends QyApi {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E5.85.A8.E9.87.8F.E8.A6.86.E7.9B.96.E6.88.90.E5.91.98">批量覆盖成员</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String replaceuser(String mediaId, Callback callback)
|
||||
public String replaceUser(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
String batch_replaceuser_uri = getRequestUri("batch_replaceuser_uri");
|
||||
return batch(batch_replaceuser_uri, mediaId, callback);
|
||||
@@ -144,7 +144,7 @@ public class BatchApi extends QyApi {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3#.E5.85.A8.E9.87.8F.E8.A6.86.E7.9B.96.E9.83.A8.E9.97.A8">批量覆盖部门</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String replaceparty(String mediaId, Callback callback)
|
||||
public String replaceParty(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
String batch_replaceparty_uri = getRequestUri("batch_replaceparty_uri");
|
||||
return batch(batch_replaceparty_uri, mediaId, callback);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class HelperApi extends QyApi {
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%9B%9E%E8%B0%83%E6%A8%A1%E5%BC%8F#.E8.8E.B7.E5.8F.96.E5.BE.AE.E4.BF.A1.E6.9C.8D.E5.8A.A1.E5.99.A8.E7.9A.84ip.E6.AE.B5">获取IP地址</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<String> getcallbackip() throws WeixinException {
|
||||
public List<String> getCallbackip() throws WeixinException {
|
||||
String getcallbackip_uri = getRequestUri("getcallbackip_uri");
|
||||
Token token = tokenHolder.getToken();
|
||||
WeixinResponse response = weixinClient.post(String.format(getcallbackip_uri,
|
||||
|
||||
@@ -43,7 +43,9 @@ public class PartyApi extends QyApi {
|
||||
public int createParty(Party depart) throws WeixinException {
|
||||
String department_create_uri = getRequestUri("department_create_uri");
|
||||
JSONObject obj = (JSONObject) JSON.toJSON(depart);
|
||||
obj.remove("id");
|
||||
if (depart.getId() < 1) {
|
||||
obj.remove("id");
|
||||
}
|
||||
Token token = tokenHolder.getToken();
|
||||
WeixinResponse response = weixinClient.post(
|
||||
String.format(department_create_uri, token.getAccessToken()),
|
||||
@@ -75,7 +77,8 @@ public class PartyApi extends QyApi {
|
||||
/**
|
||||
* 查询部门列表(以部门的order字段从小到大排列)
|
||||
*
|
||||
* @param partId 部门ID。获取指定部门ID下的子部门
|
||||
* @param partId
|
||||
* 部门ID。获取指定部门ID下的子部门
|
||||
* @see com.foxinmy.weixin4j.qy.model.Party
|
||||
* @see <a
|
||||
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E7%AE%A1%E7%90%86%E9%83%A8%E9%97%A8#.E8.8E.B7.E5.8F.96.E9.83.A8.E9.97.A8.E5.88.97.E8.A1.A8">获取部门列表</a>
|
||||
@@ -85,8 +88,8 @@ public class PartyApi extends QyApi {
|
||||
public List<Party> listParty(int partId) throws WeixinException {
|
||||
String department_list_uri = getRequestUri("department_list_uri");
|
||||
Token token = tokenHolder.getToken();
|
||||
WeixinResponse response = weixinClient.post(String.format(department_list_uri,
|
||||
token.getAccessToken()));
|
||||
WeixinResponse response = weixinClient.post(String.format(
|
||||
department_list_uri, token.getAccessToken()));
|
||||
return JSON.parseArray(response.getAsJson().getString("department"),
|
||||
Party.class);
|
||||
}
|
||||
@@ -104,8 +107,8 @@ public class PartyApi extends QyApi {
|
||||
public JsonResult deleteParty(int partId) throws WeixinException {
|
||||
String department_delete_uri = getRequestUri("department_delete_uri");
|
||||
Token token = tokenHolder.getToken();
|
||||
WeixinResponse response = weixinClient.post(String.format(department_delete_uri,
|
||||
token.getAccessToken(), partId));
|
||||
WeixinResponse response = weixinClient.post(String.format(
|
||||
department_delete_uri, token.getAccessToken(), partId));
|
||||
return response.getAsJsonResult();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class BatchTest extends TokenTest {
|
||||
@Test
|
||||
public void syncuser() throws WeixinException {
|
||||
String jobId = batchApi
|
||||
.syncuser(
|
||||
.syncUser(
|
||||
"1QFmZ8LE9dFxPPx8EH5Kfm3cqGXB0OuXY432ZpsfwMFTJjEDt7QI4GZB1UhYGOSYr",
|
||||
new Callback("http://182.254.188.133:8090",
|
||||
"gp2eGT5mIpngr",
|
||||
@@ -46,7 +46,7 @@ public class BatchTest extends TokenTest {
|
||||
public void replaceparty() throws WeixinException {
|
||||
String mediaId = mediaApi.batchUploadParties(Arrays.asList(new Party(5,
|
||||
"部门1", 1, 1), new Party(6, "部门2", 1, 1)));
|
||||
String jobId = batchApi.replaceparty(mediaId, new Callback(
|
||||
String jobId = batchApi.replaceParty(mediaId, new Callback(
|
||||
"http://182.254.188.133:8090", "gp2eGT5mIpngr",
|
||||
"BRYfV4zPFUJb3v3MySNBg1ERKE3vyyMRoScu76vFySv"));
|
||||
System.err.println(jobId);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class HelperTest extends TokenTest {
|
||||
|
||||
@Test
|
||||
public void backip() throws WeixinException {
|
||||
List<String> ips = helperApi.getcallbackip();
|
||||
List<String> ips = helperApi.getCallbackip();
|
||||
Assert.assertTrue(ips != null && !ips.isEmpty());
|
||||
System.out.println(ips);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user