mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-25 00:56:35 +08:00
refactor: 使用泛型重构参数绑定等
This commit is contained in:
@@ -50,8 +50,7 @@ func (r *Resource) GetById(rc *req.Ctx) {
|
||||
}
|
||||
|
||||
func (r *Resource) SaveResource(rc *req.Ctx) {
|
||||
form := new(form.ResourceForm)
|
||||
entity := req.BindJsonAndCopyTo(rc, form, new(entity.Resource))
|
||||
form, entity := req.BindJsonAndCopyTo[*form.ResourceForm, *entity.Resource](rc)
|
||||
|
||||
rc.ReqParam = form
|
||||
|
||||
|
||||
Reference in New Issue
Block a user