chore:action
This commit is contained in:
1 parent
013df1dbdd
commit
67d92c61f7
19 files changed
+48
-80
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { WebApi, WebApiGroupNoticeFeed, WebApiGroupNoticeRet } from '@/core/apis/webapi';
|
||||
import { WebApiGroupNoticeFeed } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -26,12 +26,15 @@ const SchemaData = {
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
type ApiGroupNotice = GroupNotice & WebApiGroupNoticeFeed;
|
||||
|
||||
export class GetGroupNotice extends BaseAction<Payload, GroupNotice[]> {
|
||||
actionName = ActionName.GoCQHTTP_GetGroupNotice;
|
||||
PayloadSchema = SchemaData;
|
||||
protected async _handle(payload: Payload) {
|
||||
const NTQQWebApi = this.CoreContext.getApiContext().WebApi;
|
||||
|
||||
const group = payload.group_id.toString();
|
||||
const ret = await WebApi.getGrouptNotice(group);
|
||||
const ret = await NTQQWebApi.getGroupNotice(group);
|
||||
if (!ret) {
|
||||
throw new Error('获取公告失败');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user