From 0322ba843a295fdf6f170a7c73b721cd890b0680 Mon Sep 17 00:00:00 2001 From: li Date: Mon, 28 Feb 2022 17:08:37 +0800 Subject: [PATCH] fix: --- model/model_test.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/model/model_test.go b/model/model_test.go index 815c718..c127b22 100644 --- a/model/model_test.go +++ b/model/model_test.go @@ -95,6 +95,7 @@ func InitTestDB() { &UserRedeemCode{}, &DepositRefundRecord{}, &GroupSendMessageTemplate{}, + &Goods{}, ) @@ -548,3 +549,37 @@ func MergingGameCards() { } } + +func TestGoodsAdd(t *testing.T) { + GoodsAdd() +} + +func GoodsAdd() { + InitTestDB() + for i := 0; i < 5; i++ { + goods := Goods{ + GoodsId: 1 + uint32(i)+1, + SerialNo: "sdhfjskdhjk"+ fmt.Sprintf("%d", i+1), + CatId: 1, + Name: "宝可梦剑" + fmt.Sprintf("%d", i+1), + Title: "宝可梦剑", + MainImage: "https://minghui-oss.oss-cn-shenzhen.aliyuncs.com/eceec8e0-da21-11eb-8936-197fd3ba503d.jpg", + Images: "https://minghui-oss.oss-cn-shenzhen.aliyuncs.com/eceec8e0-da21-11eb-8936-197fd3ba503d.jpg", + Stock: 10, + Detail: "宝可梦剑 详情" + fmt.Sprintf("%d", i+1), + SoldCount: 0, + SaleStatus: 1, + PriceVm: 10 + uint32(i), + PriceRm: 29900, + PriceOriginal: 29900, + DeliveryFee: 1000, + VersionId: 0, + } + + err := DBDev.Create(&goods).Error + if err != nil { + fmt.Println("err:", err) + } + } + +}