Skip to content

Commit 11ba8aa

Browse files
authored
Update AppService.java
1 parent e3d9e44 commit 11ba8aa

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

chat/src/main/java/cn/wildfire/chat/app/AppService.java

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public class AppService implements AppServiceProvider {
5454
* <br>
5555
* <br>
5656
*/
57-
// public static String http://117.72.91.163:8888/*请仔细阅读上面的注释,http 前缀不能省略*/ = "http://wildfirechat.net:8888";
58-
public static String http://117.72.91.163:8888 /*请仔细阅读上面的注释*/ = "https://app.wildfirechat.net";
57+
// public static String APP_SERVER_ADDRESS/*请仔细阅读上面的注释,http 前缀不能省略*/ = "http://wildfirechat.net:8888";
58+
public static String APP_SERVER_ADDRESS /*请仔细阅读上面的注释*/ = "http://117.72.91.163:8888";
5959

6060
private AppService() {
6161

@@ -73,7 +73,7 @@ public interface LoginCallback {
7373

7474
public void passwordLogin(String mobile, String password, LoginCallback callback) {
7575

76-
String url = http://117.72.91.163:8888 + "/login_pwd";
76+
String url = APP_SERVER_ADDRESS + "/login_pwd";
7777
Map<String, Object> params = new HashMap<>();
7878
params.put("mobile", mobile);
7979
params.put("password", password);
@@ -107,7 +107,7 @@ public void onUiFailure(int code, String msg) {
107107

108108
public void smsLogin(String phoneNumber, String authCode, LoginCallback callback) {
109109

110-
String url = http://117.72.91.163:8888 + "/login";
110+
String url = APP_SERVER_ADDRESS + "/login";
111111
Map<String, Object> params = new HashMap<>();
112112
params.put("mobile", phoneNumber);
113113
params.put("code", authCode);
@@ -152,7 +152,7 @@ public void onUiFailure(int code, String msg) {
152152

153153

154154
public void resetPassword(String mobile, String code, String password, SimpleCallback<StatusResult> callback) {
155-
String url = http://117.72.91.163:8888 + "/reset_pwd";
155+
String url = APP_SERVER_ADDRESS + "/reset_pwd";
156156
Map<String, Object> params = new HashMap<>();
157157
if (!TextUtils.isEmpty(mobile)) {
158158
params.put("mobile", mobile);
@@ -164,7 +164,7 @@ public void resetPassword(String mobile, String code, String password, SimpleCal
164164
}
165165

166166
public void changePassword(String oldPassword, String newPassword, SimpleCallback<StatusResult> callback) {
167-
String url = http://117.72.91.163:8888 + "/change_pwd";
167+
String url = APP_SERVER_ADDRESS + "/change_pwd";
168168
Map<String, Object> params = new HashMap<>();
169169
params.put("oldPassword", oldPassword);
170170
params.put("newPassword", newPassword);
@@ -181,7 +181,7 @@ public interface SendCodeCallback {
181181

182182
public void requestAuthCode(String phoneNumber, SendCodeCallback callback) {
183183

184-
String url = http://117.72.91.163:8888 + "/send_code";
184+
String url = APP_SERVER_ADDRESS + "/send_code";
185185
Map<String, Object> params = new HashMap<>();
186186
params.put("mobile", phoneNumber);
187187
OKHttpHelper.post(url, params, new SimpleCallback<StatusResult>() {
@@ -204,7 +204,7 @@ public void onUiFailure(int code, String msg) {
204204

205205
public void requestResetAuthCode(String phoneNumber, SendCodeCallback callback) {
206206

207-
String url = http://117.72.91.163:8888 + "/send_reset_code";
207+
String url = APP_SERVER_ADDRESS + "/send_reset_code";
208208
Map<String, Object> params = new HashMap<>();
209209
if (!TextUtils.isEmpty(phoneNumber)) {
210210
params.put("mobile", phoneNumber);
@@ -234,7 +234,7 @@ public interface ScanPCCallback {
234234
}
235235

236236
public void scanPCLogin(String token, ScanPCCallback callback) {
237-
String url = http://117.72.91.163:8888 + "/scan_pc";
237+
String url = APP_SERVER_ADDRESS + "/scan_pc";
238238
url += "/" + token;
239239
OKHttpHelper.post(url, null, new SimpleCallback<PCSession>() {
240240
@Override
@@ -260,7 +260,7 @@ public interface PCLoginCallback {
260260
}
261261

262262
public void confirmPCLogin(String token, String userId, PCLoginCallback callback) {
263-
String url = http://117.72.91.163:8888 + "/confirm_pc";
263+
String url = APP_SERVER_ADDRESS + "/confirm_pc";
264264

265265
Map<String, Object> params = new HashMap<>(3);
266266
params.put("user_id", userId);
@@ -284,7 +284,7 @@ public void onUiFailure(int code, String msg) {
284284
}
285285

286286
public void cancelPCLogin(String token, PCLoginCallback callback) {
287-
String url = http://117.72.91.163:8888 + "/cancel_pc";
287+
String url = APP_SERVER_ADDRESS + "/cancel_pc";
288288

289289
Map<String, Object> params = new HashMap<>(3);
290290
params.put("token", token);
@@ -309,7 +309,7 @@ public void onUiFailure(int code, String msg) {
309309
@Override
310310
public void getGroupAnnouncement(String groupId, AppServiceProvider.GetGroupAnnouncementCallback callback) {
311311
//从SP中获取到历史数据callback回去,然后再从网络刷新
312-
String url = http://117.72.91.163:8888 + "/get_group_announcement";
312+
String url = APP_SERVER_ADDRESS + "/get_group_announcement";
313313

314314
Map<String, Object> params = new HashMap<>(2);
315315
params.put("groupId", groupId);
@@ -330,7 +330,7 @@ public void onUiFailure(int code, String msg) {
330330
@Override
331331
public void updateGroupAnnouncement(String groupId, String announcement, AppServiceProvider.UpdateGroupAnnouncementCallback callback) {
332332
//更新到应用服务,再保存到本地SP中
333-
String url = http://117.72.91.163:8888 + "/put_group_announcement";
333+
String url = APP_SERVER_ADDRESS + "/put_group_announcement";
334334

335335
Map<String, Object> params = new HashMap<>(2);
336336
params.put("groupId", groupId);
@@ -377,7 +377,7 @@ public void uploadLog(SimpleCallback<String> callback) {
377377
SharedPreferences sp = context.getSharedPreferences("log_history", Context.MODE_PRIVATE);
378378

379379
String userId = ChatManager.Instance().getUserId();
380-
String url = http://117.72.91.163:8888 + "/logs/" + userId + "/upload";
380+
String url = APP_SERVER_ADDRESS + "/logs/" + userId + "/upload";
381381

382382
int toUploadCount = 0;
383383
Collections.sort(filePaths);
@@ -417,7 +417,7 @@ public void onUiFailure(int code, String msg) {
417417

418418
@Override
419419
public void changeName(String newName, SimpleCallback<Void> callback) {
420-
String url = http://117.72.91.163:8888 + "/change_name";
420+
String url = APP_SERVER_ADDRESS + "/change_name";
421421

422422
Map<String, Object> params = new HashMap<>(2);
423423
params.put("newName", newName);
@@ -440,7 +440,7 @@ public void getFavoriteItems(int startId, int count, GetFavoriteItemCallback cal
440440
return;
441441
}
442442

443-
String url = http://117.72.91.163:8888 + "/fav/list";
443+
String url = APP_SERVER_ADDRESS + "/fav/list";
444444
Map<String, Object> params = new HashMap<>();
445445
params.put("id", startId);
446446
params.put("count", count);
@@ -490,7 +490,7 @@ public void onUiFailure(int code, String msg) {
490490

491491
@Override
492492
public void addFavoriteItem(FavoriteItem item, SimpleCallback<Void> callback) {
493-
String url = http://117.72.91.163:8888 + "/fav/add";
493+
String url = APP_SERVER_ADDRESS + "/fav/add";
494494
Map<String, Object> params = new HashMap<>();
495495
params.put("messageUid", item.getMessageUid());
496496
params.put("type", item.getFavType());
@@ -509,20 +509,20 @@ public void addFavoriteItem(FavoriteItem item, SimpleCallback<Void> callback) {
509509

510510
@Override
511511
public void removeFavoriteItem(int favId, SimpleCallback<Void> callback) {
512-
String url = http://117.72.91.163:8888 + "/fav/del/" + favId;
512+
String url = APP_SERVER_ADDRESS + "/fav/del/" + favId;
513513
OKHttpHelper.post(url, null, callback);
514514
}
515515

516516
public static void validateConfig(Context context) {
517517
if (TextUtils.isEmpty(Config.IM_SERVER_HOST)
518518
|| Config.IM_SERVER_HOST.startsWith("http")
519519
|| Config.IM_SERVER_HOST.contains(":")
520-
|| TextUtils.isEmpty(http://117.72.91.163:8888)
521-
|| (!http://117.72.91.163:8888.startsWith("http") && !http://117.72.91.163:8888.startsWith("https"))
520+
|| TextUtils.isEmpty(APP_SERVER_ADDRESS)
521+
|| (!APP_SERVER_ADDRESS.startsWith("http") && !APP_SERVER_ADDRESS.startsWith("https"))
522522
|| Config.IM_SERVER_HOST.equals("127.0.0.1")
523-
|| http://117.72.91.163:8888.contains("127.0.0.1")
524-
|| (!Config.IM_SERVER_HOST.contains("wildfirechat.net") && http://117.72.91.163:8888.contains("wildfirechat.net"))
525-
|| (Config.IM_SERVER_HOST.contains("wildfirechat.net") && !http://117.72.91.163:8888.contains("wildfirechat.net"))
523+
|| APP_SERVER_ADDRESS.contains("127.0.0.1")
524+
|| (!Config.IM_SERVER_HOST.contains("wildfirechat.net") && APP_SERVER_ADDRESS.contains("wildfirechat.net"))
525+
|| (Config.IM_SERVER_HOST.contains("wildfirechat.net") && !APP_SERVER_ADDRESS.contains("wildfirechat.net"))
526526
) {
527527
Toast.makeText(context, "配置错误,请检查配置,应用即将关闭...", Toast.LENGTH_LONG).show();
528528
new Handler().postDelayed(() -> {
@@ -551,7 +551,7 @@ public void getMyPrivateConferenceId(GeneralCallback2 callback) {
551551
if (callback == null) {
552552
return;
553553
}
554-
String url = http://117.72.91.163:8888 + "/conference/get_my_id";
554+
String url = APP_SERVER_ADDRESS + "/conference/get_my_id";
555555
OKHttpHelper.post(url, null, new SimpleCallback<String>() {
556556

557557
@Override
@@ -578,7 +578,7 @@ public void onUiFailure(int code, String msg) {
578578

579579
@Override
580580
public void createConference(ConferenceInfo info, GeneralCallback2 callback) {
581-
String url = http://117.72.91.163:8888 + "/conference/create";
581+
String url = APP_SERVER_ADDRESS + "/conference/create";
582582
OKHttpHelper.post(url, info, new SimpleCallback<String>() {
583583
@Override
584584
public void onUiSuccess(String response) {
@@ -607,7 +607,7 @@ public void queryConferenceInfo(String conferenceId, String password, QueryConfe
607607
if (callback == null) {
608608
return;
609609
}
610-
String url = http://117.72.91.163:8888 + "/conference/info";
610+
String url = APP_SERVER_ADDRESS + "/conference/info";
611611
Map<String, String> map = new HashMap<>();
612612
map.put("conferenceId", conferenceId);
613613
if (!TextUtils.isEmpty(password)) {
@@ -629,7 +629,7 @@ public void onUiFailure(int code, String msg) {
629629

630630
@Override
631631
public void destroyConference(String conferenceId, GeneralCallback callback) {
632-
String url = http://117.72.91.163:8888 + "/conference/destroy/" + conferenceId;
632+
String url = APP_SERVER_ADDRESS + "/conference/destroy/" + conferenceId;
633633
OKHttpHelper.post(url, null, new SimpleCallback<StatusResult>() {
634634

635635
@Override
@@ -650,7 +650,7 @@ public void onUiFailure(int code, String msg) {
650650

651651
@Override
652652
public void favConference(String conferenceId, GeneralCallback callback) {
653-
String url = http://117.72.91.163:8888 + "/conference/fav/" + conferenceId;
653+
String url = APP_SERVER_ADDRESS + "/conference/fav/" + conferenceId;
654654
OKHttpHelper.post(url, null, new SimpleCallback<StatusResult>() {
655655
@Override
656656
public void onUiSuccess(StatusResult statusResult) {
@@ -675,7 +675,7 @@ public void onUiFailure(int code, String msg) {
675675

676676
@Override
677677
public void unfavConference(String conferenceId, GeneralCallback callback) {
678-
String url = http://117.72.91.163:8888 + "/conference/unfav/" + conferenceId;
678+
String url = APP_SERVER_ADDRESS + "/conference/unfav/" + conferenceId;
679679
OKHttpHelper.post(url, null, new SimpleCallback<StatusResult>() {
680680
@Override
681681
public void onUiSuccess(StatusResult statusResult) {
@@ -699,7 +699,7 @@ public void onUiFailure(int code, String msg) {
699699

700700
@Override
701701
public void isFavConference(String conferenceId, BooleanCallback callback) {
702-
String url = http://117.72.91.163:8888 + "/conference/is_fav/" + conferenceId;
702+
String url = APP_SERVER_ADDRESS + "/conference/is_fav/" + conferenceId;
703703
OKHttpHelper.post(url, null, new SimpleCallback<StatusResult>() {
704704
@Override
705705
public void onUiSuccess(StatusResult statusResult) {
@@ -725,7 +725,7 @@ public void onUiFailure(int code, String msg) {
725725

726726
@Override
727727
public void getFavConferences(FavConferenceCallback callback) {
728-
String url = http://117.72.91.163:8888 + "/conference/fav_conferences";
728+
String url = APP_SERVER_ADDRESS + "/conference/fav_conferences";
729729
OKHttpHelper.post(url, null, new SimpleCallback<List<ConferenceInfo>>() {
730730
@Override
731731
public void onUiSuccess(List<ConferenceInfo> favConferences) {
@@ -745,7 +745,7 @@ public void onUiFailure(int code, String msg) {
745745

746746
@Override
747747
public void updateConference(ConferenceInfo conferenceInfo, GeneralCallback callback) {
748-
String url = http://117.72.91.163:8888 + "/conference/put_info";
748+
String url = APP_SERVER_ADDRESS + "/conference/put_info";
749749
OKHttpHelper.post(url, conferenceInfo, new SimpleCallback<StatusResult>() {
750750
@Override
751751
public void onUiSuccess(StatusResult statusResult) {
@@ -765,7 +765,7 @@ public void onUiFailure(int code, String msg) {
765765

766766
@Override
767767
public void recordConference(String conferenceId, boolean record, GeneralCallback callback) {
768-
String url = http://117.72.91.163:8888 + "/conference/recording/" + conferenceId;
768+
String url = APP_SERVER_ADDRESS + "/conference/recording/" + conferenceId;
769769
Map<String, Boolean> params = new HashMap<>();
770770
params.put("recording", record);
771771
OKHttpHelper.post(url, params, new SimpleCallback<StatusResult>() {
@@ -787,7 +787,7 @@ public void onUiFailure(int code, String msg) {
787787

788788
@Override
789789
public void setConferenceFocusUserId(String conferenceId, String userId, GeneralCallback callback) {
790-
String url = http://117.72.91.163:8888 + "/conference/focus/" + conferenceId;
790+
String url = APP_SERVER_ADDRESS + "/conference/focus/" + conferenceId;
791791
Map<String, String> params = new HashMap<>();
792792
params.put("userId", TextUtils.isEmpty(userId) ? "" : userId);
793793
OKHttpHelper.post(url, params, new SimpleCallback<StatusResult>() {

0 commit comments

Comments
 (0)