用户接口远程调用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

63 lines
1.1 KiB

package userrpc
import (
"testing"
)
func Test_GetUserByToken(t *testing.T) {
dbname := "shop_v2"
// token := "5536827c-36a5-4ec7-946d-49e4380c5103"
// res, err := GetUserByToken(dbname, token, "111.229.34.252:7976")
// t.Log(res)
// t.Log(res["UserId"])
// t.Log(err)
res2, err := GetById("1023", dbname, "3")
t.Log(res2)
// t.Log(res2.GetUserId())
t.Log(err)
// res3, err := GetUserByUsercode(dbname, "2233")
// t.Log(res3)
// t.Log(*res3.UserId)
// t.Log(err)
}
// func Test_Login(t *testing.T) {
// dbname := "dev_tetele_net"
// account := "admin"
// password := "e10adc3949ba59abbe56e057f20f883e"
// res, err := Login(dbname, account, password)
// t.Log(res)
// t.Log(res["UserId"])
// t.Log(err)
// }
func Test_UpdateUserCache(t *testing.T){
dbname := "shop"
siteId := "1198881"
res,err := UpdateUserCache(siteId,dbname,"6")
if err != nil {
t.Error(err.Error())
}
t.Log(res)
}
func Test_GetById(t *testing.T){
dbname := "shop"
siteId := "1198881"
res,err := GetById(siteId,dbname,"6")
if err != nil {
t.Error(err.Error())
}
t.Log(res)
}