From cad433cbc8605ae0adcec1a1172a637cbc2ef9b3 Mon Sep 17 00:00:00 2001 From: Enaium Date: Mon, 1 Apr 2024 20:10:51 +0800 Subject: [PATCH 1/2] update some response --- .../kookstarter/model/event/ChannelEvent.java | 24 ++++++++ .../kookstarter/model/event/MessageEvent.java | 6 ++ .../model/response/BlacklistListResponse.java | 21 ++++++- .../model/response/ChannelCreateResponse.java | 4 ++ .../model/response/ChannelListResponse.java | 10 +++- .../response/ChannelRoleIndexResponse.java | 26 ++++++++- .../response/ChannelRoleSyncResponse.java | 7 ++- .../model/response/ChannelUpdateResponse.java | 30 ++++++++++ .../ChannelUserGetJoinedChannelResponse.java | 21 ++++++- .../response/ChannelUserListResponse.java | 23 +++++++- .../model/response/ChannelViewResponse.java | 4 ++ .../response/DirectMessageListResponse.java | 17 +++++- .../response/DirectMessageViewResponse.java | 7 +++ .../model/response/GameResponse.java | 13 ++++- .../response/GuildBoostHistoryResponse.java | 20 ++++++- .../response/GuildEmojiCreateResponse.java | 4 -- .../response/GuildEmojiDeleteResponse.java | 3 - .../response/GuildEmojiListResponse.java | 15 ++++- .../response/GuildEmojiUpdateResponse.java | 3 - .../model/response/GuildListResponse.java | 16 +++++- .../response/GuildMuteCreateResponse.java | 3 - .../response/GuildMuteDeleteResponse.java | 3 - .../response/GuildRoleCreateResponse.java | 10 +++- .../response/GuildRoleDeleteResponse.java | 3 - .../model/response/GuildRoleListResponse.java | 12 +++- .../response/GuildRoleRevokeResponse.java | 2 - .../response/GuildRoleUpdateResponse.java | 10 +++- .../model/response/GuildUserListResponse.java | 16 +++++- .../model/response/GuildViewResponse.java | 27 +++++++-- .../model/response/InviteListResponse.java | 17 +++++- .../model/response/MessageListResponse.java | 56 ++++++++++++++++++- .../model/response/UserChatListResponse.java | 16 +++++- 32 files changed, 398 insertions(+), 51 deletions(-) diff --git a/src/main/java/cn/enaium/kookstarter/model/event/ChannelEvent.java b/src/main/java/cn/enaium/kookstarter/model/event/ChannelEvent.java index 1d35b0f..ff29a1c 100644 --- a/src/main/java/cn/enaium/kookstarter/model/event/ChannelEvent.java +++ b/src/main/java/cn/enaium/kookstarter/model/event/ChannelEvent.java @@ -112,7 +112,31 @@ public record Body(@JsonProperty("id") String id, @JsonProperty("name") String n @JsonProperty("level") Integer level, @JsonProperty("slow_mode") Integer slowMode, @JsonProperty("topic") String topic, @JsonProperty("type") Integer type, + @JsonProperty("permission_overwrites") List permissionOverwrites, + @JsonProperty("permission_users") List permissionUsers, @JsonProperty("permission_sync") Integer permissionSync) { + public record PermissionOverwrites(@JsonProperty("role_id") Integer roleId, + @JsonProperty("allow") Integer allow, + @JsonProperty("deny") Integer deny) { + } + + public record PermissionUsers(@JsonProperty("user") User user, + @JsonProperty("allow") Integer allow, + @JsonProperty("deny") Integer deny) { + public record User(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, + @JsonProperty("os") String os, + @JsonProperty("status") Integer status, + @JsonProperty("avatar") String avatar, + @JsonProperty("mobile_verified") Boolean mobileVerified, + @JsonProperty("nickname") String nickname, + @JsonProperty("roles") List roles, + @JsonProperty("joined_at") Long joinedAt, + @JsonProperty("active_time") Long activeTime) { + } + } } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/event/MessageEvent.java b/src/main/java/cn/enaium/kookstarter/model/event/MessageEvent.java index 5910980..b15dfcd 100644 --- a/src/main/java/cn/enaium/kookstarter/model/event/MessageEvent.java +++ b/src/main/java/cn/enaium/kookstarter/model/event/MessageEvent.java @@ -271,7 +271,13 @@ public record TagInfo(@JsonProperty("color") String color, } public record Kmarkdown(@JsonProperty("mention") List mention, + @JsonProperty("mention_part") List mentionPart, @JsonProperty("item_part") List itemPart) { + public record MentionPart(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("full_name") String fullName, + @JsonProperty("avatar") String avatar) { + } } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/BlacklistListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/BlacklistListResponse.java index 43344e4..a4264bb 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/BlacklistListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/BlacklistListResponse.java @@ -2,13 +2,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record BlacklistListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("user_id") String userId, + @JsonProperty("created_time") Long createdTime, + @JsonProperty("remark") String remark, @JsonProperty("user") User user) { + public record User(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("os") String os, + @JsonProperty("status") Integer status, @JsonProperty("avatar") String avatar, + @JsonProperty("vip_avatar") String vipAvatar, + @JsonProperty("banner") String banner, + @JsonProperty("nickname") String nickname, + @JsonProperty("roles") List roles, + @JsonProperty("is_vip") Boolean isVip, @JsonProperty("bot") Boolean bot) { + } + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelCreateResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelCreateResponse.java index 87f09c8..bdff1e7 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelCreateResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelCreateResponse.java @@ -19,8 +19,12 @@ public record Data(@JsonProperty("id") String id, @JsonProperty("guild_id") Stri @JsonProperty("limit_amount") Integer limitAmount, @JsonProperty("is_category") Boolean isCategory, @JsonProperty("permission_sync") Integer permissionSync, + @JsonProperty("permission_overwrites") List permissionOverwrites, @JsonProperty("permission_users") List permissionUsers, @JsonProperty("voice_quality") String voiceQuality, @JsonProperty("server_url") String serverUrl) { + public record PermissionOverwrites(@JsonProperty("role_id") Integer roleId, + @JsonProperty("allow") Integer allow, @JsonProperty("deny") Integer deny) { + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelListResponse.java index 9a2eef8..b6782ef 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelListResponse.java @@ -10,7 +10,15 @@ */ public record ChannelListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") List sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") List sort) { + public record Items(@JsonProperty("id") String id, @JsonProperty("user_id") String userId, + @JsonProperty("parent_id") String parentId, @JsonProperty("name") String name, + @JsonProperty("type") Integer type, @JsonProperty("level") Integer level, + @JsonProperty("limit_amount") Integer limitAmount, + @JsonProperty("is_category") Boolean isCategory) { + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleIndexResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleIndexResponse.java index d3d4a96..4c1d3d5 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleIndexResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleIndexResponse.java @@ -2,8 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; +import java.util.List; /** * @author Enaium @@ -11,6 +10,27 @@ */ public record ChannelRoleIndexResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("permission_sync") Integer permissionSync) { + public record Data( + @JsonProperty("permission_overwrites") List permissionOverwrites, + @JsonProperty("permission_users") List permissionUsers, + @JsonProperty("permission_sync") Integer permissionSync) { + public record PermissionOverwrites(@JsonProperty("role_id") Integer roleId, + @JsonProperty("allow") Integer allow, @JsonProperty("deny") Integer deny) { + } + + public record PermissionUsers(@JsonProperty("user") User user, + @JsonProperty("allow") Integer allow, @JsonProperty("deny") Integer deny) { + public record User(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("os") String os, + @JsonProperty("status") Integer status, @JsonProperty("avatar") String avatar, + @JsonProperty("mobile_verified") Boolean mobileVerified, + @JsonProperty("nickname") String nickname, + @JsonProperty("roles") List roles, + @JsonProperty("joined_at") Long joinedAt, + @JsonProperty("active_time") Long activeTime) { + } + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleSyncResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleSyncResponse.java index c3da0f5..016ae9b 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleSyncResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelRoleSyncResponse.java @@ -10,6 +10,11 @@ */ public record ChannelRoleSyncResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("permission_users") List permissionUsers) { + public record Data( + @JsonProperty("permission_overwrites") List permissionOverwrites, + @JsonProperty("permission_users") List permissionUsers) { + public record PermissionOverwrites(@JsonProperty("role_id") Integer roleId, + @JsonProperty("allow") Integer allow, @JsonProperty("deny") Integer deny) { + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelUpdateResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelUpdateResponse.java index 1e80cef..47bd7e3 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelUpdateResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelUpdateResponse.java @@ -2,6 +2,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 @@ -20,7 +22,35 @@ public record Data(@JsonProperty("id") String id, @JsonProperty("name") String n @JsonProperty("server_url") String serverUrl, @JsonProperty("level") Integer level, @JsonProperty("slow_mode") Integer slowMode, @JsonProperty("topic") String topic, @JsonProperty("is_master") Boolean isMaster, @JsonProperty("type") Integer type, + @JsonProperty("permission_overwrites") List permissionOverwrites, + @JsonProperty("permission_users") List permissionUsers, @JsonProperty("permission_sync") Integer permissionSync, @JsonProperty("mode") Integer mode, @JsonProperty("has_password") Boolean hasPassword) { + public record PermissionOverwrites(@JsonProperty("role_id") Integer roleId, + @JsonProperty("allow") Integer allow, @JsonProperty("deny") Integer deny) { + } + + public record PermissionUsers(@JsonProperty("user") User user, + @JsonProperty("allow") Integer allow, @JsonProperty("deny") Integer deny) { + public record User(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("os") String os, + @JsonProperty("status") Integer status, @JsonProperty("avatar") String avatar, + @JsonProperty("vip_avatar") String vipAvatar, + @JsonProperty("banner") String banner, + @JsonProperty("nickname") String nickname, + @JsonProperty("roles") List roles, + @JsonProperty("is_vip") Boolean isVip, + @JsonProperty("is_ai_reduce_noise") Boolean isAiReduceNoise, + @JsonProperty("bot") Boolean bot, @JsonProperty("tag_info") TagInfo tagInfo, + @JsonProperty("mobile_verified") Boolean mobileVerified, + @JsonProperty("joined_at") Long joinedAt, + @JsonProperty("active_time") Long activeTime) { + public record TagInfo(@JsonProperty("color") String color, + @JsonProperty("text") String text) { + } + } + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserGetJoinedChannelResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserGetJoinedChannelResponse.java index 14fdcda..15303ef 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserGetJoinedChannelResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserGetJoinedChannelResponse.java @@ -2,6 +2,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 @@ -9,7 +11,24 @@ public record ChannelUserGetJoinedChannelResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("id") String id, @JsonProperty("guild_id") String guildId, + @JsonProperty("user_id") String userId, @JsonProperty("parent_id") String parentId, + @JsonProperty("name") String name, @JsonProperty("topic") String topic, + @JsonProperty("type") Integer type, @JsonProperty("level") Integer level, + @JsonProperty("slow_mode") Integer slowMode, + @JsonProperty("limit_amount") Integer limitAmount, + @JsonProperty("is_category") Boolean isCategory, + @JsonProperty("permission_sync") Integer permissionSync, + @JsonProperty("permission_overwrites") List permissionOverwrites, + @JsonProperty("permission_users") List permissionUsers) { + public record PermissionOverwrites(@JsonProperty("role_id") Integer roleId, + @JsonProperty("allow") Integer allow, + @JsonProperty("deny") Integer deny) { + } + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserListResponse.java index de2cdb0..ac9f3ed 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelUserListResponse.java @@ -2,10 +2,31 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record ChannelUserListResponse(@JsonProperty("code") Integer code, - @JsonProperty("message") String message) { + @JsonProperty("message") String message, @JsonProperty("data") List data) { + public record Data(@JsonProperty("id") String id, @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("os") String os, + @JsonProperty("status") Integer status, @JsonProperty("avatar") String avatar, + @JsonProperty("vip_avatar") String vipAvatar, @JsonProperty("banner") String banner, + @JsonProperty("nickname") String nickname, @JsonProperty("roles") List roles, + @JsonProperty("is_vip") Boolean isVip, + @JsonProperty("is_ai_reduce_noise") Boolean isAiReduceNoise, + @JsonProperty("is_personal_card_bg") Boolean isPersonalCardBg, + @JsonProperty("bot") Boolean bot, + @JsonProperty("mobile_verified") Boolean mobileVerified, + @JsonProperty("joined_at") Long joinedAt, @JsonProperty("active_time") Long activeTime, + @JsonProperty("live_info") LiveInfo liveInfo) { + public record LiveInfo(@JsonProperty("in_live") Boolean inLive, + @JsonProperty("audience_count") Integer audienceCount, + @JsonProperty("live_thumb") String liveThumb, + @JsonProperty("live_start_time") Integer liveStartTime) { + } + } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/ChannelViewResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/ChannelViewResponse.java index 40a8798..c503532 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/ChannelViewResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/ChannelViewResponse.java @@ -19,9 +19,13 @@ public record Data(@JsonProperty("id") String id, @JsonProperty("guild_id") Stri @JsonProperty("limit_amount") Integer limitAmount, @JsonProperty("is_category") Boolean isCategory, @JsonProperty("permission_sync") Integer permissionSync, + @JsonProperty("permission_overwrites") List permissionOverwrites, @JsonProperty("permission_users") List permissionUsers, @JsonProperty("voice_quality") String voiceQuality, @JsonProperty("server_url") String serverUrl, @JsonProperty("children") List children) { + public record PermissionOverwrites(@JsonProperty("role_id") Integer roleId, + @JsonProperty("allow") Integer allow, @JsonProperty("deny") Integer deny) { + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageListResponse.java index ac00652..8bd8dfa 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageListResponse.java @@ -2,12 +2,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record DirectMessageListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data() { + public record Data(@JsonProperty("items") List items) { + public record Items(@JsonProperty("id") String id, @JsonProperty("type") Integer type, + @JsonProperty("content") String content, + @JsonProperty("embeds") List embeds, + @JsonProperty("attachments") List attachments, + @JsonProperty("create_at") Long createAt, + @JsonProperty("updated_at") Integer updatedAt, + @JsonProperty("reactions") List reactions, + @JsonProperty("author_id") String authorId, + @JsonProperty("image_name") String imageName, + @JsonProperty("read_status") Boolean readStatus, + @JsonProperty("quote") Object quote, + @JsonProperty("mention_info") Object mentionInfo) { + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageViewResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageViewResponse.java index ca1d67e..407caac 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageViewResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/DirectMessageViewResponse.java @@ -14,11 +14,18 @@ public record Data(@JsonProperty("id") String id, @JsonProperty("type") Integer @JsonProperty("content") String content, @JsonProperty("embeds") List embeds, @JsonProperty("attachments") Boolean attachments, @JsonProperty("create_at") Long createAt, @JsonProperty("updated_at") Integer updatedAt, + @JsonProperty("reactions") List reactions, @JsonProperty("author_id") String authorId, @JsonProperty("image_name") String imageName, @JsonProperty("mention_info") MentionInfo mentionInfo, @JsonProperty("from_type") Integer fromType, @JsonProperty("msg_icon") String msgIcon, @JsonProperty("quote") Object quote) { + public record Reactions(@JsonProperty("emoji") Emoji emoji, + @JsonProperty("count") Integer count, @JsonProperty("me") Boolean me) { + public record Emoji(@JsonProperty("id") String id, @JsonProperty("name") String name) { + } + } + public record MentionInfo(@JsonProperty("mention_part") List mentionPart, @JsonProperty("channel_part") List channelPart, @JsonProperty("item_part") List itemPart) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GameResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GameResponse.java index d6ee966..8337cdf 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GameResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GameResponse.java @@ -2,13 +2,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record GameResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("id") Integer id, @JsonProperty("name") String name, + @JsonProperty("type") Integer type, @JsonProperty("options") String options, + @JsonProperty("kmhook_admin") Boolean kmhookAdmin, + @JsonProperty("process_name") List processName, + @JsonProperty("product_name") List productName, + @JsonProperty("icon") String icon) { + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildBoostHistoryResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildBoostHistoryResponse.java index ddc30ff..bd406a6 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildBoostHistoryResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildBoostHistoryResponse.java @@ -2,13 +2,31 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record GuildBoostHistoryResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("user_id") String userId, + @JsonProperty("guild_id") String guildId, + @JsonProperty("start_time") Integer startTime, + @JsonProperty("end_time") Integer endTime, @JsonProperty("user") User user) { + public record User(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("os") String os, + @JsonProperty("avatar") String avatar, + @JsonProperty("vip_avatar") String vipAvatar, + @JsonProperty("banner") String banner, + @JsonProperty("nickname") String nickname, @JsonProperty("bot") Boolean bot) { + } + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiCreateResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiCreateResponse.java index da0a925..b6a481d 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiCreateResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiCreateResponse.java @@ -2,10 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.String; - /** * @author Enaium * @since 0.4.0 diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiDeleteResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiDeleteResponse.java index 602f1c9..486203d 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiDeleteResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiDeleteResponse.java @@ -2,9 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; - /** * @author Enaium * @since 0.4.0 diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiListResponse.java index f04e237..0a99e01 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiListResponse.java @@ -2,13 +2,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record GuildEmojiListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("name") String name, @JsonProperty("id") String id, + @JsonProperty("user_info") UserInfo userInfo) { + public record UserInfo(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("os") String os, + @JsonProperty("status") Integer status, @JsonProperty("avatar") String avatar) { + } + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiUpdateResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiUpdateResponse.java index f9c5b5c..84de34e 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiUpdateResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildEmojiUpdateResponse.java @@ -2,9 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; - /** * @author Enaium * @since 0.4.0 diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildListResponse.java index 685fc90..2a936be 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildListResponse.java @@ -2,13 +2,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record GuildListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("id") String id, @JsonProperty("name") String name, + @JsonProperty("topic") String topic, @JsonProperty("user_id") String userId, + @JsonProperty("icon") String icon, @JsonProperty("notify_type") Integer notifyType, + @JsonProperty("region") String region, + @JsonProperty("enable_open") Boolean enableOpen, + @JsonProperty("open_id") String openId, + @JsonProperty("default_channel_id") String defaultChannelId, + @JsonProperty("welcome_channel_id") String welcomeChannelId, + @JsonProperty("boost_num") Integer boostNum, @JsonProperty("level") Integer level) { + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteCreateResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteCreateResponse.java index 3121b59..7fd20b6 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteCreateResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteCreateResponse.java @@ -2,9 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; - /** * @author Enaium * @since 0.4.0 diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteDeleteResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteDeleteResponse.java index dcff336..022a0c5 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteDeleteResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildMuteDeleteResponse.java @@ -2,9 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; - /** * @author Enaium * @since 0.4.0 diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleCreateResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleCreateResponse.java index 26eabb4..9932c99 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleCreateResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleCreateResponse.java @@ -2,13 +2,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; +import java.util.List; /** * @author Enaium * @since 0.4.0 */ public record GuildRoleCreateResponse(@JsonProperty("code") Integer code, - @JsonProperty("message") String message) { + @JsonProperty("message") String message, @JsonProperty("data") List data) { + public record Data(@JsonProperty("role_id") Integer roleId, @JsonProperty("name") String name, + @JsonProperty("color") Integer color, @JsonProperty("position") Integer position, + @JsonProperty("hoist") Integer hoist, @JsonProperty("mentionable") Integer mentionable, + @JsonProperty("permissions") Integer permissions) { + } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleDeleteResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleDeleteResponse.java index a20f279..856f623 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleDeleteResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleDeleteResponse.java @@ -2,9 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; - /** * @author Enaium * @since 0.4.0 diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleListResponse.java index 6c25755..7c04e5b 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleListResponse.java @@ -2,13 +2,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record GuildRoleListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("role_id") Integer roleId, + @JsonProperty("name") String name, @JsonProperty("color") Integer color, + @JsonProperty("position") Integer position, @JsonProperty("hoist") Integer hoist, + @JsonProperty("mentionable") Integer mentionable, + @JsonProperty("permissions") Integer permissions) { + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleRevokeResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleRevokeResponse.java index 3a6791b..f685020 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleRevokeResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleRevokeResponse.java @@ -2,8 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; import java.util.List; /** diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleUpdateResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleUpdateResponse.java index aa392ba..865fdb3 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleUpdateResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildRoleUpdateResponse.java @@ -2,13 +2,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Integer; -import java.lang.String; +import java.util.List; /** * @author Enaium * @since 0.4.0 */ public record GuildRoleUpdateResponse(@JsonProperty("code") Integer code, - @JsonProperty("message") String message) { + @JsonProperty("message") String message, @JsonProperty("data") List data) { + public record Data(@JsonProperty("role_id") Integer roleId, @JsonProperty("name") String name, + @JsonProperty("color") Integer color, @JsonProperty("position") Integer position, + @JsonProperty("hoist") Integer hoist, @JsonProperty("mentionable") Integer mentionable, + @JsonProperty("permissions") Integer permissions) { + } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildUserListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildUserListResponse.java index 7726eee..73e7da6 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildUserListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildUserListResponse.java @@ -2,16 +2,28 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record GuildUserListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort, - @JsonProperty("user_count") Integer userCount, + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort, @JsonProperty("user_count") Integer userCount, @JsonProperty("online_count") Integer onlineCount, @JsonProperty("offline_count") Integer offlineCount) { + public record Items(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("status") Integer status, + @JsonProperty("bot") Boolean bot, @JsonProperty("avatar") String avatar, + @JsonProperty("vip_avatar") String vipAvatar, + @JsonProperty("nickname") String nickname, + @JsonProperty("roles") List roles) { + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/GuildViewResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/GuildViewResponse.java index f42ba21..62bb5d5 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/GuildViewResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/GuildViewResponse.java @@ -2,19 +2,36 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record GuildViewResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("id") String id, @JsonProperty("name") String name, - @JsonProperty("topic") String topic, @JsonProperty("user_id") String userId, - @JsonProperty("icon") String icon, @JsonProperty("notify_type") Integer notifyType, - @JsonProperty("region") String region, @JsonProperty("enable_open") Boolean enableOpen, - @JsonProperty("open_id") String openId, + public record Data(@JsonProperty("roles") List roles, + @JsonProperty("channels") List channels, @JsonProperty("id") String id, + @JsonProperty("name") String name, @JsonProperty("topic") String topic, + @JsonProperty("user_id") String userId, @JsonProperty("icon") String icon, + @JsonProperty("notify_type") Integer notifyType, @JsonProperty("region") String region, + @JsonProperty("enable_open") Boolean enableOpen, @JsonProperty("open_id") String openId, @JsonProperty("default_channel_id") String defaultChannelId, @JsonProperty("welcome_channel_id") String welcomeChannelId, @JsonProperty("boost_num") Integer boostNum, @JsonProperty("level") Integer level) { + public record Roles(@JsonProperty("role_id") Integer roleId, + @JsonProperty("name") String name, @JsonProperty("color") Integer color, + @JsonProperty("position") Integer position, @JsonProperty("hoist") Integer hoist, + @JsonProperty("mentionable") Integer mentionable, + @JsonProperty("permissions") Integer permissions) { + } + + public record Channels(@JsonProperty("id") Integer id, + @JsonProperty("guild_id") String guildId, @JsonProperty("user_id") String userId, + @JsonProperty("parent_id") Integer parentId, @JsonProperty("name") String name, + @JsonProperty("topic") String topic, @JsonProperty("type") Integer type, + @JsonProperty("level") Integer level, @JsonProperty("slow_mode") Integer slowMode, + @JsonProperty("is_category") Boolean isCategory) { + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/InviteListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/InviteListResponse.java index 49feea5..2591794 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/InviteListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/InviteListResponse.java @@ -2,13 +2,28 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record InviteListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("channel_id") String channelId, + @JsonProperty("guild_id") String guildId, @JsonProperty("url_code") String urlCode, + @JsonProperty("url") String url, @JsonProperty("user") User user) { + public record User(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("identify_num") String identifyNum, + @JsonProperty("online") Boolean online, @JsonProperty("status") Integer status, + @JsonProperty("bot") Boolean bot, @JsonProperty("avatar") String avatar, + @JsonProperty("vip_avatar") String vipAvatar) { + } + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { diff --git a/src/main/java/cn/enaium/kookstarter/model/response/MessageListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/MessageListResponse.java index abf0441..562dcda 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/MessageListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/MessageListResponse.java @@ -2,12 +2,66 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record MessageListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data() { + public record Data(@JsonProperty("items") List items) { + public record Items(@JsonProperty("id") String id, @JsonProperty("type") Integer type, + @JsonProperty("content") String content, + @JsonProperty("mention") List mention, + @JsonProperty("mention_all") Boolean mentionAll, + @JsonProperty("mention_roles") List mentionRoles, + @JsonProperty("mention_here") Boolean mentionHere, + @JsonProperty("embeds") List embeds, + @JsonProperty("attachments") Object attachments, + @JsonProperty("create_at") Long createAt, + @JsonProperty("updated_at") Integer updatedAt, + @JsonProperty("reactions") List reactions, + @JsonProperty("author") Author author, @JsonProperty("image_name") String imageName, + @JsonProperty("read_status") Boolean readStatus, + @JsonProperty("quote") Object quote, + @JsonProperty("mention_info") MentionInfo mentionInfo) { + public record Embeds(@JsonProperty("type") String type, @JsonProperty("url") String url, + @JsonProperty("origin_url") String originUrl, + @JsonProperty("av_no") String avNo, + @JsonProperty("iframe_path") String iframePath, + @JsonProperty("duration") Integer duration, @JsonProperty("title") String title, + @JsonProperty("pic") String pic) { + } + + public record Reactions(@JsonProperty("emoji") Emoji emoji, + @JsonProperty("count") Integer count, @JsonProperty("me") Boolean me) { + public record Emoji(@JsonProperty("id") String id, + @JsonProperty("name") String name) { + } + } + + public record Author(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("online") Boolean online, @JsonProperty("avatar") String avatar) { + } + + public record MentionInfo(@JsonProperty("mention_part") List mentionPart, + @JsonProperty("mention_role_part") List mentionRolePart) { + public record MentionPart(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("full_name") String fullName, + @JsonProperty("avatar") String avatar) { + } + + public record MentionRolePart(@JsonProperty("role_id") Integer roleId, + @JsonProperty("name") String name, @JsonProperty("color") Integer color, + @JsonProperty("position") Integer position, + @JsonProperty("hoist") Integer hoist, + @JsonProperty("mentionable") Integer mentionable, + @JsonProperty("permissions") Integer permissions) { + } + } + } } } diff --git a/src/main/java/cn/enaium/kookstarter/model/response/UserChatListResponse.java b/src/main/java/cn/enaium/kookstarter/model/response/UserChatListResponse.java index 207f0ae..70b1e66 100644 --- a/src/main/java/cn/enaium/kookstarter/model/response/UserChatListResponse.java +++ b/src/main/java/cn/enaium/kookstarter/model/response/UserChatListResponse.java @@ -2,13 +2,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + /** * @author Enaium * @since 0.4.0 */ public record UserChatListResponse(@JsonProperty("code") Integer code, @JsonProperty("message") String message, @JsonProperty("data") Data data) { - public record Data(@JsonProperty("meta") Meta meta, @JsonProperty("sort") Sort sort) { + public record Data(@JsonProperty("items") List items, @JsonProperty("meta") Meta meta, + @JsonProperty("sort") Sort sort) { + public record Items(@JsonProperty("code") String code, + @JsonProperty("last_read_time") Long lastReadTime, + @JsonProperty("latest_msg_time") Long latestMsgTime, + @JsonProperty("unread_count") Integer unreadCount, + @JsonProperty("target_info") TargetInfo targetInfo) { + public record TargetInfo(@JsonProperty("id") String id, + @JsonProperty("username") String username, + @JsonProperty("online") Boolean online, @JsonProperty("avatar") String avatar) { + } + } + public record Meta(@JsonProperty("page") Integer page, @JsonProperty("page_total") Integer pageTotal, @JsonProperty("page_size") Integer pageSize, @JsonProperty("total") Integer total) { From b0f992f1bf90412cb636c2ef37c10caa715b53b5 Mon Sep 17 00:00:00 2001 From: Enaium Date: Mon, 1 Apr 2024 20:11:29 +0800 Subject: [PATCH 2/2] Update build.gradle.kts --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9e3a99f..08b19cd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ java { } group = "cn.enaium" -version = "0.4.0" +version = "0.4.1" repositories { mavenCentral()