UI调整
This commit is contained in:
@@ -6,6 +6,7 @@ import com.aiosman.ravenow.entity.AgentEntity
|
||||
import com.aiosman.ravenow.entity.CreatorEntity
|
||||
import com.aiosman.ravenow.entity.ProfileEntity
|
||||
import com.aiosman.ravenow.entity.RoomEntity
|
||||
import com.aiosman.ravenow.entity.UsersEntity
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class Room(
|
||||
@@ -38,7 +39,9 @@ data class Room(
|
||||
@SerializedName("canJoin")
|
||||
val canJoin: Boolean,
|
||||
@SerializedName("canJoinCode")
|
||||
val canJoinCode: Int
|
||||
val canJoinCode: Int,
|
||||
@SerializedName("users")
|
||||
val users: List<Users>
|
||||
|
||||
) {
|
||||
fun toRoomtEntity(): RoomEntity {
|
||||
@@ -58,6 +61,7 @@ data class Room(
|
||||
maxMemberLimit = maxMemberLimit,
|
||||
canJoin = canJoin,
|
||||
canJoinCode = canJoinCode,
|
||||
users = users.map { it.toUsersEntity() }
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -83,6 +87,25 @@ data class Creator(
|
||||
}
|
||||
}
|
||||
|
||||
data class Users(
|
||||
@SerializedName("id")
|
||||
val id: Int,
|
||||
@SerializedName("userId")
|
||||
val userId: String,
|
||||
@SerializedName("trtcUserId")
|
||||
val trtcUserId: String,
|
||||
@SerializedName("profile")
|
||||
val profile: Profile
|
||||
){
|
||||
fun toUsersEntity(): UsersEntity {
|
||||
return UsersEntity(
|
||||
id = id,
|
||||
userId = userId,
|
||||
profile = profile.toProfileEntity()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -76,6 +76,11 @@ data class CreateGroupChatRequestBody(
|
||||
val promptIds: List<String>,
|
||||
)
|
||||
|
||||
data class JoinGroupChatRequestBody(
|
||||
@SerializedName("trtcId")
|
||||
val trtcId: String,
|
||||
)
|
||||
|
||||
data class LoginUserRequestBody(
|
||||
@SerializedName("username")
|
||||
val username: String? = null,
|
||||
@@ -567,6 +572,9 @@ interface RaveNowAPI {
|
||||
suspend fun getRoomDetail(@Query("trtcId") trtcId: String,
|
||||
): Response<DataContainer<Room>>
|
||||
|
||||
@POST("outside/rooms/join")
|
||||
suspend fun joinRoom(@Body body: JoinGroupChatRequestBody,
|
||||
): Response<DataContainer<Room>>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user