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

@@ -18,25 +18,15 @@ type AuthCert struct {
}
func (ac *AuthCert) BaseAuthCerts(rc *req.Ctx) {
g := rc.GinCtx
condition := &entity.AuthCert{
Name: g.Query("name"),
AuthMethod: int8(ginx.QueryInt(g, "authMethod", 0)),
}
condition.Id = uint64(ginx.QueryInt(g, "id", 0))
rc.ResData = ac.AuthCertApp.GetPageList(condition, ginx.GetPageParam(g), new([]vo.AuthCertBaseVO))
queryCond, page := ginx.BindQueryAndPage(rc.GinCtx, new(entity.AuthCertQuery))
rc.ResData = ac.AuthCertApp.GetPageList(queryCond, page, new([]vo.AuthCertBaseVO))
}
func (ac *AuthCert) AuthCerts(rc *req.Ctx) {
g := rc.GinCtx
condition := &entity.AuthCert{
Name: g.Query("name"),
AuthMethod: int8(ginx.QueryInt(g, "authMethod", 0)),
}
condition.Id = uint64(ginx.QueryInt(g, "id", 0))
queryCond, page := ginx.BindQueryAndPage(rc.GinCtx, new(entity.AuthCertQuery))
res := new([]*entity.AuthCert)
pageRes := ac.AuthCertApp.GetPageList(condition, ginx.GetPageParam(g), res)
pageRes := ac.AuthCertApp.GetPageList(queryCond, page, res)
for _, r := range *res {
r.PwdDecrypt()
}