mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
build: 1.3.5-beta32
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { NTQQFriendApi } from '@/core/apis/friend';
|
||||
import { friendRequests } from '@/core/data';
|
||||
|
||||
interface Payload {
|
||||
flag: string,
|
||||
approve: boolean,
|
||||
remark?: string,
|
||||
}
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
flag: { type: 'string' },
|
||||
approve: { type: 'boolean' },
|
||||
remark: { type: 'string' }
|
||||
},
|
||||
required: ['flag','approve']
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetFriendAddRequest extends BaseAction<Payload, null> {
|
||||
actionName = ActionName.SetFriendAddRequest;
|
||||
|
||||
PayloadSchema = SchemaData;
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
const approve = payload.approve.toString() === 'true';
|
||||
const request = friendRequests[payload.flag];
|
||||
|
||||
Reference in New Issue
Block a user