Files
huya-go/frontend/wailsjs/go/models.ts
T
yml2213 29aed15e4e 版本号 0.3.0 并补齐 timeSync 生成绑定
- internal/version/version.go:0.2.1 -> 0.3.0。版本号单一来源,exe 文件名、编译注入(-ldflags)与界面左下角标签共用这一处
- wails.json:info.productVersion 同步为 0.3.0(只影响 exe 文件属性)
- frontend/wailsjs/go/models.ts:补上 gui.Config.timeSync 字段。这个绑定只有 wails build 会生成(npm run build 不会),所以上一版加 TimeSync 时漏提交了
- 已执行 ./scripts/build-windows.sh 产出 build/bin/huya-gui-v0.3.0.exe(PE32+ GUI x86-64,内嵌版本号 0.3.0)
2026-10-16 16:15:17 +08:00

622 lines
18 KiB
TypeScript
Executable File

export namespace gui {
export class AccountPreview {
line: number;
uid: number;
valid: boolean;
error?: string;
static createFrom(source: any = {}) {
return new AccountPreview(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.line = source["line"];
this.uid = source["uid"];
this.valid = source["valid"];
this.error = source["error"];
}
}
export class Config {
transport: string;
wssHost: string;
sid: number;
pid: number;
category: string;
name: string;
targetText: string;
maxPrice: number;
minLeft: number;
cookieText: string;
selectedAccountLines: number[];
loops: number;
delayMs: number;
concurrency: number;
stopAfterSuccess: boolean;
stopAccountAfterSuccess: boolean;
prewarm: boolean;
directExchange: boolean;
sharePrizeList: boolean;
autoSelect: boolean;
refreshAfterSuccess: boolean;
leadMs: number;
timeSync: boolean;
frequentBackoffMs: number;
errorBackoffMs: number;
timeoutSec: number;
startAt: string;
static createFrom(source: any = {}) {
return new Config(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.transport = source["transport"];
this.wssHost = source["wssHost"];
this.sid = source["sid"];
this.pid = source["pid"];
this.category = source["category"];
this.name = source["name"];
this.targetText = source["targetText"];
this.maxPrice = source["maxPrice"];
this.minLeft = source["minLeft"];
this.cookieText = source["cookieText"];
this.selectedAccountLines = source["selectedAccountLines"];
this.loops = source["loops"];
this.delayMs = source["delayMs"];
this.concurrency = source["concurrency"];
this.stopAfterSuccess = source["stopAfterSuccess"];
this.stopAccountAfterSuccess = source["stopAccountAfterSuccess"];
this.prewarm = source["prewarm"];
this.directExchange = source["directExchange"];
this.sharePrizeList = source["sharePrizeList"];
this.autoSelect = source["autoSelect"];
this.refreshAfterSuccess = source["refreshAfterSuccess"];
this.leadMs = source["leadMs"];
this.timeSync = source["timeSync"];
this.frequentBackoffMs = source["frequentBackoffMs"];
this.errorBackoffMs = source["errorBackoffMs"];
this.timeoutSec = source["timeoutSec"];
this.startAt = source["startAt"];
}
}
export class ExchangeResult {
uid: number;
resp?: huya.ScoreExchangePrizeResp;
category?: string;
message?: string;
error?: string;
static createFrom(source: any = {}) {
return new ExchangeResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
this.resp = this.convertValues(source["resp"], huya.ScoreExchangePrizeResp);
this.category = source["category"];
this.message = source["message"];
this.error = source["error"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class InstanceInfo {
name: string;
id: string;
dataDir: string;
logDir: string;
logFile: string;
static createFrom(source: any = {}) {
return new InstanceInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
this.id = source["id"];
this.dataDir = source["dataDir"];
this.logDir = source["logDir"];
this.logFile = source["logFile"];
}
}
export class LogStats {
level: string;
filePath: string;
dir: string;
dropped: number;
count: number;
static createFrom(source: any = {}) {
return new LogStats(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.level = source["level"];
this.filePath = source["filePath"];
this.dir = source["dir"];
this.dropped = source["dropped"];
this.count = source["count"];
}
}
export class PrizeListResult {
uid: number;
status: number;
msg: string;
prizes: huya.PrizeInfo[];
categories: huya.PrizeTag[];
categoryStats: huya.CategoryStat[];
raw?: huya.GetActPrizeListResp;
static createFrom(source: any = {}) {
return new PrizeListResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
this.status = source["status"];
this.msg = source["msg"];
this.prizes = this.convertValues(source["prizes"], huya.PrizeInfo);
this.categories = this.convertValues(source["categories"], huya.PrizeTag);
this.categoryStats = this.convertValues(source["categoryStats"], huya.CategoryStat);
this.raw = this.convertValues(source["raw"], huya.GetActPrizeListResp);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class RecordResult {
uid: number;
records: huya.UserPrizeInfo[];
resp?: huya.GetUserPrizeRecordsResp;
error?: string;
static createFrom(source: any = {}) {
return new RecordResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
this.records = this.convertValues(source["records"], huya.UserPrizeInfo);
this.resp = this.convertValues(source["resp"], huya.GetUserPrizeRecordsResp);
this.error = source["error"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class ScoreResult {
uid: number;
score: number;
resp?: huya.GetUserScoreResp;
error?: string;
static createFrom(source: any = {}) {
return new ScoreResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
this.score = source["score"];
this.resp = this.convertValues(source["resp"], huya.GetUserScoreResp);
this.error = source["error"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}
export namespace huya {
export class ActPreCondition {
condition_type: number;
condition_params?: Record<string, string>;
tip?: string;
jump_url?: string;
button_desc?: string;
static createFrom(source: any = {}) {
return new ActPreCondition(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.condition_type = source["condition_type"];
this.condition_params = source["condition_params"];
this.tip = source["tip"];
this.jump_url = source["jump_url"];
this.button_desc = source["button_desc"];
}
}
export class CategoryStat {
id: number;
name: string;
count: number;
left: number;
total: number;
static createFrom(source: any = {}) {
return new CategoryStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.name = source["name"];
this.count = source["count"];
this.left = source["left"];
this.total = source["total"];
}
}
export class ExchangeInfo {
pid: number;
exchange_score: number;
desc: string;
static createFrom(source: any = {}) {
return new ExchangeInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.pid = source["pid"];
this.exchange_score = source["exchange_score"];
this.desc = source["desc"];
}
}
export class PrizeTag {
id: number;
name: string;
weight: number;
static createFrom(source: any = {}) {
return new PrizeTag(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.name = source["name"];
this.weight = source["weight"];
}
}
export class PrizeInfo {
id: number;
sid: number;
name: string;
score: number;
type: number;
img?: string;
sort: number;
frequency: number;
frequency_limit: number;
create_time: number;
num: number;
status: number;
percent: string;
new_score: number;
tags?: string;
left_num: number;
is_show_num: number;
publish_time?: number;
start_time?: number;
end_time?: number;
daily_start?: string;
daily_end?: string;
static createFrom(source: any = {}) {
return new PrizeInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.sid = source["sid"];
this.name = source["name"];
this.score = source["score"];
this.type = source["type"];
this.img = source["img"];
this.sort = source["sort"];
this.frequency = source["frequency"];
this.frequency_limit = source["frequency_limit"];
this.create_time = source["create_time"];
this.num = source["num"];
this.status = source["status"];
this.percent = source["percent"];
this.new_score = source["new_score"];
this.tags = source["tags"];
this.left_num = source["left_num"];
this.is_show_num = source["is_show_num"];
this.publish_time = source["publish_time"];
this.start_time = source["start_time"];
this.end_time = source["end_time"];
this.daily_start = source["daily_start"];
this.daily_end = source["daily_end"];
}
}
export class GetActPrizeListResp {
status: number;
msg: string;
prizes: PrizeInfo[];
module_id: number;
tags: PrizeTag[];
static createFrom(source: any = {}) {
return new GetActPrizeListResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
this.msg = source["msg"];
this.prizes = this.convertValues(source["prizes"], PrizeInfo);
this.module_id = source["module_id"];
this.tags = this.convertValues(source["tags"], PrizeTag);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class UserPrizeInfo {
id: number;
name: string;
score: number;
create_time: number;
status: number;
type: number;
is_real: number;
new_score: number;
account?: string;
code?: string;
common_prize_type: number;
order_id?: string;
img?: string;
prize_id?: number;
shop_item_id?: number;
item_id?: number;
ext?: Record<string, string>;
exchange_date?: number;
static createFrom(source: any = {}) {
return new UserPrizeInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.name = source["name"];
this.score = source["score"];
this.create_time = source["create_time"];
this.status = source["status"];
this.type = source["type"];
this.is_real = source["is_real"];
this.new_score = source["new_score"];
this.account = source["account"];
this.code = source["code"];
this.common_prize_type = source["common_prize_type"];
this.order_id = source["order_id"];
this.img = source["img"];
this.prize_id = source["prize_id"];
this.shop_item_id = source["shop_item_id"];
this.item_id = source["item_id"];
this.ext = source["ext"];
this.exchange_date = source["exchange_date"];
}
}
export class GetUserPrizeRecordsResp {
status: number;
msg: string;
records: UserPrizeInfo[];
static createFrom(source: any = {}) {
return new GetUserPrizeRecordsResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
this.msg = source["msg"];
this.records = this.convertValues(source["records"], UserPrizeInfo);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class GetUserScoreResp {
status: number;
msg: string;
gain_score: number;
used_score: number;
new_gain_score: number;
new_used_score: number;
score: number;
is_open_exchange_tip: number;
static createFrom(source: any = {}) {
return new GetUserScoreResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
this.msg = source["msg"];
this.gain_score = source["gain_score"];
this.used_score = source["used_score"];
this.new_gain_score = source["new_gain_score"];
this.new_used_score = source["new_used_score"];
this.score = source["score"];
this.is_open_exchange_tip = source["is_open_exchange_tip"];
}
}
export class ScoreExchangePrizeResp {
status: number;
msg: string;
order_id?: string;
exchange_info: ExchangeInfo;
act_pre_condition: ActPreCondition;
static createFrom(source: any = {}) {
return new ScoreExchangePrizeResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
this.msg = source["msg"];
this.order_id = source["order_id"];
this.exchange_info = this.convertValues(source["exchange_info"], ExchangeInfo);
this.act_pre_condition = this.convertValues(source["act_pre_condition"], ActPreCondition);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}
export namespace logger {
export class Entry {
id: number;
time: string;
level: string;
category: string;
account: string;
message: string;
static createFrom(source: any = {}) {
return new Entry(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.time = source["time"];
this.level = source["level"];
this.category = source["category"];
this.account = source["account"];
this.message = source["message"];
}
}
}