This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-08-24 20:22:39 +08:00
parent 262e8eb910
commit f9296dc896
3 changed files with 5 additions and 3 deletions

View File

@ -50,3 +50,5 @@ func (s Table) recordEventWithName(m *ice.Message, info string) {
type Tables struct{ Table }
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
func newTable() Table { return Table{Table: gonganxitong.NewTable(userClass{}, class{}, school{})} }

View File

@ -24,14 +24,14 @@ type UserClass struct {
db.ModelWithUID
UserUID string `gorm:"type:char(32);index"`
ClassUID string `gorm:"type:char(32);index"`
Role uint8
Role uint8 `gorm:"default:0"`
}
type Class struct {
db.ModelWithUID
SchoolUID string `gorm:"type:char(32);index"`
Grade string `gorm:"type:varchar(32)"`
Name string `gorm:"type:varchar(64)"`
Type uint8
Type uint8 `gorm:"default:0"`
}
type School struct {
db.ModelWithUID

View File

@ -39,7 +39,7 @@ func (s userClass) List(m *ice.Message, arg ...string) {
s.SelectJoinCity(m)
}
func init() { ice.TeamCtxCmd(userClass{}) }
func init() { ice.TeamCtxCmd(userClass{Table: newTable()}) }
type UserClassRole int