优化外部上传和备注

This commit is contained in:
yml2213
2026-07-23 17:06:06 +08:00
parent c5f14ff8fd
commit 5668eb745f
8 changed files with 97 additions and 14 deletions
@@ -355,8 +355,9 @@ func TestExternalAccountToCreateRequestMapsUploadFields(t *testing.T) {
SecretKD: 1.6,
DailyLossM: 7,
Deposit: 400,
BanRecord: "",
BanRecord: "",
CommonRegion: "郑州",
Remark: "有语音封禁\n封禁历史:2026/01/23封禁3天",
Currency: ExternalUploadCurrency{
HafuCoin: 197.1,
RecycleRatio: 43,
@@ -371,6 +372,15 @@ func TestExternalAccountToCreateRequestMapsUploadFields(t *testing.T) {
},
})
if req.Description != "有语音封禁\n封禁历史:2026/01/23封禁3天" {
t.Fatalf("Description = %q", req.Description)
}
if req.AssetSummary["remark"] != "有语音封禁\n封禁历史:2026/01/23封禁3天" {
t.Fatalf("remark = %#v", req.AssetSummary["remark"])
}
if req.AssetSummary["ban_record"] != "有封禁记录" {
t.Fatalf("ban_record = %#v", req.AssetSummary["ban_record"])
}
if req.ServerRegion != "QQ" {
t.Fatalf("expected QQ server region, got %q", req.ServerRegion)
}
@@ -393,11 +403,33 @@ func TestExternalAccountToCreateRequestMapsUploadFields(t *testing.T) {
if len(groups["melee"]) != 2 {
t.Fatalf("expected melee skins mapped, got %#v", groups)
}
if _, ok := groups["imported"]; ok {
t.Fatalf("did not expect imported group, got %#v", groups)
}
if len(req.ScreenshotURLS) != 1 || req.ScreenshotURLS[0] != defaultUploadScreenshot {
t.Fatalf("expected default screenshot, got %#v", req.ScreenshotURLS)
}
}
func TestExternalSkinGroupsClassifiesKnownSkins(t *testing.T) {
groups := externalSkinGroups([]string{"暗星", "凌霄成卫", "蛊-不羁人生", "未知皮肤X"})
if got := groups["melee"]; len(got) != 1 || got[0] != "暗星" {
t.Fatalf("melee = %#v", got)
}
if got := groups["operatorRed"]; len(got) != 1 || got[0] != "凌霄成卫" {
t.Fatalf("operatorRed = %#v", got)
}
if got := groups["operatorGold"]; len(got) != 1 || got[0] != "蛊-不羁人生" {
t.Fatalf("operatorGold = %#v", got)
}
if got := groups["other"]; len(got) != 1 || got[0] != "未知皮肤X" {
t.Fatalf("other = %#v", got)
}
if _, ok := groups["imported"]; ok {
t.Fatalf("unexpected imported group: %#v", groups)
}
}
func validExternalUploadDataJSON() string {
return `{
"loginMethod":"QQ账号密码",