修复app的bug
This commit is contained in:
parent
e3df41657a
commit
5b0c786f1f
167
0-待完成接入接口.md
Normal file
167
0-待完成接入接口.md
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
# 待完成接入接口清单
|
||||||
|
|
||||||
|
> 更新时间: 2024-12-30
|
||||||
|
|
||||||
|
## 📊 总体情况
|
||||||
|
|
||||||
|
| 类别 | 后端接口数 | Android已接入 | 待接入 |
|
||||||
|
|------|-----------|--------------|--------|
|
||||||
|
| 总计 | 131 | ~85 | ~46 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ 已接入模块 (无需处理)
|
||||||
|
|
||||||
|
| 模块 | 接口数 | 状态 |
|
||||||
|
|------|--------|------|
|
||||||
|
| 用户认证 | 4 | ✅ 全部接入 |
|
||||||
|
| 用户信息 | 2 | ✅ 全部接入 |
|
||||||
|
| 直播间 | 6 | ✅ 全部接入 |
|
||||||
|
| 直播弹幕 | 2 | ✅ 全部接入 |
|
||||||
|
| 礼物打赏 | 5 | ✅ 全部接入 |
|
||||||
|
| 私聊会话 | 8 | ✅ 全部接入 |
|
||||||
|
| 好友管理 | 9 | ✅ 全部接入 |
|
||||||
|
| 文件上传 | 2 | ✅ 全部接入 |
|
||||||
|
| 在线状态 | 5 | ✅ 全部接入 |
|
||||||
|
| 离线消息 | 3 | ✅ 全部接入 |
|
||||||
|
| 消息表情回应 | 4 | ✅ 全部接入 |
|
||||||
|
| 关注功能 | 7 | ✅ 全部接入 |
|
||||||
|
| 作品管理 | 13 | ✅ 全部接入 |
|
||||||
|
| 搜索功能 | 9 | ✅ 全部接入 |
|
||||||
|
| 支付集成 | 4 | ✅ 全部接入 |
|
||||||
|
| 通话功能 | 10 | ✅ 全部接入 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ❌ 待接入模块
|
||||||
|
|
||||||
|
### 1. 群组管理 (10个接口) - 🔴 高优先级
|
||||||
|
|
||||||
|
后端已完成,Android端未定义接口。
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 创建群组 | `POST /api/front/groups/create` | 创建新群组 |
|
||||||
|
| 群组列表 | `GET /api/front/groups/list` | 获取我的群组 |
|
||||||
|
| 群组详情 | `GET /api/front/groups/{groupId}` | 获取群组信息 |
|
||||||
|
| 更新群组 | `PUT /api/front/groups/{groupId}` | 修改群组信息 |
|
||||||
|
| 解散群组 | `DELETE /api/front/groups/{groupId}` | 解散群组 |
|
||||||
|
| 添加成员 | `POST /api/front/groups/{groupId}/members` | 邀请成员 |
|
||||||
|
| 移除成员 | `DELETE /api/front/groups/{groupId}/members/{userId}` | 踢出成员 |
|
||||||
|
| 成员列表 | `GET /api/front/groups/{groupId}/members` | 获取成员 |
|
||||||
|
| 退出群组 | `POST /api/front/groups/{groupId}/leave` | 主动退群 |
|
||||||
|
| 转让群主 | `POST /api/front/groups/{groupId}/transfer` | 转让群主 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2. 群组消息 (4个接口) - 🔴 高优先级
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 发送群消息 | `POST /api/front/groups/{groupId}/messages` | 发送消息 |
|
||||||
|
| 群消息历史 | `GET /api/front/groups/{groupId}/messages` | 获取历史 |
|
||||||
|
| 撤回消息 | `DELETE /api/front/groups/{groupId}/messages/{messageId}` | 撤回消息 |
|
||||||
|
| 转发消息 | `POST /api/front/groups/{groupId}/messages/{messageId}/forward` | 转发消息 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3. 消息搜索 (3个接口) - 🟡 中优先级
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 搜索会话 | `GET /api/front/messages/search/conversations` | 搜索会话 |
|
||||||
|
| 搜索消息 | `GET /api/front/messages/search/messages` | 搜索消息内容 |
|
||||||
|
| 全局搜索 | `GET /api/front/messages/search/global` | 全局搜索 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4. 评论功能 (8个接口) - 🟡 中优先级
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 发布评论 | `POST /api/front/works/comment/publish` | 发布评论 |
|
||||||
|
| 评论列表 | `GET /api/front/works/comment/list/{worksId}` | 获取评论 |
|
||||||
|
| 点赞评论 | `POST /api/front/works/comment/like/{commentId}` | 点赞 |
|
||||||
|
| 取消点赞 | `POST /api/front/works/comment/unlike/{commentId}` | 取消点赞 |
|
||||||
|
| 删除评论 | `POST /api/front/works/comment/delete/{commentId}` | 删除评论 |
|
||||||
|
| 回复列表 | `GET /api/front/works/comment/reply/list/{commentId}` | 获取回复 |
|
||||||
|
| 评论详情 | `GET /api/front/works/comment/detail/{commentId}` | 评论详情 |
|
||||||
|
| 检查点赞 | `GET /api/front/works/comment/check-liked/{commentId}` | 检查状态 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 5. 通知推送 (9个接口) - 🟡 中优先级
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 通知列表 | `GET /api/front/notification/list` | 获取通知 |
|
||||||
|
| 未读数量 | `GET /api/front/notification/unread-count` | 未读数 |
|
||||||
|
| 标记已读 | `POST /api/front/notification/mark-read/{id}` | 单条已读 |
|
||||||
|
| 全部已读 | `POST /api/front/notification/mark-all-read` | 全部已读 |
|
||||||
|
| 注册FCM | `POST /api/front/notification/fcm/register` | 注册推送 |
|
||||||
|
| 移除FCM | `POST /api/front/notification/fcm/remove` | 移除推送 |
|
||||||
|
| 删除通知 | `DELETE /api/front/notification/{id}` | 删除单条 |
|
||||||
|
| 清空通知 | `DELETE /api/front/notification/clear-all` | 清空全部 |
|
||||||
|
| 按类型统计 | `GET /api/front/notification/unread-count-by-type` | 分类统计 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 6. 分类管理 (7个接口) - 🟢 低优先级
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 直播间分类 | `GET /api/front/category/live-room` | 直播分类 |
|
||||||
|
| 作品分类 | `GET /api/front/category/work` | 作品分类 |
|
||||||
|
| 分类列表 | `GET /api/front/category/list` | 全部分类 |
|
||||||
|
| 分类详情 | `GET /api/front/category/{id}` | 分类详情 |
|
||||||
|
| 分类统计 | `GET /api/front/category/statistics` | 统计数据 |
|
||||||
|
| 热门分类 | `GET /api/front/category/hot` | 热门分类 |
|
||||||
|
| 子分类 | `GET /api/front/category/{parentId}/children` | 子分类 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 7. 文件上传补充 (3个接口) - 🟢 低优先级
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 通用图片上传 | `POST /api/upload/image` | 通用图片 |
|
||||||
|
| 通用文件上传 | `POST /api/upload/file` | 通用文件 |
|
||||||
|
| 语音上传 | `POST /api/upload/chat/voice` | 语音消息 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 8. 直播间补充 (4个接口) - 🟢 低优先级
|
||||||
|
|
||||||
|
| 接口 | 路径 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| 开始直播 | `POST /api/front/live/room/{id}/start` | 开播 |
|
||||||
|
| 结束直播 | `POST /api/front/live/room/{id}/stop` | 停播 |
|
||||||
|
| 观众列表 | `GET /api/rooms/{roomId}/viewers` | 观众列表 |
|
||||||
|
| 手动广播人数 | `POST /api/live/online/broadcast/{roomId}` | 广播人数 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 接入优先级建议
|
||||||
|
|
||||||
|
### 第一优先级 (核心社交)
|
||||||
|
1. **群组管理** - 10个接口
|
||||||
|
2. **群组消息** - 4个接口
|
||||||
|
|
||||||
|
### 第二优先级 (内容互动)
|
||||||
|
3. **评论功能** - 8个接口
|
||||||
|
4. **通知推送** - 9个接口
|
||||||
|
|
||||||
|
### 第三优先级 (辅助功能)
|
||||||
|
5. **消息搜索** - 3个接口
|
||||||
|
6. **分类管理** - 7个接口
|
||||||
|
7. **文件上传补充** - 3个接口
|
||||||
|
8. **直播间补充** - 4个接口
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 备注
|
||||||
|
|
||||||
|
- 后端接口已全部完成 (131个)
|
||||||
|
- Android端已接入约85个接口
|
||||||
|
- 待接入约46个接口
|
||||||
|
- 核心功能已基本完成,待接入的主要是群组和辅助功能
|
||||||
BIN
android-app/app/release-key.jks
Normal file
BIN
android-app/app/release-key.jks
Normal file
Binary file not shown.
|
|
@ -13,7 +13,7 @@ import com.example.livestreaming.databinding.ActivityFansListBinding;
|
||||||
import com.example.livestreaming.net.ApiResponse;
|
import com.example.livestreaming.net.ApiResponse;
|
||||||
import com.example.livestreaming.net.ApiService;
|
import com.example.livestreaming.net.ApiService;
|
||||||
import com.example.livestreaming.net.PageResponse;
|
import com.example.livestreaming.net.PageResponse;
|
||||||
import com.example.livestreaming.net.RetrofitClient;
|
import com.example.livestreaming.net.ApiClient;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -58,7 +58,7 @@ public class FansListActivity extends AppCompatActivity {
|
||||||
if (isLoading) return;
|
if (isLoading) return;
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<PageResponse<Map<String, Object>>>> call = apiService.getFollowersList(currentPage, 20);
|
Call<ApiResponse<PageResponse<Map<String, Object>>>> call = apiService.getFollowersList(currentPage, 20);
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<PageResponse<Map<String, Object>>>>() {
|
call.enqueue(new Callback<ApiResponse<PageResponse<Map<String, Object>>>>() {
|
||||||
|
|
@ -96,7 +96,7 @@ public class FansListActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(FansListActivity.this,
|
Toast.makeText(FansListActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "获取粉丝列表失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "获取粉丝列表失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import com.example.livestreaming.databinding.ActivityFollowingListBinding;
|
||||||
import com.example.livestreaming.net.ApiResponse;
|
import com.example.livestreaming.net.ApiResponse;
|
||||||
import com.example.livestreaming.net.ApiService;
|
import com.example.livestreaming.net.ApiService;
|
||||||
import com.example.livestreaming.net.PageResponse;
|
import com.example.livestreaming.net.PageResponse;
|
||||||
import com.example.livestreaming.net.RetrofitClient;
|
import com.example.livestreaming.net.ApiClient;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -58,7 +58,7 @@ public class FollowingListActivity extends AppCompatActivity {
|
||||||
if (isLoading) return;
|
if (isLoading) return;
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<PageResponse<Map<String, Object>>>> call = apiService.getFollowingList(currentPage, 20);
|
Call<ApiResponse<PageResponse<Map<String, Object>>>> call = apiService.getFollowingList(currentPage, 20);
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<PageResponse<Map<String, Object>>>>() {
|
call.enqueue(new Callback<ApiResponse<PageResponse<Map<String, Object>>>>() {
|
||||||
|
|
@ -94,7 +94,7 @@ public class FollowingListActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(FollowingListActivity.this,
|
Toast.makeText(FollowingListActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "获取关注列表失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "获取关注列表失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -679,7 +679,7 @@ public class ProfileActivity extends AppCompatActivity {
|
||||||
*/
|
*/
|
||||||
private void loadFollowStats() {
|
private void loadFollowStats() {
|
||||||
com.example.livestreaming.net.ApiService apiService =
|
com.example.livestreaming.net.ApiService apiService =
|
||||||
com.example.livestreaming.net.RetrofitClient.getInstance(this).getApiService();
|
com.example.livestreaming.net.ApiClient.getService(this);
|
||||||
retrofit2.Call<com.example.livestreaming.net.ApiResponse<java.util.Map<String, Object>>> call =
|
retrofit2.Call<com.example.livestreaming.net.ApiResponse<java.util.Map<String, Object>>> call =
|
||||||
apiService.getFollowStats(null); // null表示查询当前用户
|
apiService.getFollowStats(null); // null表示查询当前用户
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -638,7 +638,7 @@ public class PublishWorkActivity extends AppCompatActivity {
|
||||||
RequestBody model = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "works");
|
RequestBody model = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "works");
|
||||||
RequestBody pid = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "0");
|
RequestBody pid = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "0");
|
||||||
|
|
||||||
ApiService apiService = ApiClient.getApiService(this);
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<FileUploadResponse>> call = apiService.uploadImage(body, model, pid);
|
Call<ApiResponse<FileUploadResponse>> call = apiService.uploadImage(body, model, pid);
|
||||||
|
|
||||||
call.enqueue(new retrofit2.Callback<ApiResponse<FileUploadResponse>>() {
|
call.enqueue(new retrofit2.Callback<ApiResponse<FileUploadResponse>>() {
|
||||||
|
|
@ -649,7 +649,7 @@ public class PublishWorkActivity extends AppCompatActivity {
|
||||||
if (apiResponse.getCode() == 200 && apiResponse.getData() != null) {
|
if (apiResponse.getCode() == 200 && apiResponse.getData() != null) {
|
||||||
callback.onSuccess(apiResponse.getData().getUrl());
|
callback.onSuccess(apiResponse.getData().getUrl());
|
||||||
} else {
|
} else {
|
||||||
callback.onFailure(apiResponse.getMsg() != null ? apiResponse.getMsg() : "上传失败");
|
callback.onFailure(apiResponse.getMessage() != null ? apiResponse.getMessage() : "上传失败");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
callback.onFailure("上传失败");
|
callback.onFailure("上传失败");
|
||||||
|
|
@ -687,7 +687,7 @@ public class PublishWorkActivity extends AppCompatActivity {
|
||||||
RequestBody model = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "works");
|
RequestBody model = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "works");
|
||||||
RequestBody pid = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "0");
|
RequestBody pid = RequestBody.create(okhttp3.MediaType.parse("text/plain"), "0");
|
||||||
|
|
||||||
ApiService apiService = ApiClient.getApiService(this);
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<FileUploadResponse>> call = apiService.uploadVideo(body, model, pid);
|
Call<ApiResponse<FileUploadResponse>> call = apiService.uploadVideo(body, model, pid);
|
||||||
|
|
||||||
call.enqueue(new retrofit2.Callback<ApiResponse<FileUploadResponse>>() {
|
call.enqueue(new retrofit2.Callback<ApiResponse<FileUploadResponse>>() {
|
||||||
|
|
@ -698,7 +698,7 @@ public class PublishWorkActivity extends AppCompatActivity {
|
||||||
if (apiResponse.getCode() == 200 && apiResponse.getData() != null) {
|
if (apiResponse.getCode() == 200 && apiResponse.getData() != null) {
|
||||||
callback.onSuccess(apiResponse.getData().getUrl());
|
callback.onSuccess(apiResponse.getData().getUrl());
|
||||||
} else {
|
} else {
|
||||||
callback.onFailure(apiResponse.getMsg() != null ? apiResponse.getMsg() : "上传失败");
|
callback.onFailure(apiResponse.getMessage() != null ? apiResponse.getMessage() : "上传失败");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
callback.onFailure("上传失败");
|
callback.onFailure("上传失败");
|
||||||
|
|
@ -762,7 +762,7 @@ public class PublishWorkActivity extends AppCompatActivity {
|
||||||
request.setVideoUrl(videoUrl);
|
request.setVideoUrl(videoUrl);
|
||||||
request.setImageUrls(imageUrls);
|
request.setImageUrls(imageUrls);
|
||||||
|
|
||||||
ApiService apiService = ApiClient.getApiService(this);
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<Long>> call = apiService.publishWork(request);
|
Call<ApiResponse<Long>> call = apiService.publishWork(request);
|
||||||
|
|
||||||
call.enqueue(new retrofit2.Callback<ApiResponse<Long>>() {
|
call.enqueue(new retrofit2.Callback<ApiResponse<Long>>() {
|
||||||
|
|
@ -777,7 +777,7 @@ public class PublishWorkActivity extends AppCompatActivity {
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(PublishWorkActivity.this,
|
Toast.makeText(PublishWorkActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "发布失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "发布失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ import com.example.livestreaming.net.CreateRechargeResponse;
|
||||||
import com.example.livestreaming.net.OrderPayRequest;
|
import com.example.livestreaming.net.OrderPayRequest;
|
||||||
import com.example.livestreaming.net.OrderPayResultResponse;
|
import com.example.livestreaming.net.OrderPayResultResponse;
|
||||||
import com.example.livestreaming.net.RechargeOptionResponse;
|
import com.example.livestreaming.net.RechargeOptionResponse;
|
||||||
import com.example.livestreaming.net.RetrofitClient;
|
|
||||||
import com.example.livestreaming.net.Room;
|
import com.example.livestreaming.net.Room;
|
||||||
import com.example.livestreaming.net.StreamConfig;
|
import com.example.livestreaming.net.StreamConfig;
|
||||||
import com.example.livestreaming.ShareUtils;
|
import com.example.livestreaming.ShareUtils;
|
||||||
|
|
@ -1112,7 +1111,7 @@ public class RoomDetailActivity extends AppCompatActivity {
|
||||||
* 加载充值选项列表
|
* 加载充值选项列表
|
||||||
*/
|
*/
|
||||||
private void loadRechargeOptions(RechargeAdapter adapter, View dialogView) {
|
private void loadRechargeOptions(RechargeAdapter adapter, View dialogView) {
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<List<RechargeOptionResponse>>> call = apiService.getRechargeOptions();
|
Call<ApiResponse<List<RechargeOptionResponse>>> call = apiService.getRechargeOptions();
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<List<RechargeOptionResponse>>>() {
|
call.enqueue(new Callback<ApiResponse<List<RechargeOptionResponse>>>() {
|
||||||
|
|
@ -1135,7 +1134,7 @@ public class RoomDetailActivity extends AppCompatActivity {
|
||||||
adapter.setOptions(options);
|
adapter.setOptions(options);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(RoomDetailActivity.this,
|
Toast.makeText(RoomDetailActivity.this,
|
||||||
"加载充值选项失败: " + apiResponse.getMsg(),
|
"加载充值选项失败: " + apiResponse.getMessage(),
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
// 使用默认选项
|
// 使用默认选项
|
||||||
setDefaultRechargeOptions(adapter);
|
setDefaultRechargeOptions(adapter);
|
||||||
|
|
@ -1178,7 +1177,7 @@ public class RoomDetailActivity extends AppCompatActivity {
|
||||||
* 创建充值订单
|
* 创建充值订单
|
||||||
*/
|
*/
|
||||||
private void createRechargeOrder(RechargeOption selectedOption, androidx.appcompat.app.AlertDialog rechargeDialog) {
|
private void createRechargeOrder(RechargeOption selectedOption, androidx.appcompat.app.AlertDialog rechargeDialog) {
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
|
|
||||||
CreateRechargeRequest request = new CreateRechargeRequest(
|
CreateRechargeRequest request = new CreateRechargeRequest(
|
||||||
Integer.parseInt(selectedOption.getId()),
|
Integer.parseInt(selectedOption.getId()),
|
||||||
|
|
@ -1203,7 +1202,7 @@ public class RoomDetailActivity extends AppCompatActivity {
|
||||||
showPaymentMethodDialog(orderId, selectedOption, rechargeDialog);
|
showPaymentMethodDialog(orderId, selectedOption, rechargeDialog);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(RoomDetailActivity.this,
|
Toast.makeText(RoomDetailActivity.this,
|
||||||
"创建充值订单失败: " + apiResponse.getMsg(),
|
"创建充值订单失败: " + apiResponse.getMessage(),
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1264,10 +1263,10 @@ public class RoomDetailActivity extends AppCompatActivity {
|
||||||
*/
|
*/
|
||||||
private void processPayment(String orderId, String payType, String payChannel,
|
private void processPayment(String orderId, String payType, String payChannel,
|
||||||
RechargeOption selectedOption, androidx.appcompat.app.AlertDialog rechargeDialog) {
|
RechargeOption selectedOption, androidx.appcompat.app.AlertDialog rechargeDialog) {
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
|
|
||||||
OrderPayRequest payRequest = new OrderPayRequest(orderId, payType, payChannel);
|
OrderPayRequest payRequest = new OrderPayRequest(orderId, payType, payChannel);
|
||||||
Call<ApiResponse<OrderPayResultResponse>> call = apiService.payment(payRequest);
|
Call<ApiResponse<OrderPayResultResponse>> call = apiService.processPayment(payRequest);
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<OrderPayResultResponse>>() {
|
call.enqueue(new Callback<ApiResponse<OrderPayResultResponse>>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1293,7 +1292,7 @@ public class RoomDetailActivity extends AppCompatActivity {
|
||||||
simulateRechargeSuccess(selectedOption, rechargeDialog);
|
simulateRechargeSuccess(selectedOption, rechargeDialog);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(RoomDetailActivity.this,
|
Toast.makeText(RoomDetailActivity.this,
|
||||||
"支付失败: " + apiResponse.getMsg(),
|
"支付失败: " + apiResponse.getMessage(),
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import com.example.livestreaming.net.ApiResponse;
|
||||||
import com.example.livestreaming.net.ApiService;
|
import com.example.livestreaming.net.ApiService;
|
||||||
import com.example.livestreaming.net.HotSearchResponse;
|
import com.example.livestreaming.net.HotSearchResponse;
|
||||||
import com.example.livestreaming.net.PageResponse;
|
import com.example.livestreaming.net.PageResponse;
|
||||||
import com.example.livestreaming.net.RetrofitClient;
|
import com.example.livestreaming.net.ApiClient;
|
||||||
import com.example.livestreaming.net.Room;
|
import com.example.livestreaming.net.Room;
|
||||||
import com.example.livestreaming.net.SearchHistoryResponse;
|
import com.example.livestreaming.net.SearchHistoryResponse;
|
||||||
|
|
||||||
|
|
@ -151,7 +151,7 @@ public class SearchActivity extends AppCompatActivity {
|
||||||
|
|
||||||
Log.d(TAG, "执行搜索: " + keyword);
|
Log.d(TAG, "执行搜索: " + keyword);
|
||||||
|
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<PageResponse<Map<String, Object>>>> call =
|
Call<ApiResponse<PageResponse<Map<String, Object>>>> call =
|
||||||
apiService.searchLiveRooms(keyword, null, null, 1, 20);
|
apiService.searchLiveRooms(keyword, null, null, 1, 20);
|
||||||
|
|
||||||
|
|
@ -191,9 +191,9 @@ public class SearchActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(SearchActivity.this,
|
Toast.makeText(SearchActivity.this,
|
||||||
"搜索失败: " + apiResponse.getMsg(),
|
"搜索失败: " + apiResponse.getMessage(),
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
Log.e(TAG, "搜索失败: " + apiResponse.getMsg());
|
Log.e(TAG, "搜索失败: " + apiResponse.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(SearchActivity.this,
|
Toast.makeText(SearchActivity.this,
|
||||||
|
|
@ -253,7 +253,7 @@ public class SearchActivity extends AppCompatActivity {
|
||||||
private void loadHotSearch() {
|
private void loadHotSearch() {
|
||||||
Log.d(TAG, "加载热门搜索");
|
Log.d(TAG, "加载热门搜索");
|
||||||
|
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<List<HotSearchResponse>>> call = apiService.getHotSearch(2, 10); // 2-直播间
|
Call<ApiResponse<List<HotSearchResponse>>> call = apiService.getHotSearch(2, 10); // 2-直播间
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<List<HotSearchResponse>>>() {
|
call.enqueue(new Callback<ApiResponse<List<HotSearchResponse>>>() {
|
||||||
|
|
@ -282,7 +282,7 @@ public class SearchActivity extends AppCompatActivity {
|
||||||
* 加载搜索建议(可选功能)
|
* 加载搜索建议(可选功能)
|
||||||
*/
|
*/
|
||||||
private void loadSearchSuggestions(String keyword) {
|
private void loadSearchSuggestions(String keyword) {
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<List<String>>> call = apiService.getSearchSuggestions(keyword, 2, 10); // 2-直播间
|
Call<ApiResponse<List<String>>> call = apiService.getSearchSuggestions(keyword, 2, 10); // 2-直播间
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<List<String>>>() {
|
call.enqueue(new Callback<ApiResponse<List<String>>>() {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import com.example.livestreaming.databinding.ActivityUserProfileReadOnlyBinding;
|
import com.example.livestreaming.databinding.ActivityUserProfileReadOnlyBinding;
|
||||||
import com.example.livestreaming.net.ApiResponse;
|
import com.example.livestreaming.net.ApiResponse;
|
||||||
import com.example.livestreaming.net.ApiService;
|
import com.example.livestreaming.net.ApiService;
|
||||||
import com.example.livestreaming.net.RetrofitClient;
|
import com.example.livestreaming.net.ApiClient;
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -101,7 +101,7 @@ public class UserProfileReadOnlyActivity extends AppCompatActivity {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int userId = Integer.parseInt(currentUserId);
|
int userId = Integer.parseInt(currentUserId);
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<Map<String, Object>>> call = apiService.checkFollowStatus(userId);
|
Call<ApiResponse<Map<String, Object>>> call = apiService.checkFollowStatus(userId);
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<Map<String, Object>>>() {
|
call.enqueue(new Callback<ApiResponse<Map<String, Object>>>() {
|
||||||
|
|
@ -137,7 +137,7 @@ public class UserProfileReadOnlyActivity extends AppCompatActivity {
|
||||||
Map<String, Object> requestBody = new HashMap<>();
|
Map<String, Object> requestBody = new HashMap<>();
|
||||||
requestBody.put("userId", userId);
|
requestBody.put("userId", userId);
|
||||||
|
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<Map<String, Object>>> call = apiService.followUser(requestBody);
|
Call<ApiResponse<Map<String, Object>>> call = apiService.followUser(requestBody);
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<Map<String, Object>>>() {
|
call.enqueue(new Callback<ApiResponse<Map<String, Object>>>() {
|
||||||
|
|
@ -152,7 +152,7 @@ public class UserProfileReadOnlyActivity extends AppCompatActivity {
|
||||||
Toast.makeText(UserProfileReadOnlyActivity.this, "关注成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(UserProfileReadOnlyActivity.this, "关注成功", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(UserProfileReadOnlyActivity.this,
|
Toast.makeText(UserProfileReadOnlyActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "关注失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "关注失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -179,7 +179,7 @@ public class UserProfileReadOnlyActivity extends AppCompatActivity {
|
||||||
Map<String, Object> requestBody = new HashMap<>();
|
Map<String, Object> requestBody = new HashMap<>();
|
||||||
requestBody.put("userId", userId);
|
requestBody.put("userId", userId);
|
||||||
|
|
||||||
ApiService apiService = RetrofitClient.getInstance(this).getApiService();
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<Map<String, Object>>> call = apiService.unfollowUser(requestBody);
|
Call<ApiResponse<Map<String, Object>>> call = apiService.unfollowUser(requestBody);
|
||||||
|
|
||||||
call.enqueue(new Callback<ApiResponse<Map<String, Object>>>() {
|
call.enqueue(new Callback<ApiResponse<Map<String, Object>>>() {
|
||||||
|
|
@ -194,7 +194,7 @@ public class UserProfileReadOnlyActivity extends AppCompatActivity {
|
||||||
Toast.makeText(UserProfileReadOnlyActivity.this, "取消关注成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(UserProfileReadOnlyActivity.this, "取消关注成功", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(UserProfileReadOnlyActivity.this,
|
Toast.makeText(UserProfileReadOnlyActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "取消关注失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "取消关注失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -224,17 +224,6 @@ public class UserProfileReadOnlyActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateFollowButton() {
|
|
||||||
if (binding == null) return;
|
|
||||||
if (isFollowing) {
|
|
||||||
binding.addFriendButton.setText("已关注");
|
|
||||||
binding.addFriendButton.setAlpha(0.7f);
|
|
||||||
} else {
|
|
||||||
binding.addFriendButton.setText("关注");
|
|
||||||
binding.addFriendButton.setAlpha(1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupTabsAndWorks() {
|
private void setupTabsAndWorks() {
|
||||||
if (binding == null) return;
|
if (binding == null) return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
long worksId = Long.parseLong(workItem.getId());
|
long worksId = Long.parseLong(workItem.getId());
|
||||||
ApiService apiService = ApiClient.getApiService(this);
|
ApiService apiService = ApiClient.getService(this);
|
||||||
|
|
||||||
Call<ApiResponse<Boolean>> call;
|
Call<ApiResponse<Boolean>> call;
|
||||||
if (isLiked) {
|
if (isLiked) {
|
||||||
|
|
@ -480,7 +480,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
workItem.setLikeCount(oldCount);
|
workItem.setLikeCount(oldCount);
|
||||||
updateLikeButton();
|
updateLikeButton();
|
||||||
Toast.makeText(WorkDetailActivity.this,
|
Toast.makeText(WorkDetailActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "操作失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "操作失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -514,7 +514,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
long worksId = Long.parseLong(workItem.getId());
|
long worksId = Long.parseLong(workItem.getId());
|
||||||
ApiService apiService = ApiClient.getApiService(this);
|
ApiService apiService = ApiClient.getService(this);
|
||||||
|
|
||||||
Call<ApiResponse<Boolean>> call;
|
Call<ApiResponse<Boolean>> call;
|
||||||
if (isFavorited) {
|
if (isFavorited) {
|
||||||
|
|
@ -544,7 +544,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
isFavorited = oldFavorited;
|
isFavorited = oldFavorited;
|
||||||
updateFavoriteButton();
|
updateFavoriteButton();
|
||||||
Toast.makeText(WorkDetailActivity.this,
|
Toast.makeText(WorkDetailActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "操作失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "操作失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -699,7 +699,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
long worksId = Long.parseLong(workItem.getId());
|
long worksId = Long.parseLong(workItem.getId());
|
||||||
ApiService apiService = ApiClient.getApiService(this);
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<Boolean>> call = apiService.deleteWork(worksId);
|
Call<ApiResponse<Boolean>> call = apiService.deleteWork(worksId);
|
||||||
|
|
||||||
call.enqueue(new retrofit2.Callback<ApiResponse<Boolean>>() {
|
call.enqueue(new retrofit2.Callback<ApiResponse<Boolean>>() {
|
||||||
|
|
@ -712,7 +712,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(WorkDetailActivity.this,
|
Toast.makeText(WorkDetailActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "删除失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "删除失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -787,7 +787,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
try {
|
try {
|
||||||
long worksId = Long.parseLong(workId);
|
long worksId = Long.parseLong(workId);
|
||||||
|
|
||||||
ApiService apiService = ApiClient.getApiService(this);
|
ApiService apiService = ApiClient.getService(this);
|
||||||
Call<ApiResponse<WorksResponse>> call = apiService.getWorkDetail(worksId);
|
Call<ApiResponse<WorksResponse>> call = apiService.getWorkDetail(worksId);
|
||||||
|
|
||||||
call.enqueue(new retrofit2.Callback<ApiResponse<WorksResponse>>() {
|
call.enqueue(new retrofit2.Callback<ApiResponse<WorksResponse>>() {
|
||||||
|
|
@ -813,7 +813,7 @@ public class WorkDetailActivity extends AppCompatActivity {
|
||||||
setupActionButton();
|
setupActionButton();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(WorkDetailActivity.this,
|
Toast.makeText(WorkDetailActivity.this,
|
||||||
apiResponse.getMsg() != null ? apiResponse.getMsg() : "获取作品详情失败",
|
apiResponse.getMessage() != null ? apiResponse.getMessage() : "获取作品详情失败",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -349,15 +349,10 @@ public interface ApiService {
|
||||||
|
|
||||||
// ==================== 支付集成 ====================
|
// ==================== 支付集成 ====================
|
||||||
|
|
||||||
@GET("api/front/gift/recharge/options")
|
|
||||||
Call<ApiResponse<List<RechargeOptionResponse>>> getRechargeOptions();
|
|
||||||
|
|
||||||
@POST("api/front/gift/recharge/create")
|
|
||||||
Call<ApiResponse<CreateRechargeResponse>> createRecharge(@Body CreateRechargeRequest body);
|
|
||||||
|
|
||||||
@GET("api/front/pay/alipay/queryPayResult")
|
@GET("api/front/pay/alipay/queryPayResult")
|
||||||
Call<ApiResponse<Boolean>> queryAliPayResult(@Query("orderNo") String orderNo);
|
Call<ApiResponse<Boolean>> queryAliPayResult(@Query("orderNo") String orderNo);
|
||||||
|
|
||||||
@POST("api/front/pay/payment")
|
@POST("api/front/pay/payment")
|
||||||
Call<ApiResponse<OrderPayResultResponse>> payment(@Body OrderPayRequest body);
|
Call<ApiResponse<OrderPayResultResponse>> processPayment(@Body OrderPayRequest body);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user