新增关注和粉丝列表

- 新增关注和粉丝列表页面
- 新增关注和粉丝列表ViewModel
- 更新UserService以支持获取关注和粉丝列表

- 更新RiderProAPI以支持获取关注和粉丝列表
- 更新Profile页面以支持跳转到关注和粉丝列表页面
- 更新Navi以支持关注和粉丝列表页面导航
- 更新UserInformationFollowers和UserInformationFollowing以支持跳转到关注和粉丝列表页面
- 更新MyProfileViewModel
以支持更新用户资料横幅
This commit is contained in:
2024-09-06 01:55:12 +08:00
parent 37dcd19227
commit e936f9cb77
12 changed files with 412 additions and 46 deletions

View File

@@ -36,12 +36,16 @@ interface UserService {
* @param pageSize 分页大小
* @param page 页码
* @param nickname 昵称搜索
* @param followerId 粉丝ID,账号粉丝
* @param followingId 关注ID,账号关注
* @return 用户列表
*/
suspend fun getUsers(
pageSize: Int = 20,
page: Int = 1,
nickname: String? = null
nickname: String? = null,
followerId: Int? = null,
followingId: Int? = null
): ListContainer<AccountProfileEntity>
}
@@ -66,15 +70,23 @@ class UserServiceImpl : UserService {
override suspend fun getUsers(
pageSize: Int,
page: Int,
nickname: String?
nickname: String?,
followerId: Int?,
followingId: Int?
): ListContainer<AccountProfileEntity> {
val resp = ApiClient.api.getUsers(page, pageSize, nickname)
val resp = ApiClient.api.getUsers(
page = page,
pageSize = pageSize,
search = nickname,
followerId = followerId,
followingId = followingId
)
val body = resp.body() ?: throw ServiceException("Failed to get account")
return ListContainer<AccountProfileEntity>(
list = body.list.map { it.toAccountProfileEntity() },
page = body.page,
total = body.total,
pageSize = body.pageSize
pageSize = body.pageSize,
)
}
}

View File

@@ -85,6 +85,7 @@ data class RegisterMessageChannelRequestBody(
@SerializedName("identifier")
val identifier: String,
)
interface RiderProAPI {
@POST("register")
suspend fun register(@Body body: RegisterRequestBody): Response<Unit>
@@ -243,6 +244,8 @@ interface RiderProAPI {
@Query("page") page: Int = 1,
@Query("pageSize") pageSize: Int = 20,
@Query("nickname") search: String? = null,
@Query("followerId") followerId: Int? = null,
@Query("followingId") followingId: Int? = null,
): Response<ListContainer<AccountProfile>>
@POST("register/google")