build: 1.5.9 - test2
This commit is contained in:
1 parent
d11ad0585b
commit
6cd2d14e85
47 files changed
+61
-63
No files matched your search
@@ -1,12 +1,22 @@
|
||||
import { rawFriends } from '@/core/data';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { BuddyCategoryType } from '@/core/entities/';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { NTQQFriendApi } from '@/core';
|
||||
|
||||
export class GetFriendWithCategory extends BaseAction<void, Array<BuddyCategoryType>> {
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
no_cache: { type: ['boolean', 'string'] },
|
||||
}
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetFriendWithCategory extends BaseAction<Payload, BuddyCategoryType[]> {
|
||||
actionName = ActionName.GetFriendsWithCategory;
|
||||
|
||||
protected async _handle(payload: void) {
|
||||
return rawFriends;
|
||||
protected async _handle(payload: Payload) {
|
||||
return await NTQQFriendApi.getFriendsRaw(payload?.no_cache?.toString() === 'true');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user