Files
huya-go/frontend/wailsjs/go/models.ts
T
yml2213 e8bb4eb571 补全过滤入口与直接兑换,优化兑换分类和 WSS 建连
- GUI 接线 Exchange 绑定:新增「直接兑换」按钮,结果带 category/message 并进入结果面板
- 补 -max-price/-min-left(CLI 与 GUI 设置),Target 的价格与库存过滤不再悬空
- 删除死代码 sendUpdateUserInfo 及其请求结构体(浏览器流程不含该帧)
- ClassifyExchange 改为多路判定:合并 msg/actPreCondition/exchangeInfo 文案,status=200 且有 orderId 视为成功,新增 condition 分类(precondition 门禁)
- WSS 建连改为锁外 dial、锁内注册,同 uid 并发调用共享一次握手
- 默认传输层统一为 http(CLI/GUI/README),.gitignore 忽略 .DS_Store
- 同步 Wails 依赖升级(2.12.0 -> 2.15.0)并重新生成前端绑定
2026-10-13 19:57:08 +08:00

519 lines
15 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;
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;
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.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.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 LogEntry {
time: string;
level: string;
message: string;
static createFrom(source: any = {}) {
return new LogEntry(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.time = source["time"];
this.level = source["level"];
this.message = source["message"];
}
}
export class PrizeListResult {
uid: number;
status: number;
msg: string;
prizes: huya.PrizeInfo[];
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.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 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;
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"];
}
}
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;
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"];
}
}
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;
}
}
}