build: 1.3.5-beta32

This commit is contained in:
手瓜一十雪
2024-05-18 12:56:03 +08:00
parent b5fba09f0d
commit 3e8d8817bb
15 changed files with 176 additions and 79 deletions

View File

@@ -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];