会话分组及聊天室实现

This commit is contained in:
weber
2025-08-11 18:21:22 +08:00
parent 54ca1d3f1c
commit 697af504b7
23 changed files with 1049 additions and 115 deletions

View File

@@ -66,13 +66,8 @@ data class AccountProfile(
followerCount = followerCount,
followingCount = followingCount,
nickName = nickname,
avatar = if (aiAccount) {
// 对于AI账户直接使用原始头像URL不添加服务器前缀
"${ApiClient.BASE_API_URL+"/outside"}$avatar"+"?token="+"Bearer ${AppStore.token}"
} else {
// 对于普通用户,添加服务器前缀
"${ApiClient.BASE_SERVER}$avatar"
},
avatar =
"${ApiClient.BASE_SERVER}$avatar",
bio = bio,
country = "Worldwide",
isFollowing = isFollowing,

View File

@@ -37,7 +37,7 @@ data class Agent(
desc = desc,
createdAt = createdAt,
updatedAt = updatedAt,
avatar = "${ApiClient.BASE_API_URL+"/outside"}$avatar"+"?token="+"Bearer ${AppStore.token}",
avatar = "${ApiClient.BASE_API_URL+"/outside"}$avatar"+"?token="+"${AppStore.token}",
//author = author,
isPublic = isPublic,
openId = openId,

View File

@@ -55,7 +55,7 @@ interface UserService {
* @return 用户信息
*/
suspend fun getUserProfileByTrtcUserId(id: String):AccountProfileEntity
suspend fun getUserProfileByTrtcUserId(id: String,includeAI: Int):AccountProfileEntity
/**
* 获取用户信息
@@ -107,8 +107,8 @@ class UserServiceImpl : UserService {
)
}
override suspend fun getUserProfileByTrtcUserId(id: String): AccountProfileEntity {
val resp = ApiClient.api.getAccountProfileByTrtcUserId(id)
override suspend fun getUserProfileByTrtcUserId(id: String,includeAI: Int): AccountProfileEntity {
val resp = ApiClient.api.getAccountProfileByTrtcUserId(id,includeAI)
val body = resp.body() ?: throw ServiceException("Failed to get account")
return body.data.toAccountProfileEntity()
}

View File

@@ -51,6 +51,9 @@ data class SendChatAiRequestBody(
val toTrtcUserId: String,
@SerializedName("message")
val message: String,
@SerializedName("skipTrtc")
val skipTrtc: Boolean,
)
data class LoginUserRequestBody(
@@ -380,7 +383,8 @@ interface RaveNowAPI {
@GET("profile/trtc/{id}")
suspend fun getAccountProfileByTrtcUserId(
@Path("id") id: String
@Path("id") id: String,
@Query("includeAI") includeAI: Int
): Response<DataContainer<AccountProfile>>