master
Evan Chen 2021-12-19 21:49:30 +08:00
parent 95419dd651
commit 7ac1e42856
2 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,7 @@ type apiGrpNewReq struct {
Name string `json:"name" example:"user" binding:"required"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
Listeners string
GRPF1 string
}
@ -44,6 +45,7 @@ func ApiGrpNew(c *gin.Context) {
Name: data.Name,
Description: data.Description,
DisplayName: data.DisplayName,
Listeners: data.Listeners,
GRPF1: data.GRPF1,
}
if err := DB.Create(grp).Error; err != nil {
@ -61,6 +63,7 @@ type apiGrpUpdateReq struct {
Name string `json:"name" binding:"required"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
Listeners string
GRPF1 string
}
@ -85,6 +88,7 @@ func ApiGrpUpdate(c *gin.Context) {
"name": data.Name,
"display_name": data.DisplayName,
"description": data.Description,
"listeners": data.Listeners,
"grpf1": data.GRPF1,
})
if result.Error != nil {

View File

@ -15,6 +15,7 @@ type Group struct {
Name string `gorm:"unique;not null"`
DisplayName string
Description string
Listeners string
Users []*User `gorm:"many2many:user_groups;"`
//extra fields