main_test.go 625 B

1234567891011121314151617181920212223242526272829303132
  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. )
  10. func TestGormUser(t *testing.T) {
  11. }
  12. func TestDbCreateEnterprise(t *testing.T) {
  13. ctx := context.Background()
  14. config.Init()
  15. newEnterprise := http_model.CreateEnterpriseRequest{
  16. Industry: 2,
  17. BusinessName: "Test公司",
  18. RealName: "测试员",
  19. Phone: "13010101010",
  20. Email: "test@younggee.com",
  21. }
  22. res := service.CreateEnterprise.CreateEnterpriseUser(ctx, newEnterprise)
  23. if res != nil {
  24. fmt.Printf("%+v\n", res)
  25. } else {
  26. fmt.Printf("error\n")
  27. }
  28. }