company.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package model
  2. type Company struct {
  3. ID int `json:"id" gorm:"type:bigint(20);not null"`
  4. Name string `json:"name" gorm:"type:varchar(128);not null"`
  5. LogoUrl string `json:"logo_url" gorm:"type:varchar(128);not null"`
  6. CertificateUrl string `json:"certificate_url" gorm:"type:varchar(128);not null"`
  7. CreatorId string `json:"creator_id" gorm:"type:varchar(128);not null"`
  8. CreatedAt Time `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"`
  9. UpdatedAt Time `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"`
  10. }
  11. type CompanyCreateRequest struct {
  12. ID int `json:"id" gorm:"type:bigint(20);not null"`
  13. Name string `json:"name" gorm:"type:varchar(128);not null"`
  14. LogoUrl string `json:"logo_url" gorm:"type:varchar(128);not null"`
  15. CertificateUrl string `json:"certificate_url" gorm:"type:varchar(128);not null"`
  16. State int `json:"state" gorm:"type:int; not null"`
  17. CreatorId string `json:"creator_id" gorm:"type:varchar(128);not null"`
  18. CreatorName string `json:"creator_name" gorm:"type:varchar(128);not null"`
  19. CreatedAt Time `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"`
  20. UpdatedAt Time `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"`
  21. }
  22. type Company2Users struct {
  23. ID int `json:"id" gorm:"type:bigint(20);not null"`
  24. CompanyId int `json:"company_id" gorm:"type:bigint(20);not null"`
  25. UserId string `json:"user_id" gorm:"type:varchar(128);not null"`
  26. State int `json:"state" gorm:"type:int; not null"`
  27. CreatedAt Time `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"`
  28. UpdatedAt Time `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"`
  29. }
  30. func (Company2Users) TableName() string {
  31. return "company_users"
  32. }
  33. func (CompanyCreateRequest) TableName() string {
  34. return "company_create_request"
  35. }
  36. func (Company) TableName() string {
  37. return "company"
  38. }