银豹api新增修改商品
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -20,18 +21,35 @@ func init() {
|
||||
}
|
||||
|
||||
func TestAddProductInfo(t *testing.T) {
|
||||
api.AddProductInfo(&AddProductInfoParam{
|
||||
var (
|
||||
stock = 5.1
|
||||
)
|
||||
result, err := api.AddProductInfo(&ProductInfoParam{
|
||||
ProductInfo: &ProductInfo{
|
||||
Name: "测试商品",
|
||||
Barcode: "12138",
|
||||
BuyPrice: 5,
|
||||
SellPrice: 5,
|
||||
Stock: 99,
|
||||
Barcode: "12135",
|
||||
BuyPrice: &stock,
|
||||
SellPrice: &stock,
|
||||
Stock: &stock,
|
||||
},
|
||||
})
|
||||
// result, err :=
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestUpdateProductInfo(t *testing.T) {
|
||||
var (
|
||||
sellPrice = float64(50)
|
||||
)
|
||||
err := api.UpdateProductInfo(&ProductInfoParam{
|
||||
ProductInfo: &ProductInfo{
|
||||
UID: 285305464077105187,
|
||||
Stock: &sellPrice,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user