company.go 2.1 KB

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