Skip to content

Commit

Permalink
Merge pull request #13 from Enaium/develop
Browse files Browse the repository at this point in the history
0.4.2
  • Loading branch information
Enaium authored Sep 28, 2024
2 parents 0c3a74d + c6d1cf5 commit a9aa6e1
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ java {
}

group = "cn.enaium"
version = "0.4.1"
version = "0.4.2"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Mar 31 09:49:36 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public interface BadgeService {
* @since 0.4.0
*/
@GetExchange("/api/v3/badge/guild")
BadgeGuildResponse badgeGuild(@NotNull @RequestParam String guildId,
BadgeGuildResponse badgeGuild(@NotNull @RequestParam("guild_id") String guildId,
@Nullable @RequestParam(value = "style", required = false) Integer style);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface BlacklistService {
* @since 0.4.0
*/
@GetExchange("/api/v3/blacklist/list")
BlacklistListResponse blacklistList(@NotNull @RequestParam String guildId);
BlacklistListResponse blacklistList(@NotNull @RequestParam("guild_id") String guildId);

/**
* 加入黑名单
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface ChannelService {
ChannelListResponse channelList(
@Nullable @RequestParam(value = "page", required = false) Integer page,
@Nullable @RequestParam(value = "page_size", required = false) Integer pageSize,
@NotNull @RequestParam String guildId,
@NotNull @RequestParam("guild_id") String guildId,
@Nullable @RequestParam(value = "type", required = false) Integer type);

/**
Expand All @@ -39,7 +39,7 @@ ChannelListResponse channelList(
* @since 0.4.0
*/
@GetExchange("/api/v3/channel/view")
ChannelViewResponse channelView(@NotNull @RequestParam String targetId,
ChannelViewResponse channelView(@NotNull @RequestParam("target_id") String targetId,
@Nullable @RequestParam(value = "need_children", required = false) Boolean needChildren);

/**
Expand Down Expand Up @@ -76,7 +76,7 @@ ChannelViewResponse channelView(@NotNull @RequestParam String targetId,
* @since 0.4.0
*/
@GetExchange("/api/v3/channel/user-list")
ChannelUserListResponse channelUserList(@NotNull @RequestParam String channelId);
ChannelUserListResponse channelUserList(@NotNull @RequestParam("channel_id") String channelId);

/**
* 语音频道之间移动用户
Expand All @@ -94,7 +94,8 @@ ChannelViewResponse channelView(@NotNull @RequestParam String targetId,
* @since 0.4.0
*/
@GetExchange("/api/v3/channel-role/index")
ChannelRoleIndexResponse channelRoleIndex(@NotNull @RequestParam String channelId);
ChannelRoleIndexResponse channelRoleIndex(
@NotNull @RequestParam("channel_id") String channelId);

/**
* 创建频道角色权限
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ public interface ChannelUserService {
ChannelUserGetJoinedChannelResponse channelUserGetJoinedChannel(
@Nullable @RequestParam(value = "page", required = false) Integer page,
@Nullable @RequestParam(value = "page_size", required = false) Integer pageSize,
@NotNull @RequestParam String guildId, @NotNull @RequestParam String userId);
@NotNull @RequestParam("guild_id") String guildId,
@NotNull @RequestParam("user_id") String userId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ DirectMessageListResponse directMessageList(
* @since 0.4.0
*/
@GetExchange("/api/v3/direct-message/view")
DirectMessageViewResponse directMessageView(@NotNull @RequestParam String chatCode,
@NotNull @RequestParam String msgId);
DirectMessageViewResponse directMessageView(@NotNull @RequestParam("chat_code") String chatCode,
@NotNull @RequestParam("msg_id") String msgId);

/**
* 发送私信聊天消息
Expand Down Expand Up @@ -84,8 +84,9 @@ DirectMessageDeleteResponse directMessageDelete(
* @since 0.4.0
*/
@GetExchange("/api/v3/direct-message/reaction-list")
DirectMessageReactionListResponse directMessageReactionList(@NotNull @RequestParam String msgId,
@Nullable @RequestParam(value = "emoji", required = false) String emoji);
DirectMessageReactionListResponse directMessageReactionList(
@NotNull @RequestParam("msg_id") String msgId,
@Nullable @RequestParam(value = "emoji", required = false) String emoji);

/**
* 给某个消息添加回应
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface GuildEmojiService {
GuildEmojiListResponse guildEmojiList(
@Nullable @RequestParam(value = "page", required = false) Integer page,
@Nullable @RequestParam(value = "page_size", required = false) Integer pageSize,
@NotNull @RequestParam String guildId);
@NotNull @RequestParam("guild_id") String guildId);

/**
* 创建服务器表情
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface GuildRoleService {
* @since 0.4.0
*/
@GetExchange("/api/v3/guild-role/list")
GuildRoleListResponse guildRoleList(@NotNull @RequestParam String guildId,
GuildRoleListResponse guildRoleList(@NotNull @RequestParam("guild_id") String guildId,
@Nullable @RequestParam(value = "page", required = false) Integer page,
@Nullable @RequestParam(value = "page_size", required = false) Integer pageSize);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GuildListResponse guildList(
* @since 0.4.0
*/
@GetExchange("/api/v3/guild/view")
GuildViewResponse guildView(@NotNull @RequestParam String guildId);
GuildViewResponse guildView(@NotNull @RequestParam("guild_id") String guildId);

/**
* 获取服务器中的用户列表
Expand All @@ -54,7 +54,7 @@ GuildListResponse guildList(
* @since 0.4.0
*/
@GetExchange("/api/v3/guild/user-list")
GuildUserListResponse guildUserList(@NotNull @RequestParam String guildId,
GuildUserListResponse guildUserList(@NotNull @RequestParam("guild_id") String guildId,
@Nullable @RequestParam(value = "channel_id", required = false) String channelId,
@Nullable @RequestParam(value = "search", required = false) String search,
@Nullable @RequestParam(value = "role_id", required = false) Integer roleId,
Expand Down Expand Up @@ -100,7 +100,7 @@ GuildUserListResponse guildUserList(@NotNull @RequestParam String guildId,
* @since 0.4.0
*/
@GetExchange("/api/v3/guild-mute/list")
GuildMuteListResponse guildMuteList(@NotNull @RequestParam String guildId,
GuildMuteListResponse guildMuteList(@NotNull @RequestParam("guild_id") String guildId,
@Nullable @RequestParam(value = "return_type", required = false) String returnType);

/**
Expand Down Expand Up @@ -130,7 +130,7 @@ GuildMuteListResponse guildMuteList(@NotNull @RequestParam String guildId,
* @since 0.4.0
*/
@GetExchange("/api/v3/guild-boost/history")
GuildBoostHistoryResponse guildBoostHistory(@NotNull @RequestParam String guildId,
GuildBoostHistoryResponse guildBoostHistory(@NotNull @RequestParam("guild_id") String guildId,
@Nullable @RequestParam(value = "start_time", required = false) Integer startTime,
@Nullable @RequestParam(value = "end_time", required = false) Integer endTime);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface IntimacyService {
* @since 0.4.0
*/
@GetExchange("/api/v3/intimacy/index")
IntimacyIndexResponse intimacyIndex(@NotNull @RequestParam String userId);
IntimacyIndexResponse intimacyIndex(@NotNull @RequestParam("user_id") String userId);

/**
* 更新用户亲密度
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface MessageService {
* @since 0.4.0
*/
@GetExchange("/api/v3/message/list")
MessageListResponse messageList(@NotNull @RequestParam String targetId,
MessageListResponse messageList(@NotNull @RequestParam("target_id") String targetId,
@Nullable @RequestParam(value = "msg_id", required = false) String msgId,
@Nullable @RequestParam(value = "pin", required = false) Object pin,
@Nullable @RequestParam(value = "flag", required = false) String flag,
Expand All @@ -39,7 +39,7 @@ MessageListResponse messageList(@NotNull @RequestParam String targetId,
* @since 0.4.0
*/
@GetExchange("/api/v3/message/view")
MessageViewResponse messageView(@NotNull @RequestParam String msgId);
MessageViewResponse messageView(@NotNull @RequestParam("msg_id") String msgId);

/**
* 发送频道聊天消息
Expand Down Expand Up @@ -76,8 +76,8 @@ MessageListResponse messageList(@NotNull @RequestParam String targetId,
* @since 0.4.0
*/
@GetExchange("/api/v3/message/reaction-list")
MessageReactionListResponse messageReactionList(@NotNull @RequestParam String msgId,
@NotNull @RequestParam String emoji);
MessageReactionListResponse messageReactionList(@NotNull @RequestParam("msg_id") String msgId,
@NotNull @RequestParam("emoji") String emoji);

/**
* 给某个消息添加回应
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ UserChatListResponse userChatList(
* @since 0.4.0
*/
@GetExchange("/api/v3/user-chat/view")
UserChatViewResponse userChatView(@NotNull @RequestParam String chatCode);
UserChatViewResponse userChatView(@NotNull @RequestParam("chat_code") String chatCode);

/**
* 创建私信聊天会话
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/cn/enaium/kookstarter/model/event/ChannelEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public record D(@JsonProperty("channel_type") String channelType,
public record Extra(@JsonProperty("type") String type,
@JsonProperty("body") Body body) {
public record Body(@JsonProperty("channel_id") String channelId,
@JsonProperty("channel_type") Integer channelType,
@JsonProperty("emoji") Emoji emoji, @JsonProperty("user_id") String userId,
@JsonProperty("msg_id") String msgId) {
public record Emoji(@JsonProperty("id") String id,
Expand Down Expand Up @@ -57,7 +58,8 @@ public record Body(@JsonProperty("channel_id") String channelId,
@JsonProperty("mention_here") Boolean mentionHere,
@JsonProperty("mention_roles") List<Object> mentionRoles,
@JsonProperty("updated_at") Long updatedAt,
@JsonProperty("msg_id") String msgId) {
@JsonProperty("msg_id") String msgId,
@JsonProperty("channel_type") Integer channelType) {
}
}
}
Expand All @@ -81,7 +83,8 @@ public record D(@JsonProperty("channel_type") String channelType,
public record Extra(@JsonProperty("type") String type,
@JsonProperty("body") Body body) {
public record Body(@JsonProperty("channel_id") String channelId,
@JsonProperty("msg_id") String msgId) {
@JsonProperty("msg_id") String msgId,
@JsonProperty("channel_type") Integer channelType) {
}
}
}
Expand Down Expand Up @@ -160,7 +163,8 @@ public record D(@JsonProperty("channel_type") String channelType,
public record Extra(@JsonProperty("type") String type,
@JsonProperty("body") Body body) {
public record Body(@JsonProperty("id") String id,
@JsonProperty("deleted_at") Long deletedAt) {
@JsonProperty("deleted_at") Long deletedAt,
@JsonProperty("type") Integer type) {
}
}
}
Expand All @@ -185,7 +189,8 @@ public record Extra(@JsonProperty("type") String type,
@JsonProperty("body") Body body) {
public record Body(@JsonProperty("channel_id") String channelId,
@JsonProperty("operator_id") String operatorId,
@JsonProperty("msg_id") String msgId) {
@JsonProperty("msg_id") String msgId,
@JsonProperty("channel_type") Integer channelType) {
}
}
}
Expand All @@ -210,7 +215,8 @@ public record Extra(@JsonProperty("type") String type,
@JsonProperty("body") Body body) {
public record Body(@JsonProperty("channel_id") String channelId,
@JsonProperty("operator_id") String operatorId,
@JsonProperty("msg_id") String msgId) {
@JsonProperty("msg_id") String msgId,
@JsonProperty("channel_type") Integer channelType) {
}
}
}
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/cn/enaium/kookstarter/model/event/MessageEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public record Extra(@JsonProperty("type") Integer type,
@JsonProperty("mention_all") Boolean mentionAll,
@JsonProperty("mention_roles") List<Object> mentionRoles,
@JsonProperty("mention_here") Boolean mentionHere,
@JsonProperty("code") String code, @JsonProperty("author") Author author) {
@JsonProperty("code") String code, @JsonProperty("author") Author author,
@JsonProperty("channel_type") Integer channelType) {
public record Author(@JsonProperty("identify_num") String identifyNum,
@JsonProperty("avatar") String avatar,
@JsonProperty("username") String username, @JsonProperty("id") String id,
Expand Down Expand Up @@ -54,7 +55,8 @@ public record D(@JsonProperty("channel_type") String channelType,
public record Extra(@JsonProperty("type") Integer type,
@JsonProperty("code") String code, @JsonProperty("guild_id") String guildId,
@JsonProperty("attachments") Attachments attachments,
@JsonProperty("author") Author author) {
@JsonProperty("author") Author author,
@JsonProperty("channel_type") Integer channelType) {
public record Attachments(@JsonProperty("type") String type,
@JsonProperty("name") String name, @JsonProperty("url") String url) {
}
Expand Down Expand Up @@ -123,7 +125,8 @@ public record D(@JsonProperty("channel_type") String channelType,
public record Extra(@JsonProperty("type") Integer type,
@JsonProperty("guild_id") String guildId, @JsonProperty("code") String code,
@JsonProperty("attachments") Attachments attachments,
@JsonProperty("author") Author author) {
@JsonProperty("author") Author author,
@JsonProperty("channel_type") Integer channelType) {
public record Attachments(@JsonProperty("type") String type,
@JsonProperty("url") String url, @JsonProperty("name") String name,
@JsonProperty("file_type") String fileType,
Expand Down Expand Up @@ -164,7 +167,8 @@ public record Extra(@JsonProperty("type") Integer type,
@JsonProperty("mention_here") Boolean mentionHere,
@JsonProperty("nav_channels") List<Object> navChannels,
@JsonProperty("code") String code, @JsonProperty("author") Author author,
@JsonProperty("kmarkdown") Kmarkdown kmarkdown) {
@JsonProperty("kmarkdown") Kmarkdown kmarkdown,
@JsonProperty("channel_type") Integer channelType) {
public record Author(@JsonProperty("id") String id,
@JsonProperty("username") String username,
@JsonProperty("identify_num") String identifyNum,
Expand Down Expand Up @@ -210,7 +214,8 @@ public record Extra(@JsonProperty("type") Integer type,
@JsonProperty("mention_roles") List<Object> mentionRoles,
@JsonProperty("mention_here") Boolean mentionHere,
@JsonProperty("nav_channels") List<Object> navChannels,
@JsonProperty("code") String code, @JsonProperty("author") Author author) {
@JsonProperty("code") String code, @JsonProperty("author") Author author,
@JsonProperty("channel_type") Integer channelType) {
public record Author(@JsonProperty("id") String id,
@JsonProperty("username") String username,
@JsonProperty("identify_num") String identifyNum,
Expand Down Expand Up @@ -255,7 +260,8 @@ public record Data(@JsonProperty("user_id") String userId,
public record Extra(@JsonProperty("type") Integer type,
@JsonProperty("mention") List<String> mention,
@JsonProperty("author") Author author,
@JsonProperty("kmarkdown") Kmarkdown kmarkdown) {
@JsonProperty("kmarkdown") Kmarkdown kmarkdown,
@JsonProperty("channel_type") Integer channelType) {
public record Author(@JsonProperty("id") String id,
@JsonProperty("username") String username,
@JsonProperty("identify_num") String identifyNum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public record D(@JsonProperty("channel_type") String channelType,
@JsonProperty("verify_token") String verifyToken) {
public record Extra(@JsonProperty("type") String type,
@JsonProperty("body") Body body) {
public record Body(@JsonProperty("guild_id") String guildId) {
public record Body(@JsonProperty("guild_id") String guildId,
@JsonProperty("state") String state) {
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import com.fasterxml.jackson.annotation.JsonProperty;

import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Object;
import java.lang.String;
import java.util.List;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.fasterxml.jackson.annotation.JsonProperty;

import java.lang.Integer;
import java.lang.String;
import java.util.List;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.fasterxml.jackson.annotation.JsonProperty;

import java.lang.Integer;
import java.lang.String;
import java.util.List;

/**
Expand Down
Loading

0 comments on commit a9aa6e1

Please sign in to comment.