mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
chore: 兼容9.915 信息获取
This commit is contained in:
parent
f9e7de4b42
commit
931a0210e5
@ -6,7 +6,8 @@ import { NodeIKernelProfileListener, ProfileListener } from '@/core/listeners';
|
|||||||
import { RequestUtil } from '@/common/utils/request';
|
import { RequestUtil } from '@/common/utils/request';
|
||||||
import { logWarn } from '@/common/utils/log';
|
import { logWarn } from '@/common/utils/log';
|
||||||
import { NTEventDispatch } from '@/common/utils/EventTask';
|
import { NTEventDispatch } from '@/common/utils/EventTask';
|
||||||
import { NodeIKernelProfileService } from '@/core/services';
|
import { NodeIKernelProfileService, ProfileBizType, UserDetailSource } from '@/core/services';
|
||||||
|
import { requireMinNTQBuild } from '@/common/utils/QQBasicInfo';
|
||||||
|
|
||||||
export class NTQQUserApi {
|
export class NTQQUserApi {
|
||||||
static async getProfileLike(uid: string) {
|
static async getProfileLike(uid: string) {
|
||||||
@ -64,7 +65,41 @@ export class NTQQUserApi {
|
|||||||
// KQZONE,
|
// KQZONE,
|
||||||
// KOTHER
|
// KOTHER
|
||||||
// }
|
// }
|
||||||
|
static async fetchUserDetailInfo(uid: string) {
|
||||||
|
type EventService = NodeIKernelProfileService['fetchUserDetailInfo'];
|
||||||
|
type EventListener = NodeIKernelProfileListener['onProfileDetailInfoChanged'];
|
||||||
|
let [_retData, profile] = await NTEventDispatch.CallNormalEvent
|
||||||
|
<EventService, EventListener>
|
||||||
|
(
|
||||||
|
'NodeIKernelProfileService/getUserDetailInfoWithBizInfo',
|
||||||
|
'NodeIKernelProfileListener/onProfileDetailInfoChanged',
|
||||||
|
2,
|
||||||
|
5000,
|
||||||
|
(profile: User) => {
|
||||||
|
if (profile.uid === uid) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
"BuddyProfileStore",
|
||||||
|
[
|
||||||
|
uid
|
||||||
|
],
|
||||||
|
UserDetailSource.KDB,
|
||||||
|
[
|
||||||
|
ProfileBizType.KALL
|
||||||
|
]
|
||||||
|
);
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
static async getUserDetailInfo(uid: string) {
|
static async getUserDetailInfo(uid: string) {
|
||||||
|
//此处需要判断是否支持新接口 同时呢应该是临时方案
|
||||||
|
if (requireMinNTQBuild('26702')) {
|
||||||
|
return this.fetchUserDetailInfo(uid);
|
||||||
|
}
|
||||||
|
return this.getUserDetailInfoOld(uid);
|
||||||
|
}
|
||||||
|
static async getUserDetailInfoOld(uid: string) {
|
||||||
type EventService = NodeIKernelProfileService['getUserDetailInfoWithBizInfo'];
|
type EventService = NodeIKernelProfileService['getUserDetailInfoWithBizInfo'];
|
||||||
type EventListener = NodeIKernelProfileListener['onProfileDetailInfoChanged'];
|
type EventListener = NodeIKernelProfileListener['onProfileDetailInfoChanged'];
|
||||||
let [_retData, profile] = await NTEventDispatch.CallNormalEvent
|
let [_retData, profile] = await NTEventDispatch.CallNormalEvent
|
||||||
|
@ -2,8 +2,19 @@ import { AnyCnameRecord } from 'node:dns';
|
|||||||
import { BizKey, ModifyProfileParams, UserDetailInfoByUin } from '../entities';
|
import { BizKey, ModifyProfileParams, UserDetailInfoByUin } from '../entities';
|
||||||
import { NodeIKernelProfileListener } from '../listeners';
|
import { NodeIKernelProfileListener } from '../listeners';
|
||||||
import { GeneralCallResult } from '@/core/services/common';
|
import { GeneralCallResult } from '@/core/services/common';
|
||||||
|
export enum UserDetailSource {
|
||||||
|
KDB,
|
||||||
|
KSERVER
|
||||||
|
}
|
||||||
|
export enum ProfileBizType {
|
||||||
|
KALL,
|
||||||
|
KBASEEXTEND,
|
||||||
|
KVAS,
|
||||||
|
KQZONE,
|
||||||
|
KOTHER
|
||||||
|
}
|
||||||
export interface NodeIKernelProfileService {
|
export interface NodeIKernelProfileService {
|
||||||
|
fetchUserDetailInfo(trace: string, uids: string[], arg2: number, arg3: number[]): Promise<unknown>;
|
||||||
|
|
||||||
addKernelProfileListener(listener: NodeIKernelProfileListener): number;
|
addKernelProfileListener(listener: NodeIKernelProfileListener): number;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user