chore: NTAPI

This commit is contained in:
手瓜一十雪
2024-08-09 12:58:00 +08:00
parent 166678505d
commit 27ffb3b1cf
10 changed files with 2210 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
import { napCatCore } from "..";
export class NTQQCollectionApi {
static async createCollection(authorUin: string, authorUid: string, authorName: string, brief: string, rawData: string) {
let param = {
commInfo: {
bid: 1,
category: 2,
author: {
type: 1,
numId: authorUin,
strId: authorName,
groupId: '0',
groupName: '',
uid: authorUid
},
customGroupId: '0',
createTime: Date.now().toString(),
sequence: Date.now().toString()
},
richMediaSummary: {
originalUri: '',
publisher: '',
richMediaVersion: 0,
subTitle: '',
title: '',
brief: brief,
picList: [],
contentType: 1
},
richMediaContent: {
rawData: rawData,
bizDataList: [],
picList: [],
fileList: []
},
need_share_url: false
};
return napCatCore.session.getCollectionService().createNewCollectionItem(param);
}
static async getAllCollection(category: number = 0, count: number = 50) {
let param = {
category: category,
groupId: -1,
forceSync: true,
forceFromDb: false,
timeStamp: "0",
count: count,
searchDown: true
};
return napCatCore.session.getCollectionService().getCollectionItemList(param);
}
}