修改:协议和配置表

This commit is contained in:
chen wei bo
2025-09-08 15:11:11 +08:00
parent 5821bc17ae
commit 826e52d019
47 changed files with 12826 additions and 4127 deletions
@@ -53,30 +53,59 @@ export class GirlDetailConfig extends BaseConfig {
let oneData = this.getCommercialImagesById(id);
if (!oneData) return null;
return oneData.length;
}
/** 根据 id 和 index 获取图片类型 */
public getImageTypeById(id: number, index: number): number | null {
}
/** 根据 id 获取 commercialImages的id数组 */
public getCommercialImagesIds(id: number): number[] {
let oneData = this.getCommercialImagesById(id);
if (!oneData) return [];
// 获取所有 id
let allId = [];
for (let one of oneData) {
allId.push(one.id);
}
return allId;
}
/** 根据 id 获取 某一个commercialImage */
private getOneCommercialImageById(id: number, resId: number): any | null {
let oneData = this.getCommercialImagesById(id);
if (!oneData) return null;
if (index < 0 || index >= oneData.length) return null;
return oneData[index].imageType;
// 遍历数组找到匹配的资源
for (let one of oneData) {
if (one.id === resId) {
return one;
}
}
return null;
}
/** 根据 id 获取图片类型 */
public getImageTypeById(id: number, resId: number): number | null {
let oneData = this.getOneCommercialImageById(id, resId);
if (!oneData) return null;
return oneData.imageType;
}
/** 根据 id 和 index 获取图片价格 */
public getImagePriceById(id: number, index: number): number | null {
let oneData = this.getCommercialImagesById(id);
/** 根据 id 获取聊天触发次数 */
public getImageUnlockCountsById(id: number, resId: number): number | null {
let oneData = this.getOneCommercialImageById(id, resId);
if (!oneData) return null;
if (index < 0 || index >= oneData.length) return null;
return oneData[index].imagePrice;
return oneData.unlockCounts;
}
/** 根据 id 获取图片价格 */
public getImagePriceById(id: number, resId: number): number | null {
let oneData = this.getOneCommercialImageById(id, resId);
if (!oneData) return null;
return oneData.imagePrice;
}
/** 根据 id 和 index 获取图片路径 */
public getImagePathById(id: number, index: number): string | null {
let oneData = this.getCommercialImagesById(id);
/** 根据 id 获取图片路径 */
public getImagePathById(id: number, resId: number): string | null {
let oneData = this.getOneCommercialImageById(id, resId);
if (!oneData) return null;
if (index < 0 || index >= oneData.length) return null;
return oneData[index].path;
return oneData.path;
}
/** 根据 id 获取 commercialVideos */
@@ -93,27 +122,49 @@ export class GirlDetailConfig extends BaseConfig {
return oneData.length;
}
/** 根据 id 和 index 获取视频路径 */
public getVideoPathById(id: number, index: number): string | null {
/** 根据 id 获取 commercialVideo的id数组 */
public getCommercialVideosIds(id: number): number[] {
let oneData = this.getCommercialVideosById(id);
if (!oneData) return null;
if (index < 0 || index >= oneData.length) return null;
return oneData[index].path;
if (!oneData) return [];
// 获取所有 id
let allId = [];
for (let one of oneData) {
allId.push(one.id);
}
return allId;
}
/** 根据 id 和 index 获取关联情绪 */
public getVideoEmotionById(id: number, index: number): number | null {
/** 根据 id 获取 某一个commercialVideo */
private getOneCommercialVideoById(id: number, resId: number): any | null {
let oneData = this.getCommercialVideosById(id);
if (!oneData) return null;
if (index < 0 || index >= oneData.length) return null;
return oneData[index].emotion;
// 遍历数组找到匹配的资源
for (let one of oneData) {
if (one.id === resId) {
return one;
}
}
return null;
}
/** 根据 id 获取视频路径 */
public getVideoPathById(id: number, resId: number): string | null {
let oneData = this.getOneCommercialVideoById(id, resId);
if (!oneData) return null;
return oneData.path;
}
/** 根据 id 和 index 获取视频价格 */
public getVideoPriceById(id: number, index: number): number | null {
let oneData = this.getCommercialVideosById(id);
/** 根据 id 获取关联情绪 */
public getVideoEmotionById(id: number, resId: number): number | null {
let oneData = this.getOneCommercialVideoById(id, resId);
if (!oneData) return null;
if (index < 0 || index >= oneData.length) return null;
return oneData[index].videoPrice;
return oneData.emotion;
}
/** 根据 id 获取视频价格 */
public getVideoPriceById(id: number, resId: number): number | null {
let oneData = this.getOneCommercialVideoById(id, resId);
if (!oneData) return null;
return oneData.videoPrice;
}
}