mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-31 14:59:05 +08:00
25 lines
750 B
TypeScript
25 lines
750 B
TypeScript
import BaseAction from '../BaseAction';
|
|
import { ActionName } from '../types';
|
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
|
const SchemaData = {
|
|
type: 'object',
|
|
properties: {
|
|
category: { type: 'number' },
|
|
count: { type: 'number' },
|
|
},
|
|
required: ['category', 'count'],
|
|
} as const satisfies JSONSchema;
|
|
|
|
type Payload = FromSchema<typeof SchemaData>;
|
|
|
|
export class GetCollectionList extends BaseAction<Payload, any> {
|
|
actionName = ActionName.GetCollectionList;
|
|
PayloadSchema = SchemaData;
|
|
|
|
async _handle(payload: Payload) {
|
|
const NTQQCollectionApi = this.CoreContext.apis.CollectionApi;
|
|
return await NTQQCollectionApi.getAllCollection(payload.category, payload.count);
|
|
}
|
|
}
|