|
@ -1,7 +1,9 @@ |
|
|
package userrpc |
|
|
package userrpc |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"strconv" |
|
|
"testing" |
|
|
"testing" |
|
|
|
|
|
"time" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func Test_GetUserScore(t *testing.T) { |
|
|
func Test_GetUserScore(t *testing.T) { |
|
@ -141,10 +143,10 @@ func Test_AddUserRedEnvelopeLog(t *testing.T) { |
|
|
func Test_AddUserCoupon(t *testing.T) { |
|
|
func Test_AddUserCoupon(t *testing.T) { |
|
|
dbname := "shop_v2_org" |
|
|
dbname := "shop_v2_org" |
|
|
userid := "2" |
|
|
userid := "2" |
|
|
couponId := "20" |
|
|
|
|
|
expired_time := "" |
|
|
|
|
|
|
|
|
couponId := "6" |
|
|
|
|
|
expired_time := "1634684122" |
|
|
order_sn := "" |
|
|
order_sn := "" |
|
|
remark := "" |
|
|
|
|
|
|
|
|
remark := "商品券" |
|
|
|
|
|
|
|
|
ret, err := AddUserCoupon(dbname, userid, couponId, expired_time,order_sn,remark) |
|
|
ret, err := AddUserCoupon(dbname, userid, couponId, expired_time,order_sn,remark) |
|
|
t.Log(ret) |
|
|
t.Log(ret) |
|
@ -154,11 +156,11 @@ func Test_AddUserCoupon(t *testing.T) { |
|
|
func Test_UpdateUserCoupon(t *testing.T) { |
|
|
func Test_UpdateUserCoupon(t *testing.T) { |
|
|
dbname := "shop_v2_org" |
|
|
dbname := "shop_v2_org" |
|
|
userid := "2" |
|
|
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) |
|
|
ret, err := UpdateUserCoupon(dbname, userid, couponId, remark, orderSn, isUse,usetime) |
|
|
t.Log(ret) |
|
|
t.Log(ret) |
|
|