mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-26 01:16:36 +08:00
refactor: 使用泛型重构参数绑定等
This commit is contained in:
@@ -60,7 +60,7 @@ func (rs *Redis) ReqConfs() *req.Confs {
|
||||
}
|
||||
|
||||
func (r *Redis) RedisList(rc *req.Ctx) {
|
||||
queryCond := req.BindQuery(rc, new(entity.RedisQuery))
|
||||
queryCond := req.BindQuery[*entity.RedisQuery](rc)
|
||||
|
||||
// 不存在可访问标签id,即没有可操作数据
|
||||
tags := r.tagApp.GetAccountTags(rc.GetLoginAccount().Id, &tagentity.TagTreeQuery{
|
||||
@@ -87,8 +87,7 @@ func (r *Redis) RedisList(rc *req.Ctx) {
|
||||
}
|
||||
|
||||
func (r *Redis) TestConn(rc *req.Ctx) {
|
||||
form := &form.Redis{}
|
||||
redis := req.BindJsonAndCopyTo[*entity.Redis](rc, form, new(entity.Redis))
|
||||
form, redis := req.BindJsonAndCopyTo[*form.Redis, *entity.Redis](rc)
|
||||
|
||||
authCert := &tagentity.ResourceAuthCert{
|
||||
Username: form.Username,
|
||||
@@ -110,8 +109,7 @@ func (r *Redis) TestConn(rc *req.Ctx) {
|
||||
}
|
||||
|
||||
func (r *Redis) Save(rc *req.Ctx) {
|
||||
form := &form.Redis{}
|
||||
redis := req.BindJsonAndCopyTo[*entity.Redis](rc, form, new(entity.Redis))
|
||||
form, redis := req.BindJsonAndCopyTo[*form.Redis, *entity.Redis](rc)
|
||||
|
||||
redisParam := &dto.SaveRedis{
|
||||
Redis: redis,
|
||||
|
||||
Reference in New Issue
Block a user