api层写法统一

This commit is contained in:
linwenxiang committed 2021-03-12 16:02:29 +08:00
1 parent fa30b8db95
commit 9bf9330410
40 files changed
+430 -316

No files matched your search

+3 -3
View File
@@ -2,10 +2,10 @@ package dto
import (
"encoding/json"
"go-admin/common/apis"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/go-admin-team/go-admin-core/sdk/api"
"go-admin/app/admin/models/system"
"go-admin/common/dto"
@@ -32,7 +32,7 @@ func (m *SysRoleSearch) GetNeedSearch() interface{} {
// Bind 映射上下文中的结构体数据
func (m *SysRoleSearch) Bind(ctx *gin.Context) error {
log := apis.GetRequestLogger(ctx)
log := api.GetRequestLogger(ctx)
err := ctx.ShouldBind(m)
if err != nil {
log.Debugf("ShouldBind error: %s", err.Error())
@@ -56,7 +56,7 @@ type SysRoleControl struct {
// Bind 映射上下文中的结构体数据
func (s *SysRoleControl) Bind(ctx *gin.Context) error {
log := apis.GetRequestLogger(ctx)
log := api.GetRequestLogger(ctx)
err := ctx.ShouldBindBodyWith(s, binding.JSON)
if err != nil {
log.Debugf("ShouldBind error: %s", err.Error())