fix: validate explicit migrations and preserve large business ids
This commit is contained in:
@@ -119,7 +119,7 @@ func TestChannelHTTPListsMetricsOptionsAndAtomicCreation(t *testing.T) {
|
||||
rootRow := func(data map[string]any) map[string]any {
|
||||
for _, raw := range data["rows"].([]any) {
|
||||
row := raw.(map[string]any)
|
||||
if row["id"] == float64(100) && row["sourceDb"] == "lx" {
|
||||
if row["id"] == "100" && row["sourceDb"] == "lx" {
|
||||
return row
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ func TestChannelHTTPListsMetricsOptionsAndAtomicCreation(t *testing.T) {
|
||||
list(8, "?lockStatus=-1", 1)
|
||||
list(1, "?busierAccount=leaf", 2)
|
||||
options := call(8, "GET", "/sw/promote/bindOptions?sourceDb=lx", "", 0).([]any)
|
||||
if len(options) != 1 || options[0].(map[string]any)["platformBusierId"] != float64(14) {
|
||||
if len(options) != 1 || options[0].(map[string]any)["platformBusierId"] != "14" {
|
||||
t.Fatal("上级未获取下级正常绑定")
|
||||
}
|
||||
body := `{"sourceDb":"lx","platformBusierId":"14","account":"中文渠道","password":"demo123","registerType":1}`
|
||||
@@ -193,6 +193,14 @@ func TestChannelHTTPListsMetricsOptionsAndAtomicCreation(t *testing.T) {
|
||||
if game["gameName"] != "汇总游戏" || game["registerCount"] != float64(2) || game["payAmount"] != "70.00" {
|
||||
t.Fatalf("游戏分布误用了原始注册/充值或错误金额口径: %+v", game)
|
||||
}
|
||||
if err := db.Exec("UPDATE tab_promote SET id=9007199254740993 WHERE source_db='lx' AND id=100").Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
large := list(8, "?keyword=main-channel", 1)["rows"].([]any)[0].(map[string]any)
|
||||
if large["id"] != "9007199254740993" {
|
||||
t.Fatalf("HTTP response rounded channel ID: %v", large["id"])
|
||||
}
|
||||
call(8, "GET", "/sw/promote/game-distribution?sourceDb=lx&promoteId="+large["id"].(string), "", 0)
|
||||
if err := db.Exec("DROP TABLE tab_promote").Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user