feat: support SetLongNick

This commit is contained in:
手瓜一十雪 2024-06-09 18:28:09 +08:00
parent c6d70ef1cf
commit 9ff82bdb90
3 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,24 @@
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: {
longNick: { type: 'string' },
},
required: [ 'longNick'],
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export class SetLongNick extends BaseAction<Payload, any> {
actionName = ActionName.SetSelfProfile;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
let ret = await NTQQUserApi.setLongNick(payload.longNick)
return ret;
}
}

View File

@ -69,6 +69,7 @@ import { DelGroupFileFolder } from './file/DelGroupFileFolder';
import { SetSelfProfile } from './extends/SetSelfProfile';
import { shareGroupEx, sharePeer } from './extends/sharePeer';
import { CreateCollection } from './extends/CreateCollection';
import { SetLongNick } from './extends/SetLongNick';
export const actionHandlers = [
new RebootNormal(),
@ -79,6 +80,7 @@ export const actionHandlers = [
new shareGroupEx(),
new sharePeer(),
new CreateCollection(),
new SetLongNick(),
// new GetConfigAction(),
// new SetConfigAction(),
// new GetGroupAddRequest(),

View File

@ -92,5 +92,6 @@ export enum ActionName {
IOCRImage = '.ocr_image',
SetSelfProfile = "set_self_profile",
CreateCollection = "create_collection",
GetCollectionList = "get_collection_list"
GetCollectionList = "get_collection_list",
SetLongNick = "set_self_longnick"
}