Refactor and standardize share and message history APIs
Standardized field names (e.g., 'reverseOrder' to 'reverse_order', 'phoneNumber' to 'phone_number') and added new action names and classes for sharing contacts and group cards (SendArkShare, SendGroupArkShare). Deprecated old action names, updated API schemas and routes, and ensured backward compatibility for legacy fields. Updated frontend API definitions to match backend changes.
This commit is contained in:
1 parent
f2ba789cc0
commit
d525f9b03d
7 files changed
+37
-19
No files matched your search
@@ -141,7 +141,7 @@ const oneBotHttpApiMessage = {
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
message_seq: z.union([z.string(), z.number()]).describe('消息序号'),
|
||||
count: z.number().int().positive().describe('获取数量'),
|
||||
reverseOrder: z.boolean().describe('是否倒序'),
|
||||
reverse_order: z.boolean().describe('是否倒序'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
@@ -166,7 +166,7 @@ const oneBotHttpApiMessage = {
|
||||
user_id: z.union([z.string(), z.number()]).describe('用户QQ号'),
|
||||
message_seq: z.union([z.string(), z.number()]).describe('消息序号'),
|
||||
count: z.number().int().positive().describe('获取数量'),
|
||||
reverseOrder: z.boolean().describe('是否倒序'),
|
||||
reverse_order: z.boolean().describe('是否倒序'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
|
||||
@@ -15,7 +15,7 @@ const oneBotHttpApiUser = {
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/ArkSharePeer': {
|
||||
'/send_ark_share': {
|
||||
description: '获取推荐好友/群聊卡片',
|
||||
request: z
|
||||
.object({
|
||||
@@ -27,7 +27,7 @@ const oneBotHttpApiUser = {
|
||||
.union([z.string(), z.number()])
|
||||
.optional()
|
||||
.describe('用户ID,与 group_id 二选一'),
|
||||
phoneNumber: z.string().optional().describe('对方手机号码'),
|
||||
phone_number: z.string().optional().describe('对方手机号码'),
|
||||
})
|
||||
.refine(
|
||||
(data) =>
|
||||
@@ -45,7 +45,7 @@ const oneBotHttpApiUser = {
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/ArkShareGroup': {
|
||||
'/send_group_ark_share': {
|
||||
description: '获取推荐群聊卡片',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群聊ID'),
|
||||
|
||||
Reference in new issue
Block a user