Commit c69502a9 authored by jiahua.liu's avatar jiahua.liu

Proto Bufs

parent 584cdd7d
import kotlinx.serialization.SerialId
import kotlinx.serialization.Serializable
import net.mamoe.mirai.qqandroid.io.ProtoBuf
@Serializable
class Common : ProtoBuf {
@Serializable
class BindInfo(
@SerialId(1) val friUin: Long = 0L,
@SerialId(2) val friNick: String = "",
@SerialId(3) val time: Long = 0L,
@SerialId(4) val bindStatus: Int = 0
) : ProtoBuf
@Serializable
class MedalInfo(
@SerialId(1) val id: Int = 0,
@SerialId(2) val type: Int = 0,
@SerialId(4) val seq: Long = 0,
@SerialId(5) val name: String = "",
@SerialId(6) val newflag: Int = 0,
@SerialId(7) val time: Long = 0L,
@SerialId(8) val msgBindFri: Common.BindInfo? = null,
@SerialId(11) val desc: String = "",
@SerialId(31) val level: Int = 0,
@SerialId(36) val taskinfos: List<Common.MedalTaskInfo>? = null,
@SerialId(40) val point: Int = 0,
@SerialId(41) val pointLevel2: Int = 0,
@SerialId(42) val pointLevel3: Int = 0,
@SerialId(43) val seqLevel2: Long = 0,
@SerialId(44) val seqLevel3: Long = 0,
@SerialId(45) val timeLevel2: Long = 0L,
@SerialId(46) val timeLevel3: Long = 0L,
@SerialId(47) val descLevel2: String = "",
@SerialId(48) val descLevel3: String = "",
@SerialId(49) val endtime: Int = 0,
@SerialId(50) val detailUrl: String = "",
@SerialId(51) val detailUrl2: String = "",
@SerialId(52) val detailUrl3: String = "",
@SerialId(53) val taskDesc: String = "",
@SerialId(54) val taskDesc2: String = "",
@SerialId(55) val taskDesc3: String = "",
@SerialId(56) val levelCount: Int = 0,
@SerialId(57) val noProgress: Int = 0,
@SerialId(58) val resource: String = "",
@SerialId(59) val fromuinLevel: Int = 0,
@SerialId(60) val unread: Int = 0,
@SerialId(61) val unread2: Int = 0,
@SerialId(62) val unread3: Int = 0
) : ProtoBuf
@Serializable
class MedalTaskInfo(
@SerialId(1) val taskid: Int = 0,
@SerialId(32) val int32TaskValue: Int = 0,
@SerialId(33) val tarValue: Int = 0,
@SerialId(34) val tarValueLevel2: Int = 0,
@SerialId(35) val tarValueLevel3: Int = 0
) : ProtoBuf
}
package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.SerialId
import kotlinx.serialization.Serializable
import net.mamoe.mirai.qqandroid.io.ProtoBuf
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
@Serializable
class GroupLabel : ProtoBuf {
@Serializable
class Label(
@SerialId(1) val name: ByteArray = EMPTY_BYTE_ARRAY,
@SerialId(2) val enumType: Int /* enum */ = 1,
@SerialId(3) val textColor: GroupLabel.Color? = null,
@SerialId(4) val edgingColor: GroupLabel.Color? = null,
@SerialId(5) val labelAttr: Int = 0,
@SerialId(6) val labelType: Int = 0
) : ProtoBuf
@Serializable
class RspBody(
@SerialId(1) val error: ByteArray = EMPTY_BYTE_ARRAY,
@SerialId(2) val groupInfo: List<GroupLabel.GroupInfo>? = null
) : ProtoBuf
@Serializable
class SourceId(
@SerialId(1) val sourceId: Int = 0
) : ProtoBuf
@Serializable
class GroupInfo(
@SerialId(1) val int32Result: Int = 0,
@SerialId(2) val groupCode: Long = 0L,
@SerialId(3) val groupLabel: List<GroupLabel.Label>? = null
) : ProtoBuf
@Serializable
class Color(
@SerialId(1) val r: Int = 0,
@SerialId(2) val g: Int = 0,
@SerialId(3) val b: Int = 0
) : ProtoBuf
@Serializable
class ReqBody(
@SerialId(1) val sourceId: GroupLabel.SourceId? = null,
@SerialId(2) val uinInfo: GroupLabel.UinInfo? = null,
@SerialId(3) val numberLabel: Int = 5,
@SerialId(4) val groupCode: List<Long>? = null,
@SerialId(5) val labelStyle: Int = 0
) : ProtoBuf
@Serializable
class UinInfo(
@SerialId(1) val int64Longitude: Long = 0L,
@SerialId(2) val int64Latitude: Long = 0L
) : ProtoBuf
}
\ No newline at end of file
...@@ -6,7 +6,7 @@ import java.io.File ...@@ -6,7 +6,7 @@ import java.io.File
fun main() { fun main() {
println( println(
File("""/Users/jiahua.liu/Desktop/QQAndroid-F/app/src/main/java/tencent/im/s2c/msgtype0x210/submsgtype0xc7/bussinfo/mutualmark""") File("""/Users/jiahua.liu/Desktop/QQAndroid-F/app/src/main/java/tencent/im/group/group_label/""")
.generateUnarrangedClasses().toMutableList().arrangeClasses().joinToString("\n\n") .generateUnarrangedClasses().toMutableList().arrangeClasses().joinToString("\n\n")
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment