main_test.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/issue9/conv"
  5. "math/rand"
  6. "testing"
  7. "time"
  8. )
  9. func TestGormUser(t *testing.T) {
  10. rand.Seed(time.Now().UnixNano())
  11. res := conv.MustString(rand.Intn(100000-10000) + 10000)
  12. th := conv.MustString(time.Now().Hour())
  13. tm := conv.MustString(time.Now().Minute())
  14. if len(tm) < 2 {
  15. tm = "0" + tm
  16. }
  17. if len(tm) < 2 {
  18. th = "0" + th
  19. }
  20. //td := conv.MustString(time.Now().Day())
  21. //for {
  22. // if len(td) == 3 {
  23. // break
  24. // }
  25. // td = "0" + td
  26. //}
  27. fmt.Println("1" + th + tm + res)
  28. }
  29. // func TestDbCreateEnterprise(t *testing.T) {
  30. // ctx := context.Background()
  31. // config.Init()
  32. // newEnterprise := http_model.CreateEnterpriseRequest{
  33. // Industry: 2,
  34. // BusinessName: "Test公司",
  35. // RealName: "测试员",
  36. // Phone: "13010101010",
  37. // Email: "test@younggee.com",
  38. // }
  39. // res := service.CreateEnterprise.CreateEnterpriseUser(ctx, newEnterprise)
  40. // if res != nil {
  41. // fmt.Printf("%+v\n", res)
  42. // } else {
  43. // fmt.Printf("error\n")
  44. // }
  45. // }