refactor: 后端路由定义方式&请求参数绑定重构

This commit is contained in:
meilin.huang
2023-07-08 20:05:55 +08:00
parent 183a6e4905
commit 3269dfa5d6
59 changed files with 559 additions and 1020 deletions

View File

@@ -27,13 +27,9 @@ func (r *Role) Roles(rc *req.Ctx) {
// 保存角色信息
func (r *Role) SaveRole(rc *req.Ctx) {
g := rc.GinCtx
form := &form.RoleForm{}
ginx.BindJsonAndValid(g, form)
role := ginx.BindJsonAndCopyTo(rc.GinCtx, form, new(entity.Role))
rc.ReqParam = form
role := new(entity.Role)
utils.Copy(role, form)
role.SetBaseInfo(rc.LoginAccount)
r.RoleApp.SaveRole(role)