From 21c77899ce06d5f9ef9e3077683727d7d3bac669 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Sun, 19 Dec 2021 03:23:21 +0800 Subject: [PATCH] update --- auth/api_grp.go | 4 ++++ auth/group.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/auth/api_grp.go b/auth/api_grp.go index 79b88a3..ea82b11 100644 --- a/auth/api_grp.go +++ b/auth/api_grp.go @@ -28,6 +28,7 @@ type apiGrpNewReq struct { Name string `json:"name" example:"user" binding:"required"` DisplayName string `json:"display_name"` Description string `json:"description"` + GRPF1 string } func ApiGrpNew(c *gin.Context) { @@ -43,6 +44,7 @@ func ApiGrpNew(c *gin.Context) { Name: data.Name, Description: data.Description, DisplayName: data.DisplayName, + GRPF1: data.GRPF1, } if err := DB.Create(grp).Error; err != nil { panic(err) @@ -59,6 +61,7 @@ type apiGrpUpdateReq struct { Name string `json:"name" binding:"required"` DisplayName string `json:"display_name"` Description string `json:"description"` + GRPF1 string } func ApiGrpUpdate(c *gin.Context) { @@ -82,6 +85,7 @@ func ApiGrpUpdate(c *gin.Context) { "name": data.Name, "display_name": data.DisplayName, "description": data.Description, + "grpf1": data.GRPF1, }) if result.Error != nil { panic(result.Error) diff --git a/auth/group.go b/auth/group.go index 019cceb..36e0483 100644 --- a/auth/group.go +++ b/auth/group.go @@ -18,6 +18,9 @@ type Group struct { DisplayName string Description string Users []*User `gorm:"many2many:user_groups;"` + + //extra fields + GRPF1 string } func (grp *Group) BeforeSave(tx *gorm.DB) (err error) {