千星奇域抽卡记录获取

This commit is contained in:
BTMuli
2025-10-23 23:09:58 +08:00
parent c40b3c6ff0
commit 01e355b0d6
4 changed files with 149 additions and 46 deletions

View File

@@ -1,53 +1,59 @@
/**
* @file types/Game/Gacha.d.ts
* @description 游戏抽卡相关类型定义文件
* @since Beta v0.3.0
* @since Beta v0.8.4
*/
/**
* @description 游戏抽卡相关类型定义命名空间
* @since Beta v0.3.0
* @namespace TGApp.Game.Gacha
* @memberof TGApp.Game
*/
declare namespace TGApp.Game.Gacha {
/**
* @description 获取 authkey 返回类型
* @interface AuthkeyResponse
* @since Beta v0.3.0
* @interface AuthkeyResp
* @since Beta v0.8.4
* @extends TGApp.BBS.Response.BaseWithData
* @property {number} data.sign_type - 签名类型
* @property {number} data.authkey_ver - authkey 版本
* @property {string} data.authkey - authkey
* @return AuthkeyResponse
*/
interface AuthkeyResponse extends TGApp.BBS.Response.BaseWithData {
data: {
sign_type: number;
authkey_ver: number;
authkey: string;
};
}
type AuthkeyResp = TGApp.BBS.Response.BaseWithData<AuthkeyRes>;
/**
* @description 获取 authkey 数据类型
* @interface AuthkeyRes
* @since Beta v0.8.4
* @property {number} sign_type - 签名类型
* @property {number} authkey_ver - authkey 版本
* @property {string} authkey - authkey
*/
type AuthkeyRes = { sign_type: number; authkey_ver: number; authkey: string };
/**
* @description 获取抽卡记录返回类型
* @interface GachaLogResponse
* @since Beta v0.3.0
* @interface GachaLogResp
* @since Beta v0.8.4
* @extends TGApp.BBS.Response.BaseWithData
* @property {number} data.page - 页码
* @property {number} data.size - 每页大小
* @property {number} data.total - 总数
* @property {GachaItem[]} data.list - 抽卡记录列表
* @return GachaLogResponse
*/
interface GachaLogResponse extends TGApp.BBS.Response.BaseWithData {
data: {
page: number;
size: number;
total: number;
list: GachaItem[];
};
}
type GachaLogResp = TGApp.BBS.Response.BaseWithData<GachaLogRes>;
/**
* @description 获取千星奇域抽卡记录返回类型
* @interface GachaBLogResp
* @since Beta v0.8.4
* @extends TGApp.BBS.Response.BaseWithData
*/
type GachaBLogResp = TGApp.BBS.Response.BaseWithData<GachaBLogRes>;
/**
* @description 抽卡记录返回数据类型
* @interface GachaLogRes
* @since Beta v0.8.4
* @property {number} page - 页码
* @property {number} size - 每页大小
* @property {number} total - 总数
* @property {Array<GachaItem>} list - 抽卡记录列表
*/
type GachaLogRes = {
page: number;
size: number;
total: number;
list: Array<GachaItem>;
};
/**
* @description 抽卡记录类型
@@ -65,7 +71,7 @@ declare namespace TGApp.Game.Gacha {
* @property {string} id - 抽卡记录 id
* @return GachaItem
*/
interface GachaItem {
type GachaItem = {
uid: string;
gacha_type: string;
item_id: string;
@@ -76,5 +82,44 @@ declare namespace TGApp.Game.Gacha {
item_type: string;
rank_type: string;
id: number;
}
};
/**
* @description 千星奇域抽卡记录返回数据类型
* @interface GachaBLogRes
* @since Beta v0.8.4
* @property {Array<GachaBItem>} list - 页码
* @property {number} total - 总数
*/
type GachaBLogRes = { list: Array<GachaBItem>; total: number };
/**
* @description 千星奇域抽卡记录类型
* @interface GachaBItem
* @since Beta v0.8.4
* @property {string} id - 抽卡记录 id
* @property {string} is_up - 是否为UP池,0-否1-是
* @property {string} item_id - 物品 id
* @property {string} item_name - 物品名称
* @property {string} item_type - 物品类型
* @property {string} op_gacha_type - 抽卡类型,用于接口请求
* @property {string} rank_type - 星级
* @property {string} region - 区域
* @property {string} schedule_id - 排期ID
* @property {string} time - 抽卡时间格式yyyy-MM-dd HH:mm:ss
* @property {string} uid - 用户 uid
*/
type GachaBItem = {
id: string;
is_up: string;
item_id: string;
item_name: string;
item_type: string;
op_gacha_type: string;
rank_type: string;
region: string;
schedule_id: string;
time: string;
uid: string;
};
}