From 3614a6e9327533588595b86fd758bca857d5a70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sat, 3 Aug 2024 16:08:23 +0800 Subject: [PATCH] chore: 9.9.15 support --- src/core/src/apis/user.ts | 21 ++- src/core/src/entities/user.ts | 171 ++++++++++++++++++ .../listeners/NodeIKernelProfileListener.ts | 7 +- 3 files changed, 191 insertions(+), 8 deletions(-) diff --git a/src/core/src/apis/user.ts b/src/core/src/apis/user.ts index d8885cbb..4f2b4b61 100644 --- a/src/core/src/apis/user.ts +++ b/src/core/src/apis/user.ts @@ -67,15 +67,15 @@ export class NTQQUserApi { // } static async fetchUserDetailInfo(uid: string) { type EventService = NodeIKernelProfileService['fetchUserDetailInfo']; - type EventListener = NodeIKernelProfileListener['onProfileDetailInfoChanged']; + type EventListener = NodeIKernelProfileListener['onUserDetailInfoChanged']; let [_retData, profile] = await NTEventDispatch.CallNormalEvent ( - 'NodeIKernelProfileService/getUserDetailInfoWithBizInfo', - 'NodeIKernelProfileListener/onProfileDetailInfoChanged', + 'NodeIKernelProfileService/fetchUserDetailInfo', + 'NodeIKernelProfileListener/onUserDetailInfoChanged', 2, 5000, - (profile: User) => { + (profile) => { if (profile.uid === uid) { return true; } @@ -90,10 +90,19 @@ export class NTQQUserApi { ProfileBizType.KALL ] ); - return profile; + let RetUser: User = { + ...profile.simpleInfo.baseInfo, + ...profile.simpleInfo.coreInfo, + ...profile.simpleInfo.status, + ...profile.commonExt, + ...profile.simpleInfo.vasInfo, + ...profile.simpleInfo.relationFlags, + ...profile.simpleInfo.otherFlags, + ...profile.simpleInfo.intimate + }; + return RetUser; } static async getUserDetailInfo(uid: string) { - //此处需要判断是否支持新接口 同时呢应该是临时方案 if (requireMinNTQBuild('26702')) { return this.fetchUserDetailInfo(uid); } diff --git a/src/core/src/entities/user.ts b/src/core/src/entities/user.ts index e0768a08..20f5ff37 100644 --- a/src/core/src/entities/user.ts +++ b/src/core/src/entities/user.ts @@ -9,7 +9,178 @@ export interface BuddyCategoryType { categroyMbCount: number; buddyList: User[]; } +interface CoreInfo { + uid: string; + uin: string; + nick: string; + remark: string; +} +interface BaseInfo { + qid: string; + longNick: string; + birthday_year: number; + birthday_month: number; + birthday_day: number; + age: number; + sex: number; + eMail: string; + phoneNum: string; + categoryId: number; + richTime: number; + richBuffer: string; +} + +interface MusicInfo { + buf: string; +} + +interface VideoBizInfo { + cid: string; + tvUrl: string; + synchType: string; +} + +interface VideoInfo { + name: string; +} + +interface ExtOnlineBusinessInfo { + buf: string; + customStatus: any; + videoBizInfo: VideoBizInfo; + videoInfo: VideoInfo; +} + +interface ExtBuffer { + buf: string; +} + +interface UserStatus { + uid: string; + uin: string; + status: number; + extStatus: number; + batteryStatus: number; + termType: number; + netType: number; + iconType: number; + customStatus: any; + setTime: string; + specialFlag: number; + abiFlag: number; + eNetworkType: number; + showName: string; + termDesc: string; + musicInfo: MusicInfo; + extOnlineBusinessInfo: ExtOnlineBusinessInfo; + extBuffer: ExtBuffer; +} + +interface PrivilegeIcon { + jumpUrl: string; + openIconList: any[]; + closeIconList: any[]; +} + +interface VasInfo { + vipFlag: boolean; + yearVipFlag: boolean; + svipFlag: boolean; + vipLevel: number; + bigClub: boolean; + bigClubLevel: number; + nameplateVipType: number; + grayNameplateFlag: number; + superVipTemplateId: number; + diyFontId: number; + pendantId: number; + pendantDiyId: number; + faceId: number; + vipFont: number; + vipFontType: number; + magicFont: number; + fontEffect: number; + newLoverDiamondFlag: number; + extendNameplateId: number; + diyNameplateIDs: any[]; + vipStartFlag: number; + vipDataFlag: number; + gameNameplateId: string; + gameLastLoginTime: string; + gameRank: number; + gameIconShowFlag: boolean; + gameCardId: string; + vipNameColorId: string; + privilegeIcon: PrivilegeIcon; +} + +interface RelationFlags { + topTime: string; + isBlock: boolean; + isMsgDisturb: boolean; + isSpecialCareOpen: boolean; + isSpecialCareZone: boolean; + ringId: string; + isBlocked: boolean; + recommendImgFlag: number; + disableEmojiShortCuts: number; + qidianMasterFlag: number; + qidianCrewFlag: number; + qidianCrewFlag2: number; + isHideQQLevel: number; + isHidePrivilegeIcon: number; +} + + +interface CommonExt { + constellation: number; + shengXiao: number; + kBloodType: number; + homeTown: string; + makeFriendCareer: number; + pos: string; + college: string; + country: string; + province: string; + city: string; + postCode: string; + address: string; + regTime: number; + interest: string; + labels: any[]; + qqLevel: QQLevel; +} + +interface Pic { + picId: string; + picTime: number; + picUrlMap: Record; +} + +interface PhotoWall { + picList: Pic[]; +} + +interface SimpleInfo { + uid: string; + uin: string; + coreInfo: CoreInfo; + baseInfo: BaseInfo; + status: UserStatus; + vasInfo: VasInfo; + relationFlags: RelationFlags; + otherFlags: any; + intimate: any; +} + +export interface UserDetailInfoListenerArg { + uid: string; + uin: string; + simpleInfo: SimpleInfo; + commonExt: CommonExt; + photoWall: PhotoWall; +} export interface ModifyProfileParams { nick: string, longNick: string, diff --git a/src/core/src/listeners/NodeIKernelProfileListener.ts b/src/core/src/listeners/NodeIKernelProfileListener.ts index ca621d3b..10212d07 100644 --- a/src/core/src/listeners/NodeIKernelProfileListener.ts +++ b/src/core/src/listeners/NodeIKernelProfileListener.ts @@ -1,8 +1,8 @@ -import { User } from '@/core/entities'; +import { User, UserDetailInfoListenerArg } from '@/core/entities'; interface IProfileListener { onProfileSimpleChanged(...args: unknown[]): void; - + onUserDetailInfoChanged(arg: UserDetailInfoListenerArg): void; onProfileDetailInfoChanged(profile: User): void; onStatusUpdate(...args: unknown[]): void; @@ -18,6 +18,9 @@ export interface NodeIKernelProfileListener extends IProfileListener { } export class ProfileListener implements IProfileListener { + onUserDetailInfoChanged(arg: UserDetailInfoListenerArg): void { + + } onProfileSimpleChanged(...args: unknown[]) { }