mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
Merge branch 'main' of https://github.com/NapNeko/NapCatQQ
This commit is contained in:
commit
b670c546b9
2
src/core
2
src/core
@ -1 +1 @@
|
|||||||
Subproject commit 0e7c9d43c4c401a2b34f4b5637d566a2ff27b7b7
|
Subproject commit e8dee74e8dcb1ed73dd3017d6759f14f68348173
|
@ -3,19 +3,24 @@ import { OB11Constructor } from '../../constructor';
|
|||||||
import BaseAction from '../BaseAction';
|
import BaseAction from '../BaseAction';
|
||||||
import { ActionName } from '../types';
|
import { ActionName } from '../types';
|
||||||
import { groups } from '@/common/data';
|
import { groups } from '@/common/data';
|
||||||
import {NTQQGroupApi} from "@/core/qqnt/apis";
|
import { NTQQGroupApi } from '@/core/qqnt/apis';
|
||||||
|
import { Group } from '@/core/qqnt/entities';
|
||||||
|
import { log } from '@/common/utils/log';
|
||||||
|
|
||||||
|
interface Payload {
|
||||||
|
no_cache: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
class GetGroupList extends BaseAction<null, OB11Group[]> {
|
class GetGroupList extends BaseAction<Payload, OB11Group[]> {
|
||||||
actionName = ActionName.GetGroupList;
|
actionName = ActionName.GetGroupList;
|
||||||
|
|
||||||
protected async _handle(payload: null) {
|
protected async _handle(payload: Payload) {
|
||||||
if (groups.size === 0) {
|
let groupList: Group[] = Array.from(groups.values());
|
||||||
//todo: get groups
|
if (groupList.length === 0) {
|
||||||
// const groups = await NTQQGroupApi.getGroups(true)
|
groupList = await NTQQGroupApi.getGroups(payload.no_cache === true);
|
||||||
// log("get groups", groups)
|
// log('get groups', groups);
|
||||||
}
|
}
|
||||||
return OB11Constructor.groups(Array.from(groups.values()));
|
return OB11Constructor.groups(groupList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user