From 19ae21a20615e93bc83174ca8ce4f7e6303cebe3 Mon Sep 17 00:00:00 2001 From: 3944Realms Date: Sat, 16 Aug 2025 12:43:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86Req?= =?UTF-8?q?uest=E8=AF=B7=E6=B1=82=E6=8A=BD=E8=B1=A1=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/events/pycode.bat | 18 +++ python/requests/KtRequestGenerator.py | 105 ++++++++++++++++ python/requests/account/ktg.py | 53 ++++++++ python/requests/file/ktg.py | 28 +++++ python/requests/group/ktg.py | 53 ++++++++ python/requests/message/group/ktg.py | 14 +++ python/requests/message/ktg.py | 22 ++++ python/requests/message/personal/ktg.py | 14 +++ python/requests/other/ktg.py | 24 ++++ python/requests/passkey/ktg.py | 17 +++ python/requests/personal/ktg.py | 20 +++ python/requests/pycode.bat | 18 +++ python/requests/pycode.sh | 18 +++ python/requests/system/ktg.py | 42 +++++++ .../ltdmanager/napcat/data/{Qq.kt => QQ.kt} | 0 .../account/CreateCollectionRequest.kt | 26 ++++ .../requests/account/DeleteFriendRequest.kt | 39 ++++++ .../account/FetchCustomFaceRequest.kt | 18 +++ .../requests/account/GetFriendListRequest.kt | 16 +++ .../account/GetFriendsWithCategoryRequest.kt | 16 +++ .../requests/account/GetLoginInfoRequest.kt | 16 +++ .../requests/account/GetMiniAppArkRequest.kt | 119 ++++++++++++++++++ .../requests/account/GetModelShowRequest.kt | 18 +++ .../account/GetOnlineClientRequest.kt | 1 - .../requests/account/GetProfileLikeRequest.kt | 27 ++++ .../account/GetRecentContactRequest.kt | 21 ++++ .../requests/account/GetStatusRequest.kt | 32 +++++ .../account/GetStrangerInfoRequest.kt | 21 ++++ .../GetUnidirectionalFriendListRequest.kt | 18 +++ .../requests/account/MarkAllAsReadRequest.kt | 16 +++ .../account/MarkGroupMsgAsReadRequest.kt | 21 ++++ .../requests/account/MarkMsgAsReadRequest.kt | 2 +- .../account/MarkPrivateMsgAsReadRequest.kt | 21 ++++ .../account/NcGetUserStatusRequest.kt | 21 ++++ .../requests/account/SendLikeRequest.kt | 26 ++++ .../account/SetDiyOnlineStatusRequest.kt | 32 +++++ .../account/SetFriendAddRequestRequest.kt | 31 +++++ .../account/SetFriendRemarkRequest.kt | 26 ++++ .../requests/account/SetModelShowRequest.kt | 18 +++ .../requests/account/SetQQAvatarRequest.kt | 18 +++ .../account/SetSelfLongnickRequest.kt | 21 ++++ ...countRequest.kt => AbstractFileRequest.kt} | 4 +- .../napcat/requests/file/CleanCacheRequest.kt | 18 +++ .../file/CreateGroupFileFolderRequest.kt | 24 ++++ .../requests/file/DeleteGroupFileRequest.kt | 24 ++++ .../requests/file/DeleteGroupFolderRequest.kt | 24 ++++ .../requests/file/DownloadFileRequest.kt | 44 +++++++ .../napcat/requests/file/GetFileRequest.kt | 28 +++++ .../file/GetGroupFileSystemInfoRequest.kt | 21 ++++ .../requests/file/GetGroupFileUrlRequest.kt | 24 ++++ .../file/GetGroupFilesByFolderRequest.kt | 38 ++++++ .../requests/file/GetGroupRootFilesRequest.kt | 24 ++++ .../requests/file/GetPrivateFileUrlRequest.kt | 20 +++ .../requests/file/MoveGroupFileRequest.kt | 36 ++++++ .../requests/file/RenameGroupFileRequest.kt | 30 +++++ .../requests/file/TransGroupFileRequest.kt | 24 ++++ .../requests/file/UploadGroupFileRequest.kt | 36 ++++++ .../requests/file/UploadPrivateFileRequest.kt | 24 ++++ .../requests/group/DelGroupNoticeRequest.kt | 24 ++++ .../requests/group/DeleteEssenceMsgRequest.kt | 21 ++++ .../group/GetEssenceMsgListRequest.kt | 21 ++++ .../group/GetGroupAtAllRemainRequest.kt | 21 ++++ .../group/GetGroupDetailInfoRequest.kt | 22 ++++ .../group/GetGroupHonorInfoRequest.kt | 55 ++++++++ .../group/GetGroupIgnoredNotifiesRequest.kt | 14 +++ .../requests/group/GetGroupInfoExRequest.kt | 21 ++++ .../requests/group/GetGroupInfoRequest.kt | 21 ++++ .../requests/group/GetGroupListRequest.kt | 20 +++ .../group/GetGroupMemberInfoRequest.kt | 27 ++++ .../group/GetGroupMemberListRequest.kt | 27 ++++ .../requests/group/GetGroupNoticeRequest.kt | 21 ++++ .../requests/group/GetGroupShutListRequest.kt | 21 ++++ .../group/GetGroupSystemMsgRequest.kt | 18 +++ .../requests/group/SendGroupNoticeRequest.kt | 44 +++++++ .../requests/group/SendGroupSignRequest.kt | 21 ++++ .../requests/group/SetEssenceMsgRequest.kt | 21 ++++ .../group/SetGroupAddOptionRequest.kt | 30 +++++ .../group/SetGroupAddRequestRequest.kt | 33 +++++ .../requests/group/SetGroupAdminRequest.kt | 26 ++++ .../requests/group/SetGroupBanRequest.kt | 29 +++++ .../requests/group/SetGroupCardRequest.kt | 29 +++++ .../group/SetGroupKickMembersRequest.kt | 30 +++++ .../requests/group/SetGroupKickRequest.kt | 30 +++++ .../requests/group/SetGroupLeaveRequest.kt | 27 ++++ .../requests/group/SetGroupNameRequest.kt | 24 ++++ .../requests/group/SetGroupPortraitRequest.kt | 23 ++++ .../requests/group/SetGroupRemarkRequest.kt | 22 ++++ .../group/SetGroupRobotAddOptionRequest.kt | 27 ++++ .../requests/group/SetGroupSearchRequest.kt | 27 ++++ .../requests/group/SetGroupSignRequest.kt | 21 ++++ .../group/SetGroupSpecialTitleRequest.kt | 30 +++++ .../requests/group/SetGroupWholeBanRequest.kt | 23 ++++ 92 files changed, 2397 insertions(+), 4 deletions(-) create mode 100644 python/events/pycode.bat create mode 100644 python/requests/KtRequestGenerator.py create mode 100644 python/requests/account/ktg.py create mode 100644 python/requests/file/ktg.py create mode 100644 python/requests/group/ktg.py create mode 100644 python/requests/message/group/ktg.py create mode 100644 python/requests/message/ktg.py create mode 100644 python/requests/message/personal/ktg.py create mode 100644 python/requests/other/ktg.py create mode 100644 python/requests/passkey/ktg.py create mode 100644 python/requests/personal/ktg.py create mode 100644 python/requests/pycode.bat create mode 100644 python/requests/pycode.sh create mode 100644 python/requests/system/ktg.py rename src/main/kotlin/top/r3944realms/ltdmanager/napcat/data/{Qq.kt => QQ.kt} (100%) create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/CreateCollectionRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/DeleteFriendRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/FetchCustomFaceRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendListRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendsWithCategoryRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetLoginInfoRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetMiniAppArkRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetModelShowRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetProfileLikeRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetRecentContactRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStatusRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStrangerInfoRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetUnidirectionalFriendListRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkAllAsReadRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkGroupMsgAsReadRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkPrivateMsgAsReadRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/NcGetUserStatusRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SendLikeRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetDiyOnlineStatusRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendAddRequestRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendRemarkRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetModelShowRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetQQAvatarRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetSelfLongnickRequest.kt rename src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/{AbstractAccountRequest.kt => AbstractFileRequest.kt} (79%) create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CleanCacheRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CreateGroupFileFolderRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFolderRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DownloadFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileSystemInfoRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileUrlRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFilesByFolderRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupRootFilesRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetPrivateFileUrlRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/MoveGroupFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/RenameGroupFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/TransGroupFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadGroupFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadPrivateFileRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DelGroupNoticeRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DeleteEssenceMsgRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetEssenceMsgListRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupAtAllRemainRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupDetailInfoRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupHonorInfoRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupIgnoredNotifiesRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoExRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupListRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberInfoRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberListRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupNoticeRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupShutListRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupSystemMsgRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupNoticeRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupSignRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetEssenceMsgRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddOptionRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddRequestRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAdminRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupBanRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupCardRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickMembersRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupLeaveRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupNameRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupPortraitRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRemarkRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRobotAddOptionRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSearchRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSignRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSpecialTitleRequest.kt create mode 100644 src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupWholeBanRequest.kt diff --git a/python/events/pycode.bat b/python/events/pycode.bat new file mode 100644 index 0000000..95e0b84 --- /dev/null +++ b/python/events/pycode.bat @@ -0,0 +1,18 @@ +cd account +python ktg.py +cd ../file +python ktg.py +cd ../group +python ktg.py +cd ../message/personal +python ktg.py +cd ../group +python ktg.py +cd ../../personal +python ktg.py +cd ../passkey +python ktg.py +cd ../other +python ktg.py +cd ../system +python ktg.py \ No newline at end of file diff --git a/python/requests/KtRequestGenerator.py b/python/requests/KtRequestGenerator.py new file mode 100644 index 0000000..5d2ffe2 --- /dev/null +++ b/python/requests/KtRequestGenerator.py @@ -0,0 +1,105 @@ +# KtRequestGenerator.py +import os + +# Kotlin事件类模板 +kotlin_template_common = """ +package top.r3944realms.ltdmanager.napcat.requests.{path} + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * {request_description}请求 + */ +@Serializable +data class {class_name}( + +) : {super_class}Request() {{ + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/{original_name}" +}} +""" + +def path_to_class_name(api_path): + """将API路径转换为类名""" + # 移除斜杠和前缀下划线 + clean_path = api_path.lstrip('/').lstrip('_').replace('.','point_') + # 分割单词并转换为驼峰命名 + parts = clean_path.split('_') + return ''.join(part.capitalize() for part in parts) + "Request" + +def path_to_original_name(api_path): + """获取原始API名称(不带斜杠)""" + return api_path.lstrip('/') + +def request_description(class_name): + """生成请求描述""" + return class_name.replace("Request", "") + +def generate_kotlin_class(api_path, path0, super_class, template): + """生成完整的Kotlin类(通过自通过模板)""" + class_name = path_to_class_name(api_path) + original_name = path_to_original_name(api_path) + request_rdescription = request_description(class_name) + + return template.format( + path=path0, + class_name=class_name, + original_name=original_name, + request_description=request_rdescription, + super_class=super_class + ) + +def find_project_root(start_path=None, marker='.projectroot'): + """向上查找直到找到标记文件""" + if start_path is None: + start_path = os.path.abspath(__file__) + + current = os.path.dirname(start_path) + while True: + if marker in os.listdir(current): + return current + parent = os.path.dirname(current) + if parent == current: # 到达根目录 + raise FileNotFoundError(f"Project root marker '{marker}' not found") + current = parent + + +def generateRequestKt(path0, superclass0, apipaths, template = kotlin_template_common): + """ + 生成请求类文件 + :param path0: 包路径,如"account"或"message" + :param superclass0: 父类名,如"AbstractAccount"或"AbstractMessage" + :param apipaths: API路径列表 + :param template: 自提供模板(不提供则使用默认) + """ + # 创建输出目录 + root_path = find_project_root() + + path_ = path0.replace(".", "/") + output_dir = os.path.join( + root_path, + "src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests", + path_, + "wip" + ) + os.makedirs(output_dir, exist_ok=True) + + # 为每个API路径生成Kotlin文件 + for api_path in apipaths: + kotlin_code = generate_kotlin_class(api_path, path0, superclass0, template) + class_name = path_to_class_name(api_path) + filename = os.path.join(output_dir, f"{class_name}.kt") + + with open(filename, "w", encoding="utf-8") as f: + f.write(kotlin_code) + + print(f"Generated: {filename}") + + print(f"\nSuccessfully generated {len(apipaths)} Kotlin request classes in '{output_dir}' directory") + +# 确保方法可以被导入 +__all__ = ['generateRequestKt'] \ No newline at end of file diff --git a/python/requests/account/ktg.py b/python/requests/account/ktg.py new file mode 100644 index 0000000..9f8c76c --- /dev/null +++ b/python/requests/account/ktg.py @@ -0,0 +1,53 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import KtEventGenerator as kg +def main(): + api_paths = [ + # 账号信息管理 + "/set_qq_profile", # 设置账号信息 + "/set_qq_avatar", # 设置头像 + "/set_self_longnick", # 设置个性签名 + "/get_login_info", # 获取登录号信息 + "/get_stranger_info", # 获取账号信息(陌生人) + "/get_online_clients", # 获取在线客户端列表 + "/send_like", # 点赞 + "/get_profile_like", # 获取点赞列表 + "/create_collection", # 创建收藏 + "/fetch_custom_face", # 获取收藏表情 + "/get_recent_contact", # 获取最近消息列表 + + # 在线状态管理 + "/set_online_status", # 设置在线状态(10=在线,60=Q我) + "/set_diy_online_status", # 设置自定义在线状态 + "/get_status", # 获取状态(基础) + "/nc_get_user_status", # 获取用户状态(扩展) + "/_get_model_show", # 获取在线机型 + "/_set_model_show", # 设置在线机型 + + # 好友关系管理 + "/get_friend_list", # 获取好友列表 + "/get_unidirectional_friend_list", # 获取单向好友列表 + "/get_friends_with_category", # 获取好友分组列表 + "/set_friend_remark", # 设置好友备注 + "/delete_friend", # 删除好友 + "/set_friend_add_request", # 处理好友请求 + "/get_doubt_friends_add_request", # 获取被过滤好友请求 + "/set_doubt_friends_add_request", # 处理被过滤请求(调用即同意!) + + # 私聊消息状态 + "/mark_private_msg_as_read", # 设置私聊已读 + + # 消息状态控制 + "/mark_msg_as_read", # 设置消息已读(通用) + "/mark_group_msg_as_read", # 设置群聊已读 + "/_mark_all_as_read", # 设置所有消息已读 + + # 卡片与分享功能 + "/ArkSharePeer", # 获取推荐好友/群聊卡片 + "/ArkShareGroup", # 获取推荐群聊卡片 + "/get_mini_app_ark", # 获取小程序卡片 + ] + kg.generateEventKt("account", "AbstractAccount", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/file/ktg.py b/python/requests/file/ktg.py new file mode 100644 index 0000000..602bde1 --- /dev/null +++ b/python/requests/file/ktg.py @@ -0,0 +1,28 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + "/move_group_file", # 移动群文件 + "/trans_group_file", # 转存为永久文件 + "/rename_group_file", # 重命名群文件 + "/upload_group_file", # 上传群文件 + "/create_group_file_folder", # 创建群文件文件夹 + "/delete_group_file", # 删除群文件 + "/delete_group_folder", # 删除群文件夹 + "/get_group_file_system_info", # 获取群文件系统信息 + "/get_group_root_files", # 获取群根目录文件列表 + "/get_group_files_by_folder", # 获取群子目录文件列表 + "/get_group_file_url", # 获取群文件链接 + + "/upload_private_file", # 上传私聊文件 + "/get_private_file_url", # 获取私聊文件链接 + + "/get_file", # 获取文件信息(通用) + "/download_file", # 下载文件到缓存目录 + "/clean_cache" # 清空缓存 + ] + kg.generateRequestKt("file", "AbstractFile", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/group/ktg.py b/python/requests/group/ktg.py new file mode 100644 index 0000000..20e7e1a --- /dev/null +++ b/python/requests/group/ktg.py @@ -0,0 +1,53 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + # 群信息获取 + "/get_group_info", + "/get_group_info_ex", + "/get_group_detail_info", + "/get_group_list", + "/get_group_member_info", + "/get_group_member_list", + "/get_group_honor_info", + "/get_group_at_all_remain", + "/get_group_shut_list", + "/get_group_ignored_notifies", + "/get_group_system_msg", + "/get_essence_msg_list", + + # 群设置 + "/set_group_name", + "/set_group_portrait", + "/set_group_search", + "/set_group_add_option", + "/set_group_robot_add_option", + "/set_group_remark", + "/set_group_card", + "/set_group_special_title", + "/set_group_admin", + "/set_group_leave", + + # 群消息管理 + "/set_essence_msg", + "/delete_essence_msg", + "/_send_group_notice", + "/_get_group_notice", + "/_del_group_notice", + + # 群成员管理 + "/set_group_kick", + "/set_group_kick_members", + "/set_group_ban", + "/set_group_whole_ban", + "/set_group_sign", + "/send_group_sign", + + # 加群请求 + "/set_group_add_request" + ] + kg.generateRequestKt("group", "AbstractGroup", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/message/group/ktg.py b/python/requests/message/group/ktg.py new file mode 100644 index 0000000..3c789af --- /dev/null +++ b/python/requests/message/group/ktg.py @@ -0,0 +1,14 @@ +# ktg.py +import sys +sys.path.append("../..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + "/send_group_msg", # 发送群消息(文本、图片、表情、JSON、语音、视频、回复、音乐卡片等) + "/send_group_forward_msg", # 发送群合并转发消息 + "/forward_group_single_msg", # 转发单条消息到群 + "/group_poke" # 发送群聊戳一戳 + ] + kg.generateRequestKt("message.group", "AbstractGroup", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/message/ktg.py b/python/requests/message/ktg.py new file mode 100644 index 0000000..23c5a7b --- /dev/null +++ b/python/requests/message/ktg.py @@ -0,0 +1,22 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + "/send_poke", # 发送戳一戳(通用版,可能同时适用于群和私聊) + "/delete_msg", # 撤回消息 + "/get_group_msg_history", # 获取群历史消息 + "/get_friend_msg_history", # 获取好友历史消息 + "/get_msg", # 获取消息详情 + "/get_forward_msg", # 获取合并转发消息 + "/send_forward_msg", # 发送合并转发消息(通用版) + "/set_msg_emoji_like", # 贴表情(点赞表情) + "/fetch_emoji_like", # 获取贴表情详情 + "/get_record", # 获取语音消息详情 + "/get_image", # 获取图片消息详情 + "/send_group_ai_record" # 发送群AI语音 + ] + kg.generateRequestKt("message", "AbstractGroup", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/message/personal/ktg.py b/python/requests/message/personal/ktg.py new file mode 100644 index 0000000..e3c843f --- /dev/null +++ b/python/requests/message/personal/ktg.py @@ -0,0 +1,14 @@ +# ktg.py +import sys +sys.path.append("../..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + "/send_private_msg", # 发送私聊消息(文本、图片、表情、JSON、语音、视频、回复、音乐卡片等) + "/send_private_forward_msg", # 发送私聊合并转发消息 + "/forward_friend_single_msg", # 转发单条消息到私聊 + "/friend_poke" # 发送私聊戳一戳 + ] + kg.generateRequestKt("message.personal", "AbstractGroup", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/other/ktg.py b/python/requests/other/ktg.py new file mode 100644 index 0000000..4ee4b16 --- /dev/null +++ b/python/requests/other/ktg.py @@ -0,0 +1,24 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + # 保留 + "/send_private_msg", # send_private_msg + "/send_group_msg", # send_group_msg + "/send_msg", # send_msg + + # 接口 + "/unknown", # unknown + "/get_guild_list", # get_guild_list + "/get_guild_service_profile", # get_guild_service_profile + "/check_url_safely", # 检查链接安全性 + + #bug + "/get_collection_list", # 获取收藏列表 + "/get_group_ignore_add_request" # 获取被过滤的加群请求 + ] + kg.generateRequestKt("other", "AbstractOther", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/passkey/ktg.py b/python/requests/passkey/ktg.py new file mode 100644 index 0000000..1a72e13 --- /dev/null +++ b/python/requests/passkey/ktg.py @@ -0,0 +1,17 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + "/get_clientkey", # 获取 clientkey + "/get_cookies", # 获取 cookies + "/get_csrf_token", # 获取 CSRF Token + "/get_credentials", # 获取 QQ 相关接口凭证 + "/get_rkey", # 获取 rkey(通用) + "/nc_get_rkey", # nc获取rkey(可能是特殊渠道) + "/get_rkey_server" # 获取rkey服务(可能是服务端专用) + ] + kg.generateRequestKt("passkey", "AbstractPassKey", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/personal/ktg.py b/python/requests/personal/ktg.py new file mode 100644 index 0000000..ac289d8 --- /dev/null +++ b/python/requests/personal/ktg.py @@ -0,0 +1,20 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import requests.KtRequestGenerator as kg +def main(): + api_paths = [ + "/ocr_image", # OCR 图片识别 + "/.ocr_image", # .OCR 图片识别 + "/translate_en2zh", # 获取 CSRF Token + "/.handle_quick_operation", # .对事件执行快速操作 + "/can_send_image", # 检查是否可以发送图片 + "/can_send_record", # 检查是否可以发送语音 + "/get_ai_characters", # 获取AI语音人物 + "/click_inline_keyboard_button", # 点击按钮 + "/get_ai_record" # 获取AI语音 + "/set_input_status" # 设置输入状态 + ] + kg.generateRequestKt("personal", "AbstractPersonal", api_paths) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python/requests/pycode.bat b/python/requests/pycode.bat new file mode 100644 index 0000000..95e0b84 --- /dev/null +++ b/python/requests/pycode.bat @@ -0,0 +1,18 @@ +cd account +python ktg.py +cd ../file +python ktg.py +cd ../group +python ktg.py +cd ../message/personal +python ktg.py +cd ../group +python ktg.py +cd ../../personal +python ktg.py +cd ../passkey +python ktg.py +cd ../other +python ktg.py +cd ../system +python ktg.py \ No newline at end of file diff --git a/python/requests/pycode.sh b/python/requests/pycode.sh new file mode 100644 index 0000000..95e0b84 --- /dev/null +++ b/python/requests/pycode.sh @@ -0,0 +1,18 @@ +cd account +python ktg.py +cd ../file +python ktg.py +cd ../group +python ktg.py +cd ../message/personal +python ktg.py +cd ../group +python ktg.py +cd ../../personal +python ktg.py +cd ../passkey +python ktg.py +cd ../other +python ktg.py +cd ../system +python ktg.py \ No newline at end of file diff --git a/python/requests/system/ktg.py b/python/requests/system/ktg.py new file mode 100644 index 0000000..8166ce4 --- /dev/null +++ b/python/requests/system/ktg.py @@ -0,0 +1,42 @@ +# ktg.py +import sys +sys.path.append("..") # 添加父目录到模块搜索路径 +import KtEventGenerator as kg +def main(): + # Kotlin事件类模板 + kotlin_template_system = """ +package top.r3944realms.ltdmanager.napcat.events.{path} + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.Transient + +/** +* {event_description}事件 +* @property data 响应数据 +*/ +@Serializable +data class {class_name}( + +) : {super_class}Event() {{ + + override fun subtype(): String {{ + return "{original_name}" + }} +}} + """ + api_paths = [ + # 账号控制 + "/get_robot_uin_range", # 获取机器人可操作的账号范围(多账号托管时使用) + "/bot_exit", # 强制退出当前机器人账号(主动下线) + + # 协议级操作 + "/send_packet", # 发送原始协议数据包(需熟悉QQ协议格式) + "/nc_get_packet_status", # 查询自定义数据包的状态(如发送结果、回包状态) + + # 系统信息 + "/get_version_info" # 获取机器人框架/客户端的版本信息 + ] + kg.generateEventKt("system", "AbstractSystem", api_paths, kotlin_template_system) +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/data/Qq.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/data/QQ.kt similarity index 100% rename from src/main/kotlin/top/r3944realms/ltdmanager/napcat/data/Qq.kt rename to src/main/kotlin/top/r3944realms/ltdmanager/napcat/data/QQ.kt diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/CreateCollectionRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/CreateCollectionRequest.kt new file mode 100644 index 0000000..7e30ddb --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/CreateCollectionRequest.kt @@ -0,0 +1,26 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * CreateCollection请求 + */ +@Serializable +data class CreateCollectionRequest( + /** + * 标题 + */ + val brief: String, + + /** + * 内容 + */ + val rawData: String +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/create_collection" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/DeleteFriendRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/DeleteFriendRequest.kt new file mode 100644 index 0000000..f2cec3b --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/DeleteFriendRequest.kt @@ -0,0 +1,39 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * DeleteFriend请求 + */ +@Serializable +data class DeleteFriendRequest( + /** + * 同 user_id + */ + @SerialName("friend_id") + val friendId: ID? = null, + + /** + * 拉黑 + */ + @SerialName("temp_block") + val tempBlock: Boolean, + + /** + * 双向删除 + */ + @SerialName("temp_both_del") + val tempBothDel: Boolean, + + @SerialName("user_id") + val userId: ID? = null +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/delete_friend" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/FetchCustomFaceRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/FetchCustomFaceRequest.kt new file mode 100644 index 0000000..d56bf04 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/FetchCustomFaceRequest.kt @@ -0,0 +1,18 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * FetchCustomFace请求 + */ +@Serializable +data class FetchCustomFaceRequest( + val count: Double? = null +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/fetch_custom_face" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendListRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendListRequest.kt new file mode 100644 index 0000000..15b4737 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendListRequest.kt @@ -0,0 +1,16 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetFriendList请求 + */ +@Serializable +class GetFriendListRequest: AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_friend_list" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendsWithCategoryRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendsWithCategoryRequest.kt new file mode 100644 index 0000000..fe36047 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetFriendsWithCategoryRequest.kt @@ -0,0 +1,16 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetFriendsWithCategory请求 + */ +@Serializable +class GetFriendsWithCategoryRequest : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_friends_with_category" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetLoginInfoRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetLoginInfoRequest.kt new file mode 100644 index 0000000..cd2acab --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetLoginInfoRequest.kt @@ -0,0 +1,16 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetLoginInfo请求 + */ +@Serializable +class GetLoginInfoRequest : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_login_info" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetMiniAppArkRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetMiniAppArkRequest.kt new file mode 100644 index 0000000..8c55f12 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetMiniAppArkRequest.kt @@ -0,0 +1,119 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetMiniAppArk请求 + */ +@Serializable +data class GetMiniAppArkRequest( + /** + * 描述 + */ + val desc: String, + + /** + * 跳转URL + */ + @SerialName("jumpUrl") + val jumpURL: String, + + /** + * 图片URL + */ + @SerialName("picUrl") + val picURL: String, + + /** + * 是否返回原始ark数据 + */ + val rawArkData: Boolean? = null, + + /** + * 标题 + */ + val title: String, + + /** + * 类型 + */ + val type: Type? = null, + + /** + * 网页URL + */ + @SerialName("webUrl") + val webURL: String? = null, + + /** + * 应用ID + */ + @SerialName("appId") + val appId: String? = null, + + /** + * 业务类型 + */ + val businessType: ID? = null, + + /** + * 图标URL + */ + @SerialName("iconUrl") + val iconURL: String? = null, + + /** + * 场景 + */ + val scene: ID? = null, + + /** + * SDK ID + */ + @SerialName("sdkId") + val sdkId: String? = null, + + /** + * 分享类型 + */ + val shareType: ID? = null, + + /** + * 模板类型 + */ + val templateType: ID? = null, + + /** + * 版本ID + */ + @SerialName("versionId") + val versionId: String? = null, + + /** + * 版本类型 + */ + val verType: ID? = null, + + /** + * 是否分享 + */ + val withShareTicket: ID? = null +) : AbstractAccountRequest() { + + /** + * 类型 + */ + @Serializable + enum class Type(val value: String) { + @SerialName("bili") Bili("bili"), + @SerialName("weibo") Weibo("weibo"); + } + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_mini_app_ark" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetModelShowRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetModelShowRequest.kt new file mode 100644 index 0000000..5625bea --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetModelShowRequest.kt @@ -0,0 +1,18 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetModelShow请求 + */ +@Serializable +data class GetModelShowRequest( + val model: String +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/_get_model_show" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetOnlineClientRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetOnlineClientRequest.kt index b1f4548..ed23cd9 100644 --- a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetOnlineClientRequest.kt +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetOnlineClientRequest.kt @@ -2,7 +2,6 @@ package top.r3944realms.ltdmanager.napcat.requests.account import kotlinx.serialization.Serializable import top.r3944realms.ltdmanager.napcat.Developing -import top.r3944realms.ltdmanager.napcat.requests.NapCatRequest /** * 设置消息已读 diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetProfileLikeRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetProfileLikeRequest.kt new file mode 100644 index 0000000..165dfb6 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetProfileLikeRequest.kt @@ -0,0 +1,27 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetProfileLike请求 + */ +@Serializable +data class GetProfileLikeRequest( + val count: Double? = null, + val start: Double? = null, + + /** + * 指定用户,不填为获取所有 + */ + @SerialName("user_id") + val userId: ID? = null +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_profile_like" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetRecentContactRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetRecentContactRequest.kt new file mode 100644 index 0000000..fccb81b --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetRecentContactRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetRecentContact请求 + */ +@Serializable +data class GetRecentContactRequest( + /** + * 会话数量 + */ + val count: Double? = null +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_recent_contact" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStatusRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStatusRequest.kt new file mode 100644 index 0000000..43fa606 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStatusRequest.kt @@ -0,0 +1,32 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetStatus请求 + */ +@Serializable +data class GetStatusRequest( + /** + * 表情ID,表情ID + */ + @SerialName("face_id") + val faceId: ID, + + @SerialName("face_type") + val faceType: ID? = null, + + /** + * 描述文本 + */ + val wording: String? = null +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_status" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStrangerInfoRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStrangerInfoRequest.kt new file mode 100644 index 0000000..e98a01d --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetStrangerInfoRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetStrangerInfo请求 + */ +@Serializable +data class GetStrangerInfoRequest( + @SerialName("user_id") + val userId: ID +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_stranger_info" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetUnidirectionalFriendListRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetUnidirectionalFriendListRequest.kt new file mode 100644 index 0000000..0abe58f --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/GetUnidirectionalFriendListRequest.kt @@ -0,0 +1,18 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.Developing + +/** + * GetUnidirectionalFriendList请求 + */ +@Developing +@Serializable +class GetUnidirectionalFriendListRequest: AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_unidirectional_friend_list" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkAllAsReadRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkAllAsReadRequest.kt new file mode 100644 index 0000000..51a2f4f --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkAllAsReadRequest.kt @@ -0,0 +1,16 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * MarkAllAsRead请求 + */ +@Serializable +class MarkAllAsReadRequest: AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/_mark_all_as_read" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkGroupMsgAsReadRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkGroupMsgAsReadRequest.kt new file mode 100644 index 0000000..6922c71 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkGroupMsgAsReadRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * MarkGroupMsgAsRead请求 + */ +@Serializable +data class MarkGroupMsgAsReadRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/mark_group_msg_as_read" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkMsgAsReadRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkMsgAsReadRequest.kt index da6e8f5..17602ee 100644 --- a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkMsgAsReadRequest.kt +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkMsgAsReadRequest.kt @@ -16,7 +16,7 @@ data class MarkMsgAsReadRequest ( * 与user_id二选一 */ @SerialName("group_id") - val groupID: ID? = null, + val groupId: ID? = null, /** * 与group_id二选一 diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkPrivateMsgAsReadRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkPrivateMsgAsReadRequest.kt new file mode 100644 index 0000000..ee312a0 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/MarkPrivateMsgAsReadRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * MarkPrivateMsgAsRead请求 + */ +@Serializable +data class MarkPrivateMsgAsReadRequest( + @SerialName("user_id") + val userId: ID +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/mark_private_msg_as_read" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/NcGetUserStatusRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/NcGetUserStatusRequest.kt new file mode 100644 index 0000000..9c7c713 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/NcGetUserStatusRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * NcGetUserStatus请求 + */ +@Serializable +data class NcGetUserStatusRequest( + @SerialName("user_id") + val userId: ID +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/nc_get_user_status" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SendLikeRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SendLikeRequest.kt new file mode 100644 index 0000000..ba3235e --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SendLikeRequest.kt @@ -0,0 +1,26 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SendLike请求 + */ +@Serializable +data class SendLikeRequest( + /** + * 点赞次数 + */ + val times: Double? = null, + + @SerialName("user_id") + val userId: ID +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/send_like" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetDiyOnlineStatusRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetDiyOnlineStatusRequest.kt new file mode 100644 index 0000000..65d3599 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetDiyOnlineStatusRequest.kt @@ -0,0 +1,32 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetDiyOnlineStatus请求 + */ +@Serializable +data class SetDiyOnlineStatusRequest( + /** + * 表情ID,表情ID + */ + @SerialName("face_id") + val faceId: ID, + + @SerialName("face_type") + val faceType: ID? = null, + + /** + * 描述文本 + */ + val wording: String? = null +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_diy_online_status" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendAddRequestRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendAddRequestRequest.kt new file mode 100644 index 0000000..1c066ca --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendAddRequestRequest.kt @@ -0,0 +1,31 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * SetFriendAdd请求 + */ +@Serializable +data class SetFriendAddRequestRequest( + /** + * 是否同意 + */ + val approve: Boolean, + + /** + * 请求id + */ + val flag: String, + + /** + * 好友备注 + */ + val remark: String +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_friend_add_request" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendRemarkRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendRemarkRequest.kt new file mode 100644 index 0000000..e0886bc --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetFriendRemarkRequest.kt @@ -0,0 +1,26 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetFriendRemark请求 + */ +@Serializable +data class SetFriendRemarkRequest( + /** + * 备注名 + */ + val remark: String, + + @SerialName("user_id") + val userID: ID +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_friend_remark" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetModelShowRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetModelShowRequest.kt new file mode 100644 index 0000000..c7bf2ca --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetModelShowRequest.kt @@ -0,0 +1,18 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.Developing + +/** + * SetModelShow请求 + */ +@Developing +@Serializable +class SetModelShowRequest : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/_set_model_show" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetQQAvatarRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetQQAvatarRequest.kt new file mode 100644 index 0000000..73ac5b1 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetQQAvatarRequest.kt @@ -0,0 +1,18 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * SetQqAvatar请求 + */ +@Serializable +data class SetQQAvatarRequest( + val file:String +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_qq_avatar" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetSelfLongnickRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetSelfLongnickRequest.kt new file mode 100644 index 0000000..d3f1da9 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/account/SetSelfLongnickRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.account + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * SetSelfLongnick请求 + */ +@Serializable +data class SetSelfLongnickRequest( + /** + * 内容 + */ + val longNick: String +) : AbstractAccountRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_self_longnick" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/AbstractAccountRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/AbstractFileRequest.kt similarity index 79% rename from src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/AbstractAccountRequest.kt rename to src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/AbstractFileRequest.kt index b690802..4c7ca67 100644 --- a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/AbstractAccountRequest.kt +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/AbstractFileRequest.kt @@ -4,9 +4,9 @@ import kotlinx.serialization.Serializable import top.r3944realms.ltdmanager.napcat.requests.NapCatRequest @Serializable -abstract class AbstractAccountRequest +abstract class AbstractFileRequest : NapCatRequest() { override fun header(): String { - return "account" + return "file" } } \ No newline at end of file diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CleanCacheRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CleanCacheRequest.kt new file mode 100644 index 0000000..08c341d --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CleanCacheRequest.kt @@ -0,0 +1,18 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.Developing + +/** + * CleanCache请求 + */ +@Developing +@Serializable +class CleanCacheRequest : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/clean_cache" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CreateGroupFileFolderRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CreateGroupFileFolderRequest.kt new file mode 100644 index 0000000..55e81c7 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/CreateGroupFileFolderRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * CreateGroupFileFolder请求 + */ +@Serializable +data class CreateGroupFileFolderRequest( + @SerialName("folder_name") + val folderName: String, + + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/create_group_file_folder" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFileRequest.kt new file mode 100644 index 0000000..e4923cb --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFileRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * DeleteGroupFile请求 + */ +@Serializable +data class DeleteGroupFileRequest( + @SerialName("file_id") + val fileId: String, + + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/delete_group_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFolderRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFolderRequest.kt new file mode 100644 index 0000000..0ced247 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DeleteGroupFolderRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * DeleteGroupFolder请求 + */ +@Serializable +data class DeleteGroupFolderRequest( + @SerialName("folder_id") + val folderId: String, + + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/delete_group_folder" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DownloadFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DownloadFileRequest.kt new file mode 100644 index 0000000..9c4ecec --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/DownloadFileRequest.kt @@ -0,0 +1,44 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * DownloadFile请求 + */ +@Serializable +data class DownloadFileRequest( + /** + * 和url二选一 + */ + val base64: String? = null, + + /** + * 请求头 + */ + val headers: Headers? = null, + + /** + * 自定义文件名称 + */ + val name: String? = null, + + /** + * 下载地址 + */ + val url: String? = null +) : AbstractFileRequest() { + /** + * 请求头 + */ + @Serializable + sealed class Headers { + class StringArrayValue(val value: List) : Headers() + class StringValue(val value: String) : Headers() + } + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/download_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetFileRequest.kt new file mode 100644 index 0000000..f0722d4 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetFileRequest.kt @@ -0,0 +1,28 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetFile请求 + */ +@Serializable +data class GetFileRequest( + /** + * 二选一 + */ + val file: String? = null, + + /** + * 二选一 + */ + @SerialName("file_id") + val fileId: String? = null +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileSystemInfoRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileSystemInfoRequest.kt new file mode 100644 index 0000000..182708a --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileSystemInfoRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupFileSystemInfo请求 + */ +@Serializable +data class GetGroupFileSystemInfoRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_file_system_info" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileUrlRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileUrlRequest.kt new file mode 100644 index 0000000..01dc94d --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFileUrlRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupFileUrl请求 + */ +@Serializable +data class GetGroupFileUrlRequest( + @SerialName("file_id") + val fileId: String, + + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_file_url" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFilesByFolderRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFilesByFolderRequest.kt new file mode 100644 index 0000000..33a3df9 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupFilesByFolderRequest.kt @@ -0,0 +1,38 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupFilesByFolder请求 + */ +@Serializable +data class GetGroupFilesByFolderRequest( + /** + * 一次性获取的文件数量 + */ + @SerialName("file_count") + val fileCount: Double? = null, + + /** + * 和 folder_id 二选一 + */ + val folder: String? = null, + + /** + * 和 folder 二选一 + */ + @SerialName("folder_id") + val folderId: String? = null, + + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_files_by_folder" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupRootFilesRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupRootFilesRequest.kt new file mode 100644 index 0000000..e2001e6 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetGroupRootFilesRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupRootFiles请求 + */ +@Serializable +data class GetGroupRootFilesRequest( + @SerialName("file_count") + val fileCount: Double? = null, + + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_root_files" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetPrivateFileUrlRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetPrivateFileUrlRequest.kt new file mode 100644 index 0000000..52fd13a --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/GetPrivateFileUrlRequest.kt @@ -0,0 +1,20 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetPrivateFileUrl请求 + */ +@Serializable +data class GetPrivateFileUrlRequest( + @SerialName("file_id") + val fileID: String +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_private_file_url" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/MoveGroupFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/MoveGroupFileRequest.kt new file mode 100644 index 0000000..bbbf3c9 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/MoveGroupFileRequest.kt @@ -0,0 +1,36 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * MoveGroupFile请求 + */ +@Serializable +data class MoveGroupFileRequest( + /** + * 当前父目录,根目录填 / + */ + @SerialName("current_parent_directory") + val currentParentDirectory: String, + + @SerialName("file_id") + val fileId: String, + + @SerialName("group_id") + val groupId: ID, + + /** + * 目标父目录 + */ + @SerialName("target_parent_directory") + val targetParentDirectory: String +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/move_group_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/RenameGroupFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/RenameGroupFileRequest.kt new file mode 100644 index 0000000..a5d4534 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/RenameGroupFileRequest.kt @@ -0,0 +1,30 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * RenameGroupFile请求 + */ +@Serializable +data class RenameGroupFileRequest( + @SerialName("current_parent_directory") + val currentParentDirectory: String, + + @SerialName("file_id") + val fileId: String, + + @SerialName("group_id") + val groupId: ID, + + @SerialName("new_name") + val newName: String +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/rename_group_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/TransGroupFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/TransGroupFileRequest.kt new file mode 100644 index 0000000..0f0bf00 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/TransGroupFileRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * TransGroupFile请求 + */ +@Serializable +data class TransGroupFileRequest( + @SerialName("file_id") + val fileID: String, + + @SerialName("group_id") + val groupId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/trans_group_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadGroupFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadGroupFileRequest.kt new file mode 100644 index 0000000..0911e32 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadGroupFileRequest.kt @@ -0,0 +1,36 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * UploadGroupFile请求 + */ +@Serializable +data class UploadGroupFileRequest( + val file: String, + + /** + * 文件夹ID(二选一) + */ + val folder: String? = null, + + /** + * 文件夹ID(二选一) + */ + @SerialName("folder_id") + val folderId: String? = null, + + @SerialName("group_id") + val groupId: ID, + + val name: String +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/upload_group_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadPrivateFileRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadPrivateFileRequest.kt new file mode 100644 index 0000000..9513415 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/file/UploadPrivateFileRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.file + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * UploadPrivateFile请求 + */ +@Serializable +data class UploadPrivateFileRequest( + val file: String, + val name: String, + + @SerialName("user_id") + val userId: ID +) : AbstractFileRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/upload_private_file" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DelGroupNoticeRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DelGroupNoticeRequest.kt new file mode 100644 index 0000000..99346b9 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DelGroupNoticeRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * DelGroupNotice请求 + */ +@Serializable +data class DelGroupNoticeRequest( + @SerialName("group_id") + val groupId: ID, + + @SerialName("notice_id") + val noticeId: String +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/_del_group_notice" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DeleteEssenceMsgRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DeleteEssenceMsgRequest.kt new file mode 100644 index 0000000..2bc18b3 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/DeleteEssenceMsgRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * DeleteEssenceMsg请求 + */ +@Serializable +data class DeleteEssenceMsgRequest( + @SerialName("message_id") + val messageId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/delete_essence_msg" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetEssenceMsgListRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetEssenceMsgListRequest.kt new file mode 100644 index 0000000..5f2eb41 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetEssenceMsgListRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetEssenceMsgList请求 + */ +@Serializable +data class GetEssenceMsgListRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_essence_msg_list" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupAtAllRemainRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupAtAllRemainRequest.kt new file mode 100644 index 0000000..ad55c29 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupAtAllRemainRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupAtAllRemain请求 + */ +@Serializable +data class GetGroupAtAllRemainRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_at_all_remain" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupDetailInfoRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupDetailInfoRequest.kt new file mode 100644 index 0000000..8b26766 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupDetailInfoRequest.kt @@ -0,0 +1,22 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupDetailInfo请求 + */ +@Serializable +data class GetGroupDetailInfoRequest( + @SerialName("group_id") + val groupId: ID + +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_detail_info" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupHonorInfoRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupHonorInfoRequest.kt new file mode 100644 index 0000000..aa98df4 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupHonorInfoRequest.kt @@ -0,0 +1,55 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupHonorInfo请求 + */ +@Serializable +data class GetGroupHonorInfoRequest( + @SerialName("group_id") + val groupID: ID, + + /** + * 看详情 + */ + val type: Type? = Type.ALL +) : AbstractGroupRequest() { + @Serializable + enum class Type(val type: String) { + /** + * 所有(默认) + */ + @SerialName("all")ALL("all"), + + /** + * /群聊之火 + */ + @SerialName("talkactive")TALK_ACTIVE("talk_active"), + + /** + * 群聊炽焰 + */ + @SerialName("performer")PERFORMER("performer"), + /** + * 龙王 + */ + @SerialName("legend")LEGEND("legend"), + /** + * 冒尖小春笋(R.I.P) + */ + @SerialName("strong_newbie")STRONG_NEWBIE("strong_newbie"), + /** + * 快乐源泉 + */ + @SerialName("emotion")EMOTION("emotion") + } + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_honor_info" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupIgnoredNotifiesRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupIgnoredNotifiesRequest.kt new file mode 100644 index 0000000..9e4c09b --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupIgnoredNotifiesRequest.kt @@ -0,0 +1,14 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.Serializable + +/** + * GetGroupIgnoredNotifies请求 + */ +@Serializable +class GetGroupIgnoredNotifiesRequest: AbstractGroupRequest() { + override fun toJSON(): String = "{}" + + override fun path(): String = "/get_group_ignored_notifies" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoExRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoExRequest.kt new file mode 100644 index 0000000..bca3856 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoExRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupInfoEx请求 + */ +@Serializable +data class GetGroupInfoExRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_info_ex" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoRequest.kt new file mode 100644 index 0000000..b3e46cf --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupInfoRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupInfo请求 + */ +@Serializable +data class GetGroupInfoRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_info" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupListRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupListRequest.kt new file mode 100644 index 0000000..0a31344 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupListRequest.kt @@ -0,0 +1,20 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetGroupList请求 + */ +@Serializable +data class GetGroupListRequest( + @SerialName("no_cache") + val noCache: Boolean = false +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_list" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberInfoRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberInfoRequest.kt new file mode 100644 index 0000000..453f342 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberInfoRequest.kt @@ -0,0 +1,27 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupMemberInfo请求 + */ +@Serializable +data class GetGroupMemberInfoRequest( + @SerialName("group_id") + val groupId: ID, + + @SerialName("no_cache") + val noCache: Boolean, + + @SerialName("user_id") + val userId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_member_info" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberListRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberListRequest.kt new file mode 100644 index 0000000..01ea209 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupMemberListRequest.kt @@ -0,0 +1,27 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupMemberList请求 + */ +@Serializable +data class GetGroupMemberListRequest( + @SerialName("group_id") + val groupId: ID, + + @SerialName("no_cache") + val noCache: Boolean, + + @SerialName("user_id") + val userId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_member_list" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupNoticeRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupNoticeRequest.kt new file mode 100644 index 0000000..29eaae2 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupNoticeRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupNotice请求 + */ +@Serializable +data class GetGroupNoticeRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/_get_group_notice" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupShutListRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupShutListRequest.kt new file mode 100644 index 0000000..0f1aee5 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupShutListRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * GetGroupShutList请求 + */ +@Serializable +data class GetGroupShutListRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_shut_list" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupSystemMsgRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupSystemMsgRequest.kt new file mode 100644 index 0000000..f4edb29 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/GetGroupSystemMsgRequest.kt @@ -0,0 +1,18 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * GetGroupSystemMsg请求 + */ +@Serializable +data class GetGroupSystemMsgRequest( + val count: Int = 50 +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/get_group_system_msg" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupNoticeRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupNoticeRequest.kt new file mode 100644 index 0000000..e4f882d --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupNoticeRequest.kt @@ -0,0 +1,44 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SendGroupNotice请求 + */ +@Serializable +data class SendGroupNoticeRequest( + @SerialName("confirm_required") + val confirmRequired: ID? = null, + + /** + * 内容 + */ + val content: String, + + @SerialName("group_id") + val groupId: ID, + + /** + * 图片路径 + */ + val image: String? = null, + + @SerialName("is_show_edit_card") + val isShowEditCard: ID? = null, + + val pinned: ID? = null, + + @SerialName("tip_window_type") + val tipWindowType: ID? = null, + + val type: ID? = null +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/_send_group_notice" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupSignRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupSignRequest.kt new file mode 100644 index 0000000..152b8d8 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SendGroupSignRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SendGroupSign请求 + */ +@Serializable +data class SendGroupSignRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/send_group_sign" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetEssenceMsgRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetEssenceMsgRequest.kt new file mode 100644 index 0000000..4cfedaa --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetEssenceMsgRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetEssenceMsg请求 + */ +@Serializable +data class SetEssenceMsgRequest( + @SerialName("message_id") + val messageID: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_essence_msg" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddOptionRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddOptionRequest.kt new file mode 100644 index 0000000..d6434dd --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddOptionRequest.kt @@ -0,0 +1,30 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupAddOption请求 + */ +@Serializable +data class SetGroupAddOptionRequest( + @SerialName("add_type") + val addType: String, + + @SerialName("group_answer") + val groupAnswer: String? = null, + + @SerialName("group_id") + val groupId: ID, + + @SerialName("group_question") + val groupQuestion: String? = null +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_add_option" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddRequestRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddRequestRequest.kt new file mode 100644 index 0000000..e9e99e6 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAddRequestRequest.kt @@ -0,0 +1,33 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupAdd请求 + */ +@Serializable +data class SetGroupAddRequestRequest( + /** + * 是否同意 + */ + val approve: Boolean, + + /** + * 请求id + */ + val flag: String, + + /** + * 拒绝理由 + */ + val reason: String? = null +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_add_request" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAdminRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAdminRequest.kt new file mode 100644 index 0000000..b1bba42 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupAdminRequest.kt @@ -0,0 +1,26 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupAdmin请求 + */ +@Serializable +data class SetGroupAdminRequest( + val enable: Boolean, + + @SerialName("group_id") + val groupID: ID, + + @SerialName("user_id") + val userID: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_admin" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupBanRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupBanRequest.kt new file mode 100644 index 0000000..7e696ce --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupBanRequest.kt @@ -0,0 +1,29 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupBan请求 + */ +@Serializable +data class SetGroupBanRequest( + /** + * 禁言时间:秒 + */ + val duration: Double, + + @SerialName("group_id") + val groupId: ID, + + @SerialName("user_id") + val userId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_ban" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupCardRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupCardRequest.kt new file mode 100644 index 0000000..2ab61cd --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupCardRequest.kt @@ -0,0 +1,29 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupCard请求 + */ +@Serializable +data class SetGroupCardRequest( + /** + * 为空则为取消群名片 + */ + val card: String? = null, + + @SerialName("group_id") + val groupID: ID, + + @SerialName("user_id") + val userID: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_card" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickMembersRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickMembersRequest.kt new file mode 100644 index 0000000..958e2d7 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickMembersRequest.kt @@ -0,0 +1,30 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupKickMembers请求 + */ +@Serializable +data class SetGroupKickMembersRequest( + @SerialName("group_id") + val groupId: ID, + + /** + * 是否群拉黑 + */ + @SerialName("reject_add_request") + val rejectAddRequest: Boolean? = null, + + @SerialName("user_id") + val userId: List +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_kick_members" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickRequest.kt new file mode 100644 index 0000000..3c04e93 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupKickRequest.kt @@ -0,0 +1,30 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupKick请求 + */ +@Serializable +data class SetGroupKickRequest( + @SerialName("group_id") + val groupId: ID, + + /** + * 是否群拉黑 + */ + @SerialName("reject_add_request") + val rejectAddRequest: Boolean? = null, + + @SerialName("user_id") + val userId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_kick" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupLeaveRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupLeaveRequest.kt new file mode 100644 index 0000000..4528ede --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupLeaveRequest.kt @@ -0,0 +1,27 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupLeave请求 + */ +@Serializable +data class SetGroupLeaveRequest( + @SerialName("group_id") + val groupId: ID, + + /** + * 暂无作用 + */ + @SerialName("is_dismiss") + val isDismiss: Boolean? = null +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_leave" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupNameRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupNameRequest.kt new file mode 100644 index 0000000..08cc0a2 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupNameRequest.kt @@ -0,0 +1,24 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupName请求 + */ +@Serializable +data class SetGroupNameRequest( + @SerialName("group_id") + val groupId: ID, + + @SerialName("group_name") + val groupName: String +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_name" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupPortraitRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupPortraitRequest.kt new file mode 100644 index 0000000..845b1aa --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupPortraitRequest.kt @@ -0,0 +1,23 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupPortrait请求 + */ +@Serializable +data class SetGroupPortraitRequest( + val file: String, + + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_portrait" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRemarkRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRemarkRequest.kt new file mode 100644 index 0000000..875fccf --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRemarkRequest.kt @@ -0,0 +1,22 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +/** + * SetGroupRemark请求 + */ +@Serializable +data class SetGroupRemarkRequest( + @SerialName("group_id") + val groupId: String, + + val remark: String +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_remark" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRobotAddOptionRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRobotAddOptionRequest.kt new file mode 100644 index 0000000..d2559c6 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupRobotAddOptionRequest.kt @@ -0,0 +1,27 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupRobotAddOption请求 + */ +@Serializable +data class SetGroupRobotAddOptionRequest( + @SerialName("group_id") + val groupId: ID, + + @SerialName("robot_member_examine") + val robotMemberExamine: Double? = null, + + @SerialName("robot_member_switch") + val robotMemberSwitch: Double? = null +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_robot_add_option" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSearchRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSearchRequest.kt new file mode 100644 index 0000000..2372abf --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSearchRequest.kt @@ -0,0 +1,27 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupSearch请求 + */ +@Serializable +data class SetGroupSearchRequest( + @SerialName("group_id") + val groupId: ID, + + @SerialName("no_code_finger_open") + val noCodeFingerOpen: Double? = null, + + @SerialName("no_finger_open") + val noFingerOpen: Double? = null +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_search" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSignRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSignRequest.kt new file mode 100644 index 0000000..efb9aab --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSignRequest.kt @@ -0,0 +1,21 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupSign请求 + */ +@Serializable +data class SetGroupSignRequest( + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_sign" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSpecialTitleRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSpecialTitleRequest.kt new file mode 100644 index 0000000..648c6d9 --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupSpecialTitleRequest.kt @@ -0,0 +1,30 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupSpecialTitle请求 + */ +@Serializable +data class SetGroupSpecialTitleRequest( + @SerialName("group_id") + val groupID: ID, + + /** + * 为空则取消头衔 + */ + @SerialName("special_title") + val specialTitle: String? = null, + + @SerialName("user_id") + val userID: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_special_title" +} diff --git a/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupWholeBanRequest.kt b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupWholeBanRequest.kt new file mode 100644 index 0000000..3b119fb --- /dev/null +++ b/src/main/kotlin/top/r3944realms/ltdmanager/napcat/requests/group/SetGroupWholeBanRequest.kt @@ -0,0 +1,23 @@ + +package top.r3944realms.ltdmanager.napcat.requests.group + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import top.r3944realms.ltdmanager.napcat.data.ID + +/** + * SetGroupWholeBan请求 + */ +@Serializable +data class SetGroupWholeBanRequest( + val enable: Boolean, + + @SerialName("group_id") + val groupId: ID +) : AbstractGroupRequest() { + override fun toJSON(): String = Json.encodeToString(this) + + override fun path(): String = "/set_group_whole_ban" +}