技师数据增加方法:判断具体数据是否存在
This commit is contained in:
@@ -176,6 +176,13 @@ export class GirlData extends BaseData {
|
||||
return b.briefs.get(girlId) ?? null;
|
||||
}
|
||||
|
||||
/** 技师的简要信息是否存在 */
|
||||
public isGirlBriefIn(categoryId: string, girlId: number): boolean {
|
||||
const b = this.ensureCategories().get(categoryId);
|
||||
if (!b) return false;
|
||||
return b.briefs.has(girlId);
|
||||
}
|
||||
|
||||
/** 获取名字键 */
|
||||
public getGrilName(categoryId: string, girlId: number): string {
|
||||
let oneData = this.getGrilBrief(categoryId, girlId);
|
||||
@@ -286,6 +293,13 @@ export class GirlData extends BaseData {
|
||||
}
|
||||
}
|
||||
|
||||
/** 技师的详细信息是否存在 */
|
||||
public isGirlDetailIn(categoryId: string, girlId: number): boolean {
|
||||
const b = this.ensureCategories().get(categoryId);
|
||||
if (!b) return false;
|
||||
return b.details.has(girlId);
|
||||
}
|
||||
|
||||
/** 取某分类 + girlId 的详细数据 */
|
||||
public getGrilDetail(
|
||||
categoryId: string,
|
||||
@@ -666,6 +680,13 @@ export class GirlData extends BaseData {
|
||||
return b.unlocks.get(girlId) ?? null;
|
||||
}
|
||||
|
||||
/** 技师的解锁数据是否存在 */
|
||||
public isGirlUnlockIn(categoryId: string, girlId: number): boolean {
|
||||
const b = this.ensureCategories().get(categoryId);
|
||||
if (!b) return false;
|
||||
return b.unlocks.has(girlId);
|
||||
}
|
||||
|
||||
/** 获取 付费技师是否已经解锁 */
|
||||
public getIsRelease(categoryId: string, girlId: number): boolean {
|
||||
let oneData = this.getGrilUnlock(categoryId, girlId);
|
||||
@@ -765,6 +786,13 @@ export class GirlData extends BaseData {
|
||||
return b.chats.get(girlId) ?? null;
|
||||
}
|
||||
|
||||
/** 技师的聊天数据是否存在 */
|
||||
public isGirlChatIn(categoryId: string, girlId: number): boolean {
|
||||
const b = this.ensureCategories().get(categoryId);
|
||||
if (!b) return false;
|
||||
return b.chats.has(girlId);
|
||||
}
|
||||
|
||||
/** 获取总聊天次数 */
|
||||
public getChatTotalCount(categoryId: string, girlId: number): number {
|
||||
let oneData = this.getGrilChat(categoryId, girlId);
|
||||
@@ -889,6 +917,13 @@ export class GirlData extends BaseData {
|
||||
return b.favorability.get(girlId) ?? null;
|
||||
}
|
||||
|
||||
/** 技师的好感度数据是否存在 */
|
||||
public isGirlFavorabilityIn(categoryId: string, girlId: number): boolean {
|
||||
const b = this.ensureCategories().get(categoryId);
|
||||
if (!b) return false;
|
||||
return b.favorability.has(girlId);
|
||||
}
|
||||
|
||||
/** 获取星级 */
|
||||
public getStar(categoryId: string, girlId: number): number {
|
||||
let oneData = this.getGrilFavorability(categoryId, girlId);
|
||||
@@ -906,6 +941,13 @@ export class GirlData extends BaseData {
|
||||
console.log("保存每日推荐: ", bucket);
|
||||
}
|
||||
|
||||
/** 判断每日推荐是否存在 */
|
||||
public isDailyRecommendIn(): boolean {
|
||||
const bucket = this.ensureCategories().get(DAILY_BUCKET);
|
||||
if (!bucket) return false;
|
||||
return bucket.girlIds.length > 0;
|
||||
}
|
||||
|
||||
/** 获取推荐id */
|
||||
public getRecommendGirlId(): number {
|
||||
const bucket = this.ensureBucket(DAILY_BUCKET);
|
||||
|
||||
Reference in New Issue
Block a user