2025-07-31 15:22:34 +08:00
|
|
|
package com.aiosman.ravenow.data
|
|
|
|
|
|
2025-08-06 15:58:17 +08:00
|
|
|
import com.aiosman.ravenow.AppStore
|
2025-07-31 15:22:34 +08:00
|
|
|
import com.aiosman.ravenow.data.api.ApiClient
|
|
|
|
|
import com.aiosman.ravenow.entity.AgentEntity
|
|
|
|
|
import com.aiosman.ravenow.entity.ProfileEntity
|
|
|
|
|
import com.google.gson.annotations.SerializedName
|
|
|
|
|
|
|
|
|
|
data class Agent(
|
|
|
|
|
@SerializedName("author")
|
|
|
|
|
val author: String,
|
|
|
|
|
@SerializedName("avatar")
|
|
|
|
|
val avatar: String,
|
|
|
|
|
@SerializedName("breakMode")
|
|
|
|
|
val breakMode: Boolean,
|
|
|
|
|
@SerializedName("createdAt")
|
|
|
|
|
val createdAt: String,
|
|
|
|
|
@SerializedName("desc")
|
|
|
|
|
val desc: String,
|
|
|
|
|
@SerializedName("id")
|
|
|
|
|
val id: Int,
|
|
|
|
|
@SerializedName("isPublic")
|
|
|
|
|
val isPublic: Boolean,
|
|
|
|
|
@SerializedName("openId")
|
|
|
|
|
val openId: String,
|
|
|
|
|
@SerializedName("title")
|
|
|
|
|
val title: String,
|
|
|
|
|
@SerializedName("updatedAt")
|
|
|
|
|
val updatedAt: String,
|
|
|
|
|
@SerializedName("useCount")
|
|
|
|
|
val useCount: Int
|
2025-08-13 18:57:03 +08:00
|
|
|
|
2025-07-31 15:22:34 +08:00
|
|
|
) {
|
|
|
|
|
fun toAgentEntity(): AgentEntity {
|
|
|
|
|
return AgentEntity(
|
|
|
|
|
id = id,
|
|
|
|
|
title = title,
|
|
|
|
|
desc = desc,
|
|
|
|
|
createdAt = createdAt,
|
|
|
|
|
updatedAt = updatedAt,
|
2025-08-11 18:21:22 +08:00
|
|
|
avatar = "${ApiClient.BASE_API_URL+"/outside"}$avatar"+"?token="+"${AppStore.token}",
|
2025-08-06 15:58:17 +08:00
|
|
|
//author = author,
|
2025-07-31 15:22:34 +08:00
|
|
|
isPublic = isPublic,
|
|
|
|
|
openId = openId,
|
|
|
|
|
breakMode = breakMode,
|
|
|
|
|
useCount = useCount,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data class Profile(
|
|
|
|
|
@SerializedName("aiAccount")
|
|
|
|
|
val aiAccount: Boolean,
|
|
|
|
|
@SerializedName("avatar")
|
|
|
|
|
val avatar: String,
|
|
|
|
|
@SerializedName("banner")
|
|
|
|
|
val banner: String,
|
|
|
|
|
@SerializedName("bio")
|
|
|
|
|
val bio: String,
|
|
|
|
|
@SerializedName("chatAIId")
|
|
|
|
|
val chatAIId: String,
|
|
|
|
|
@SerializedName("id")
|
|
|
|
|
val id: Int,
|
|
|
|
|
@SerializedName("nickname")
|
|
|
|
|
val nickname: String,
|
|
|
|
|
@SerializedName("trtcUserId")
|
|
|
|
|
val trtcUserId: String,
|
|
|
|
|
@SerializedName("username")
|
|
|
|
|
val username: String
|
|
|
|
|
){
|
|
|
|
|
fun toProfileEntity(): ProfileEntity {
|
|
|
|
|
return ProfileEntity(
|
|
|
|
|
id = id,
|
|
|
|
|
username = username,
|
|
|
|
|
nickname = nickname,
|
|
|
|
|
avatar = "${ApiClient.BASE_SERVER}$avatar",
|
|
|
|
|
bio = bio,
|
|
|
|
|
banner = "${ApiClient.BASE_SERVER}$banner",
|
|
|
|
|
trtcUserId = trtcUserId,
|
|
|
|
|
chatAIId = chatAIId,
|
|
|
|
|
aiAccount = aiAccount
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
interface AgentService {
|
|
|
|
|
/**
|
|
|
|
|
* 获取智能体列表
|
|
|
|
|
*/
|
|
|
|
|
suspend fun getAgent(
|
|
|
|
|
pageNumber: Int,
|
|
|
|
|
pageSize: Int = 20
|
|
|
|
|
): ListContainer<AgentEntity>
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|