用户接口远程调用
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

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
  1. package userrpc
  2. import (
  3. "testing"
  4. )
  5. func Test_GetUserByToken(t *testing.T) {
  6. dbname := "shop_v2"
  7. // token := "5536827c-36a5-4ec7-946d-49e4380c5103"
  8. // res, err := GetUserByToken(dbname, token, "111.229.34.252:7976")
  9. // t.Log(res)
  10. // t.Log(res["UserId"])
  11. // t.Log(err)
  12. res2, err := GetById("1023", dbname, "3")
  13. t.Log(res2)
  14. // t.Log(res2.GetUserId())
  15. t.Log(err)
  16. // res3, err := GetUserByUsercode(dbname, "2233")
  17. // t.Log(res3)
  18. // t.Log(*res3.UserId)
  19. // t.Log(err)
  20. }
  21. // func Test_Login(t *testing.T) {
  22. // dbname := "dev_tetele_net"
  23. // account := "admin"
  24. // password := "e10adc3949ba59abbe56e057f20f883e"
  25. // res, err := Login(dbname, account, password)
  26. // t.Log(res)
  27. // t.Log(res["UserId"])
  28. // t.Log(err)
  29. // }
  30. func Test_UpdateUserCache(t *testing.T){
  31. dbname := "shop"
  32. siteId := "1198881"
  33. res,err := UpdateUserCache(siteId,dbname,"6")
  34. if err != nil {
  35. t.Error(err.Error())
  36. }
  37. t.Log(res)
  38. }
  39. func Test_GetById(t *testing.T){
  40. dbname := "shop"
  41. siteId := "1198881"
  42. res,err := GetById(siteId,dbname,"6")
  43. if err != nil {
  44. t.Error(err.Error())
  45. }
  46. t.Log(res)
  47. }