feat: support SetSelfProfile

This commit is contained in:
手瓜一十雪
2024-06-03 21:02:43 +08:00
parent 5a58890ae9
commit 439d34acba
44 changed files with 88 additions and 42 deletions

View File

@@ -0,0 +1,32 @@
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { NTQQUserApi } from '@/core/apis';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
const SchemaData = {
type: 'object',
properties: {
nick: { type: 'string' },
longNick: { type: 'string' },
sex: { type: 'number' }//传Sex值建议传0
},
required: ['nick', 'longNick', 'sex',],
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export class SetSelfProfile extends BaseAction<Payload, any | null> {
actionName = ActionName.SetSelfProfile;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
let ret = await NTQQUserApi.modifySelfProfile({
nick: payload.nick,
longNick: payload.longNick,
sex: payload.sex,
birthday: { birthday_year: '', birthday_month: '', birthday_day: '' },
location: undefined
});
return ret;
}
}

View File

@@ -87,5 +87,6 @@ export enum ActionName {
GetGroupSystemMsg = 'get_group_system_msg',
GetOnlineClient = 'get_online_clients',
OCRImage = 'ocr_image',
IOCRImage = '.ocr_image'
IOCRImage = '.ocr_image',
SetSelfProfile = "set_self_profile"
}