package entities import ( "gorm.io/gorm" "sorbet/pkg/db" "time" ) // Company 公司表 type Company struct { ID uint `json:"id" xml:"id" gorm:"primaryKey;not null;comment:公司编号"` PrincipalID *uint `json:"principal_id" xml:"principal_id" gorm:"comment:负责人编号(员工)"` Name string `json:"name" xml:"name" gorm:"size:25;not null;uniqueIndex;comment:公司名称"` Logo string `json:"logo" xml:"logo" gorm:"not null;comment:形象徽标"` Status bool `json:"status" xml:"status" gorm:"comment:状态"` Version db.Version `json:"-" xml:"-" gorm:"comment:乐观锁"` CreatedAt time.Time `json:"create_time" xml:"create_time" gorm:"<-:false;comment:创建时间"` UpdatedAt time.Time `json:"update_time" xml:"update_time" gorm:"<-:false;comment:更新时间"` DeletedAt gorm.DeletedAt `json:"-" xml:"-" gorm:"comment:删除时间"` Principal *CompanyStaff `json:"principal" xml:"principal"` Staffs []*CompanyStaff `json:"staffs" xml:"staffs"` Departments []*CompanyDepartment `json:"departments" xml:"departments"` }