sync: 同步 v1.0.4 并脱敏配置与镜像

This commit is contained in:
MiFaZhan
2026-10-29 14:36:49 +08:00
parent 743e8e6e6e
commit 2206a393f7
516 changed files with 18119 additions and 2253 deletions
+33
View File
@@ -0,0 +1,33 @@
package iot
import (
"testing"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/consts"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
)
func TestNormalizeOrderItemProduct(t *testing.T) {
tests := []struct {
name string
orderType int
want string
}{
{name: "renew", orderType: consts.OrderTypeCardRenew, want: "卡续费"},
{name: "change", orderType: consts.OrderTypeCardChange, want: "卡变更"},
{name: "subscribe", orderType: consts.OrderTypeCardSubscribe, want: "卡订购"},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
view := &model.TOrderItemViewModel{
ProductName: "余额充值",
ProductSn: "BALANCE_RECHARGE",
}
normalizeOrderItemProduct(test.orderType, view)
if view.ProductName != test.want || view.ProductSn != "" {
t.Fatalf("got name=%q sn=%q, want name=%q and empty sn", view.ProductName, view.ProductSn, test.want)
}
})
}
}