From ed808316e8cdc9fd8171c8796f90c98b4581e5c7 Mon Sep 17 00:00:00 2001 From: lijianbin <513837235@.qq.com> Date: Fri, 8 Oct 2021 18:24:03 +0800 Subject: [PATCH] debug --- account.client.go | 2 +- account.client_test.go | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/account.client.go b/account.client.go index acd9ba7..8000d77 100644 --- a/account.client.go +++ b/account.client.go @@ -784,7 +784,7 @@ func UpdateUserCoupon(dbname, userId, couponId, remark, orderSn, isUse, usetime res := &Response{} - err = conn.UpdateUserUpgrade(req, res) + err = conn.UpdateUserCoupon(req, res) if err != nil { log.Println("userrpc UpdateUserCoupon error:", err) diff --git a/account.client_test.go b/account.client_test.go index a903e71..6c4bead 100644 --- a/account.client_test.go +++ b/account.client_test.go @@ -1,7 +1,9 @@ package userrpc import ( + "strconv" "testing" + "time" ) func Test_GetUserScore(t *testing.T) { @@ -141,10 +143,10 @@ func Test_AddUserRedEnvelopeLog(t *testing.T) { func Test_AddUserCoupon(t *testing.T) { dbname := "shop_v2_org" userid := "2" - couponId := "20" - expired_time := "" + couponId := "6" + expired_time := "1634684122" order_sn := "" - remark := "" + remark := "商品券" ret, err := AddUserCoupon(dbname, userid, couponId, expired_time,order_sn,remark) t.Log(ret) @@ -154,11 +156,11 @@ func Test_AddUserCoupon(t *testing.T) { func Test_UpdateUserCoupon(t *testing.T) { dbname := "shop_v2_org" userid := "2" - couponId := "20" - remark := "" - orderSn := "" - isUse := "" - usetime := "" + couponId := "6" + remark := "下单使用优惠券" + orderSn := "12345678910" + isUse := "1" + usetime := strconv.Itoa(int(time.Now().Unix())) ret, err := UpdateUserCoupon(dbname, userid, couponId, remark, orderSn, isUse,usetime) t.Log(ret)