mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
修改<get_profile_like>接口
This commit is contained in:
parent
5f831958c3
commit
52b3540ec3
@ -18,7 +18,7 @@ export class NTQQUserApi {
|
|||||||
async getStatusByUid(uid: string) {
|
async getStatusByUid(uid: string) {
|
||||||
return this.context.session.getProfileService().getStatus(uid);
|
return this.context.session.getProfileService().getStatus(uid);
|
||||||
}
|
}
|
||||||
async getProfileLike(uid: string) {
|
async getProfileLike(uid: string, start: number, count: number) {
|
||||||
return this.context.session.getProfileLikeService().getBuddyProfileLike({
|
return this.context.session.getProfileLikeService().getBuddyProfileLike({
|
||||||
friendUids: [uid],
|
friendUids: [uid],
|
||||||
basic: 1,
|
basic: 1,
|
||||||
@ -26,8 +26,8 @@ export class NTQQUserApi {
|
|||||||
favorite: 0,
|
favorite: 0,
|
||||||
userProfile: 1,
|
userProfile: 1,
|
||||||
type: 2,
|
type: 2,
|
||||||
start: 0,
|
start: start,
|
||||||
limit: 20,
|
limit: count,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async fetchOtherProfileLike(uid: string) {
|
async fetchOtherProfileLike(uid: string) {
|
||||||
|
@ -1,15 +1,22 @@
|
|||||||
import BaseAction from '../BaseAction';
|
import BaseAction from '../BaseAction';
|
||||||
import { ActionName } from '../types';
|
import { ActionName, BaseCheckResult } from '../types';
|
||||||
|
|
||||||
export class GetProfileLike extends BaseAction<void, any> {
|
interface Payload {
|
||||||
|
start: number,
|
||||||
|
count: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GetProfileLike extends BaseAction<Payload, any> {
|
||||||
actionName = ActionName.GetProfileLike;
|
actionName = ActionName.GetProfileLike;
|
||||||
|
|
||||||
async _handle(payload: void) {
|
async _handle(payload: Payload) {
|
||||||
const ret = await this.core.apis.UserApi.getProfileLike(this.core.selfInfo.uid);
|
const start = payload.start ? Number(payload.start) : 0;
|
||||||
const listdata: any[] = ret.info.userLikeInfos[0].favoriteInfo.userInfos;
|
const count = payload.count ? Number(payload.count) : 10;
|
||||||
|
const ret = await this.core.apis.UserApi.getProfileLike(this.core.selfInfo.uid, start, count);
|
||||||
|
const listdata: any[] = ret.info.userLikeInfos[0].voteInfo.userInfos;
|
||||||
for (let i = 0; i < listdata.length; i++) {
|
for (let i = 0; i < listdata.length; i++) {
|
||||||
listdata[i].uin = parseInt((await this.core.apis.UserApi.getUinByUidV2(listdata[i].uid)) || '');
|
listdata[i].uin = parseInt((await this.core.apis.UserApi.getUinByUidV2(listdata[i].uid)) || '');
|
||||||
}
|
}
|
||||||
return listdata;
|
return ret.info.userLikeInfos[0].voteInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user