mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-03 14:52:25 +08:00
Re-order parameters of AnnouncementImage
This commit is contained in:
parent
858766d6b5
commit
b239c57679
@ -24,9 +24,9 @@ import net.mamoe.mirai.utils.MiraiInternalApi
|
||||
@SerialName(AnnouncementImage.SERIAL_NAME)
|
||||
@Serializable
|
||||
public class AnnouncementImage @MiraiInternalApi public constructor(
|
||||
public val id: String,
|
||||
public val height: String,
|
||||
public val width: String,
|
||||
public val id: String
|
||||
) {
|
||||
// For stability, do not make it `data class`.
|
||||
|
||||
@ -35,7 +35,7 @@ public class AnnouncementImage @MiraiInternalApi public constructor(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "AnnouncementImage(height='$height', width='$width', id='$id')"
|
||||
return "AnnouncementImage(id='$id', height='$height', width='$width')"
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
@ -44,17 +44,17 @@ public class AnnouncementImage @MiraiInternalApi public constructor(
|
||||
|
||||
other as AnnouncementImage
|
||||
|
||||
if (id != other.id) return false
|
||||
if (height != other.height) return false
|
||||
if (width != other.width) return false
|
||||
if (id != other.id) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = height.hashCode()
|
||||
var result = id.hashCode()
|
||||
result = 31 * result + height.hashCode()
|
||||
result = 31 * result + width.hashCode()
|
||||
result = 31 * result + id.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
@ -56,7 +56,7 @@ internal class GroupAnnouncementImage @MiraiInternalApi constructor(
|
||||
@SerialName("w") val width: String,
|
||||
@SerialName("id") val id: String
|
||||
) : JsonStruct {
|
||||
fun toPublic(): AnnouncementImage = AnnouncementImage(height, width, id)
|
||||
fun toPublic(): AnnouncementImage = AnnouncementImage(id, height, width)
|
||||
}
|
||||
|
||||
@Serializable
|
||||
|
Loading…
Reference in New Issue
Block a user