新增OauthApi授权接口
This commit is contained in:
@@ -98,6 +98,8 @@ public class WeixinProxy {
|
||||
/**
|
||||
* 查询部门列表(以部门的order字段从小到大排列)
|
||||
*
|
||||
* @param departId
|
||||
* 部门ID。获取指定部门ID下的子部门
|
||||
* @see com.foxinmy.weixin4j.qy.model.Department
|
||||
* @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>
|
||||
@@ -105,8 +107,8 @@ public class WeixinProxy {
|
||||
* @return 部门列表
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<Department> listDepart() throws WeixinException {
|
||||
return departApi.listDepart();
|
||||
public List<Department> listDepart(int departId) throws WeixinException {
|
||||
return departApi.listDepart(departId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-1
@@ -75,13 +75,14 @@ public class DepartApi extends QyApi {
|
||||
/**
|
||||
* 查询部门列表(以部门的order字段从小到大排列)
|
||||
*
|
||||
* @param departId 部门ID。获取指定部门ID下的子部门
|
||||
* @see com.foxinmy.weixin4j.qy.model.Department
|
||||
* @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>
|
||||
* @return 部门列表
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<Department> listDepart() throws WeixinException {
|
||||
public List<Department> listDepart(int departId) throws WeixinException {
|
||||
String department_list_uri = getRequestUri("department_list_uri");
|
||||
Token token = tokenHolder.getToken();
|
||||
Response response = request.post(String.format(department_list_uri,
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class DepartTest extends TokenTest {
|
||||
|
||||
@Test
|
||||
public void list() throws WeixinException {
|
||||
List<Department> list = departApi.listDepart();
|
||||
List<Department> list = departApi.listDepart(1);
|
||||
Assert.assertFalse(list.isEmpty());
|
||||
System.out.println(list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user