This commit is contained in:
手瓜一十雪
2024-07-29 08:29:24 +08:00
parent 12f64d76fe
commit a034b9529d
5 changed files with 36 additions and 5 deletions

View File

@@ -0,0 +1,20 @@
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { NTQQMsgApi } from '@/core/apis';
const SchemaData = {
type: 'object',
properties: {
count: { type: 'number' },
}
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export class FetchCustomFace extends BaseAction<Payload, any> {
actionName = ActionName.FetchCustomFace;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
return await NTQQMsgApi.fetchFavEmojiList(payload.count || 48);
}
}

View File

@@ -75,6 +75,7 @@ import SetEssenceMsg from './group/SetEssenceMsg';
import GetRecentContact from './user/GetRecentContact';
import { GetProfileLike } from './extends/GetProfileLike';
import SetGroupHeader from './extends/SetGroupHeader';
import { FetchCustomFace } from './extends/FetchCustomFace';
export const actionHandlers = [
new RebootNormal(),
@@ -156,7 +157,8 @@ export const actionHandlers = [
new GetRecentContact(),
new MarkAllMsgAsRead(),
new GetProfileLike(),
new SetGroupHeader()
new SetGroupHeader(),
new FetchCustomFace()
];
function initActionMap() {

View File

@@ -99,5 +99,6 @@ export enum ActionName {
GetRecentContact = 'get_recent_contact',
_MarkAllMsgAsRead = '_mark_all_as_read',
GetProfileLike = 'get_profile_like',
SetGroupHeader = "set_group_head"
SetGroupHeader = "set_group_head",
FetchCustomFace = "fetch_custom_face"
}