Skip to content

Commit 4047f6d

Browse files
aimilaimil
authored andcommitted
修改代码格式使用两个空格
1 parent 5525c4f commit 4047f6d

File tree

4 files changed

+404
-419
lines changed

4 files changed

+404
-419
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpUserService.java

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,55 @@
1414
*/
1515
public interface WxMpUserService {
1616

17-
/**
18-
* <pre>
19-
* 设置用户备注名接口
20-
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=设置用户备注名接口
21-
* </pre>
22-
*
23-
* @param openid 用户openid
24-
* @param remark 备注名
25-
*/
26-
void userUpdateRemark(String openid, String remark) throws WxErrorException;
17+
/**
18+
* <pre>
19+
* 设置用户备注名接口
20+
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=设置用户备注名接口
21+
* </pre>
22+
*
23+
* @param openid 用户openid
24+
* @param remark 备注名
25+
*/
26+
void userUpdateRemark(String openid, String remark) throws WxErrorException;
2727

28-
/**
29-
* <pre>
30-
* 获取用户基本信息
31-
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取用户基本信息
32-
* </pre>
33-
*
34-
* @param openid 用户openid
35-
* @param lang 语言,zh_CN 简体(默认),zh_TW 繁体,en 英语
36-
*/
37-
WxMpUser userInfo(String openid, String lang) throws WxErrorException;
28+
/**
29+
* <pre>
30+
* 获取用户基本信息
31+
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取用户基本信息
32+
* </pre>
33+
*
34+
* @param openid 用户openid
35+
* @param lang 语言,zh_CN 简体(默认),zh_TW 繁体,en 英语
36+
*/
37+
WxMpUser userInfo(String openid, String lang) throws WxErrorException;
3838

39-
/**
40-
* <pre>
41-
* 获取用户基本信息列表
42-
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
43-
* </pre>
44-
*
45-
* @param openid 用户openid, lang 使用默认(zh_CN 简体)
46-
*/
47-
List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException;
39+
/**
40+
* <pre>
41+
* 获取用户基本信息列表
42+
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
43+
* </pre>
44+
*
45+
* @param openid 用户openid, lang 使用默认(zh_CN 简体)
46+
*/
47+
List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException;
4848

49-
/**
50-
* <pre>
51-
* 获取用户基本信息列表
52-
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
53-
* </pre>
54-
*
55-
* @param userQuery 详细查询参数
56-
*/
57-
List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException;
49+
/**
50+
* <pre>
51+
* 获取用户基本信息列表
52+
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
53+
* </pre>
54+
*
55+
* @param userQuery 详细查询参数
56+
*/
57+
List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException;
5858

59-
/**
60-
* <pre>
61-
* 获取关注者列表
62-
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
63-
* </pre>
64-
*
65-
* @param nextOpenid 可选,第一个拉取的OPENID,null为从头开始拉取
66-
*/
67-
WxMpUserList userList(String nextOpenid) throws WxErrorException;
59+
/**
60+
* <pre>
61+
* 获取关注者列表
62+
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
63+
* </pre>
64+
*
65+
* @param nextOpenid 可选,第一个拉取的OPENID,null为从头开始拉取
66+
*/
67+
WxMpUserList userList(String nextOpenid) throws WxErrorException;
6868
}

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpUserServiceImpl.java

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,47 @@
1717
* Created by Binary Wang on 2016/7/21.
1818
*/
1919
public class WxMpUserServiceImpl implements WxMpUserService {
20-
private static final String API_URL_PREFIX = "https://api.weixin.qq.com/cgi-bin/user";
21-
private WxMpService wxMpService;
22-
23-
public WxMpUserServiceImpl(WxMpService wxMpService) {
24-
this.wxMpService = wxMpService;
25-
}
26-
27-
@Override
28-
public void userUpdateRemark(String openid, String remark) throws WxErrorException {
29-
String url = API_URL_PREFIX + "/info/updateremark";
30-
JsonObject json = new JsonObject();
31-
json.addProperty("openid", openid);
32-
json.addProperty("remark", remark);
33-
this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString());
34-
}
35-
36-
@Override
37-
public WxMpUser userInfo(String openid, String lang) throws WxErrorException {
38-
String url = API_URL_PREFIX + "/info";
39-
lang = lang == null ? "zh_CN" : lang;
40-
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, "openid=" + openid + "&lang=" + lang);
41-
return WxMpUser.fromJson(responseContent);
42-
}
43-
44-
@Override
45-
public WxMpUserList userList(String next_openid) throws WxErrorException {
46-
String url = API_URL_PREFIX + "/get";
47-
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, next_openid == null ? null : "next_openid=" + next_openid);
48-
return WxMpUserList.fromJson(responseContent);
49-
}
50-
51-
@Override
52-
public List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException {
53-
return userInfoList(new WxMpUserQuery(openidList));
54-
}
55-
56-
@Override
57-
public List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException {
58-
String url = API_URL_PREFIX + "/info/batchget";
59-
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, userQuery.toJsonString());
60-
return WxMpUser.fromJsonList(responseContent);
61-
}
20+
private static final String API_URL_PREFIX = "https://api.weixin.qq.com/cgi-bin/user";
21+
private WxMpService wxMpService;
22+
23+
public WxMpUserServiceImpl(WxMpService wxMpService) {
24+
this.wxMpService = wxMpService;
25+
}
26+
27+
@Override
28+
public void userUpdateRemark(String openid, String remark) throws WxErrorException {
29+
String url = API_URL_PREFIX + "/info/updateremark";
30+
JsonObject json = new JsonObject();
31+
json.addProperty("openid", openid);
32+
json.addProperty("remark", remark);
33+
this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString());
34+
}
35+
36+
@Override
37+
public WxMpUser userInfo(String openid, String lang) throws WxErrorException {
38+
String url = API_URL_PREFIX + "/info";
39+
lang = lang == null ? "zh_CN" : lang;
40+
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, "openid=" + openid + "&lang=" + lang);
41+
return WxMpUser.fromJson(responseContent);
42+
}
43+
44+
@Override
45+
public WxMpUserList userList(String next_openid) throws WxErrorException {
46+
String url = API_URL_PREFIX + "/get";
47+
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, next_openid == null ? null : "next_openid=" + next_openid);
48+
return WxMpUserList.fromJson(responseContent);
49+
}
50+
51+
@Override
52+
public List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException {
53+
return userInfoList(new WxMpUserQuery(openidList));
54+
}
55+
56+
@Override
57+
public List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException {
58+
String url = API_URL_PREFIX + "/info/batchget";
59+
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, userQuery.toJsonString());
60+
return WxMpUser.fromJsonList(responseContent);
61+
}
6262

6363
}

0 commit comments

Comments
 (0)