mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-06 08:00:10 +08:00
http-api make level-top function a constructor
This commit is contained in:
parent
2c32a905b1
commit
ce534bc77b
@ -16,10 +16,11 @@ data class QQDTO(
|
|||||||
override val id: Long,
|
override val id: Long,
|
||||||
val nickName: String,
|
val nickName: String,
|
||||||
val remark: String
|
val remark: String
|
||||||
) : ContactDTO()
|
) : ContactDTO() {
|
||||||
|
// TODO: queryProfile.nickname & queryRemark.value not support now
|
||||||
|
constructor(qq: QQ) : this(qq.id, "", "")
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: queryProfile.nickname & queryRemark.value not support now
|
|
||||||
suspend fun QQDTO(qq: QQ): QQDTO = QQDTO(qq.id, "", "")
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class MemberDTO(
|
data class MemberDTO(
|
||||||
@ -27,15 +28,17 @@ data class MemberDTO(
|
|||||||
val memberName: String = "",
|
val memberName: String = "",
|
||||||
val permission: MemberPermission,
|
val permission: MemberPermission,
|
||||||
val group: GroupDTO
|
val group: GroupDTO
|
||||||
) : ContactDTO()
|
) : ContactDTO() {
|
||||||
|
constructor(member: Member, name: String = "") : this (
|
||||||
fun MemberDTO(member: Member, name: String = ""): MemberDTO = MemberDTO(member.id, name, member.permission, GroupDTO(member.group))
|
member.id, name, member.permission, GroupDTO(member.group)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class GroupDTO(
|
data class GroupDTO(
|
||||||
override val id: Long,
|
override val id: Long,
|
||||||
val name: String,
|
val name: String,
|
||||||
val permission: MemberPermission
|
val permission: MemberPermission
|
||||||
) : ContactDTO()
|
) : ContactDTO() {
|
||||||
|
constructor(group: Group) : this(group.id, group.name, group.botPermission)
|
||||||
fun GroupDTO(group: Group): GroupDTO = GroupDTO(group.id, group.name, group.botPermission)
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user