This commit is contained in:
jiazhizhong
2022-03-10 17:09:03 +08:00
commit 1279635d7f
97 changed files with 10632 additions and 0 deletions

24
models/group.go Normal file
View File

@@ -0,0 +1,24 @@
package models
import (
"gorm.io/gorm"
)
var SuperGroup Group
type Group struct {
gorm.Model
Name string `json:"name" gorm:"not null;uniqueIndex;size:500"`
}
func (g *Group) Save() error {
if g.ID == 0 {
return DB().Create(g).Error
}
return DB().Save(g).Error
}
func init() {
SuperGroup.ID = 1
SuperGroup.Name = "超级管理员"
}