@@ -186,6 +186,8 @@ func AddRole(c *gin.Context) { | |||||
Name: req.Name, | Name: req.Name, | ||||
State: enum.RoleStateForNormal, | State: enum.RoleStateForNormal, | ||||
Memo: req.Memo, | Memo: req.Memo, | ||||
Logo: req.Logo, | |||||
Label: req.Label, | |||||
CreateAt: now.Format("2006-01-02 15:04:05"), | CreateAt: now.Format("2006-01-02 15:04:05"), | ||||
UpdateAt: now.Format("2006-01-02 15:04:05"), | UpdateAt: now.Format("2006-01-02 15:04:05"), | ||||
}) | }) | ||||
@@ -231,6 +233,8 @@ func UpdateRole(c *gin.Context) { | |||||
} | } | ||||
role.Name = req.Name | role.Name = req.Name | ||||
role.Memo = req.Memo | role.Memo = req.Memo | ||||
role.Logo = req.Logo | |||||
role.Label = req.Label | |||||
_, err = roleDb.UpdateRole(role, "name", "memo") | _, err = roleDb.UpdateRole(role, "name", "memo") | ||||
if err != nil { | if err != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | e.OutErr(c, e.ERR_DB_ORM, err.Error()) | ||||
@@ -17,14 +17,18 @@ type UpdateRoleStateReq struct { | |||||
} | } | ||||
type AddRoleReq struct { | type AddRoleReq struct { | ||||
Name string `json:"name" binding:"required" label:"名称"` | |||||
Memo string `json:"memo" binding:"required" label:"备注"` | |||||
Name string `json:"name" binding:"required" label:"名称"` | |||||
Memo string `json:"memo" binding:"required" label:"备注"` | |||||
Logo string `json:"logo" label:"左边图标"` | |||||
Label string `json:"label" label:"身份标签"` | |||||
} | } | ||||
type UpdateRoleReq struct { | type UpdateRoleReq struct { | ||||
RoleId int `json:"role_id" binding:"required" label:"id"` | RoleId int `json:"role_id" binding:"required" label:"id"` | ||||
Name string `json:"name" binding:"required" label:"名称"` | Name string `json:"name" binding:"required" label:"名称"` | ||||
Memo string `json:"memo" binding:"required" label:"备注"` | Memo string `json:"memo" binding:"required" label:"备注"` | ||||
Logo string `json:"logo" label:"左边图标"` | |||||
Label string `json:"label" label:"身份标签"` | |||||
} | } | ||||
type RoleBindPermissionGroupReq struct { | type RoleBindPermissionGroupReq struct { | ||||
@@ -5,7 +5,7 @@ go 1.18 | |||||
//replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models | //replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models | ||||
require ( | require ( | ||||
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240930023755-c7d7ee377ac6 | |||||
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240930062518-b791878f3a7f | |||||
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 | github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 | ||||
github.com/boombuler/barcode v1.0.1 | github.com/boombuler/barcode v1.0.1 | ||||
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 | github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 | ||||