company.go 1.4 KB

123456789101112131415161718192021222324252627282930
  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. CreatedAt Time `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"`
  19. UpdatedAt Time `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"`
  20. }
  21. func (CompanyCreateRequest) TableName() string {
  22. return "company_create_request"
  23. }
  24. func (Company) TableName() string {
  25. return "company"
  26. }