main_test.go 767 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package main
  2. import (
  3. "context"
  4. "fmt"
  5. "testing"
  6. "youngee_b_api/config"
  7. "youngee_b_api/model/http_model"
  8. "youngee_b_api/service"
  9. "youngee_b_api/util"
  10. )
  11. func TestGormUser(t *testing.T) {
  12. pa := "17695725591"
  13. r := util.MD5(pa)
  14. r2 := service.LoginAuth.TestEncryptPassword(pa)
  15. fmt.Println(r)
  16. fmt.Println(r2)
  17. }
  18. func TestDbCreateEnterprise(t *testing.T) {
  19. ctx := context.Background()
  20. config.Init()
  21. newEnterprise := http_model.CreateEnterpriseRequest{
  22. Industry: 2,
  23. BusinessName: "Test公司",
  24. RealName: "测试员",
  25. Phone: "13010101010",
  26. Email: "test@younggee.com",
  27. }
  28. res := service.CreateEnterprise.CreateEnterpriseUser(ctx, newEnterprise)
  29. if res != nil {
  30. fmt.Printf("%+v\n", res)
  31. } else {
  32. fmt.Printf("error\n")
  33. }
  34. }