refactor(onebot): give trans_group_file semantic param roles
Follow-up to #161: trans_group_file's group_id/file_id used plain f.uint()/f.string(); switch them to f.groupId()/f.fileId() (identical coercion) so the WebUI debug console renders a group picker + file-id control for the new action and the catalog carries the roles. Catalog regenerated.
This commit is contained in:
3 files changed
+14
-6
No files matched your search
@@ -9102,6 +9102,7 @@
|
|||||||
"name": "group_id",
|
"name": "group_id",
|
||||||
"type": "uint",
|
"type": "uint",
|
||||||
"required": true,
|
"required": true,
|
||||||
|
"role": "group_id",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 1
|
"minimum": 1
|
||||||
@@ -9111,6 +9112,7 @@
|
|||||||
"name": "file_id",
|
"name": "file_id",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"required": true,
|
"required": true,
|
||||||
|
"role": "file_id",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1
|
"minLength": 1
|
||||||
@@ -9123,11 +9125,13 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"group_id": {
|
"group_id": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 1
|
"minimum": 1,
|
||||||
|
"x-role": "group_id"
|
||||||
},
|
},
|
||||||
"file_id": {
|
"file_id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1
|
"minLength": 1,
|
||||||
|
"x-role": "file_id"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|||||||
@@ -9105,6 +9105,7 @@ export const ACTIONS: CatalogAction[] = [
|
|||||||
"name": "group_id",
|
"name": "group_id",
|
||||||
"type": "uint",
|
"type": "uint",
|
||||||
"required": true,
|
"required": true,
|
||||||
|
"role": "group_id",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 1
|
"minimum": 1
|
||||||
@@ -9114,6 +9115,7 @@ export const ACTIONS: CatalogAction[] = [
|
|||||||
"name": "file_id",
|
"name": "file_id",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"required": true,
|
"required": true,
|
||||||
|
"role": "file_id",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1
|
"minLength": 1
|
||||||
@@ -9126,11 +9128,13 @@ export const ACTIONS: CatalogAction[] = [
|
|||||||
"properties": {
|
"properties": {
|
||||||
"group_id": {
|
"group_id": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 1
|
"minimum": 1,
|
||||||
|
"x-role": "group_id"
|
||||||
},
|
},
|
||||||
"file_id": {
|
"file_id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1
|
"minLength": 1,
|
||||||
|
"x-role": "file_id"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|||||||
@@ -1639,8 +1639,8 @@ export const actions = [
|
|||||||
summary: '转存群文件',
|
summary: '转存群文件',
|
||||||
returns: '{ ok: true }',
|
returns: '{ ok: true }',
|
||||||
params: {
|
params: {
|
||||||
group_id: f.uint(),
|
group_id: f.groupId(),
|
||||||
file_id: f.string({ allowEmpty: false }),
|
file_id: f.fileId(),
|
||||||
},
|
},
|
||||||
run: async (p, ctx) => {
|
run: async (p, ctx) => {
|
||||||
await ctx.bridge.apis.groupFile.trans(p.group_id, p.file_id);
|
await ctx.bridge.apis.groupFile.trans(p.group_id, p.file_id);
|
||||||
|
|||||||
Reference in new issue
Block a user