|
@@ -2,10 +2,9 @@ package manage
|
|
|
|
|
|
import (
|
|
|
"log"
|
|
|
+ "net/url"
|
|
|
sutil "sfbase/utils"
|
|
|
- "sfis/utils"
|
|
|
"testing"
|
|
|
- "time"
|
|
|
)
|
|
|
|
|
|
/*var (
|
|
@@ -33,11 +32,19 @@ func init() {
|
|
|
//todo init connection db operation
|
|
|
}
|
|
|
func Test_CreateUser(t *testing.T) {
|
|
|
- //log.Println("devUserCreate testing......")
|
|
|
- appID := utils.GetAppID(time.Now().Unix())
|
|
|
- secretKey := sutil.GetComplexRandom(8, 3, 5)
|
|
|
+ log.Println("devUserCreate testing......")
|
|
|
+ //appID := utils.GetAppID(time.Now().Unix())
|
|
|
+ //secretKey := sutil.GetComplexRandom(8, 3, 5)
|
|
|
|
|
|
- log.Printf("create successful appID:[%s],secretKey:[%s]", appID, secretKey)
|
|
|
+ data := make(url.Values)
|
|
|
+ data["name"] = []string{"河南拓普"}
|
|
|
+ data["phone"] = []string{"18238182402"}
|
|
|
+ data["ip_white_list"] = []string{"*"}
|
|
|
+
|
|
|
+ bs, _ := sutil.HttpPostForm("http://localhost:8080/manage/user/create", map[string]string{}, data)
|
|
|
+ log.Print(string(bs))
|
|
|
+
|
|
|
+ //log.Printf("create successful appID:[%s],secretKey:[%s]", appID, secretKey)
|
|
|
|
|
|
//创建用户、给用户开通接口产品时候有以下几种情况
|
|
|
//1.线上给账户充值10000块(user_account),不去实际购买产品,无购买记录,用户产品表无剩余量(left_num为0).此时又分两种情况
|