feat: 统一sql命名、函数命名
This commit is contained in:
@@ -2,7 +2,7 @@ package request
|
||||
|
||||
import "server/internal/model/common"
|
||||
|
||||
type CreateSysApiRequest struct {
|
||||
type CreateApiRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=100"`
|
||||
GroupName string `json:"group_name" validate:"required,min=1,max=100"`
|
||||
Path string `json:"path" validate:"required,min=1,max=100"`
|
||||
@@ -10,7 +10,7 @@ type CreateSysApiRequest struct {
|
||||
Sort *int32 `json:"sort" validate:"required,min=0"`
|
||||
}
|
||||
|
||||
type UpdateSysApiRequest struct {
|
||||
type UpdateApiRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=100"`
|
||||
GroupName string `json:"group_name" validate:"required,min=1,max=100"`
|
||||
Path string `json:"path" validate:"required,min=1,max=100"`
|
||||
@@ -18,8 +18,9 @@ type UpdateSysApiRequest struct {
|
||||
Sort *int32 `json:"sort" validate:"required,min=0"`
|
||||
}
|
||||
|
||||
type SearchSysApiParams struct {
|
||||
type SearchApiParams struct {
|
||||
common.Pagination
|
||||
Name string `json:"name" form:"name" validate:"omitempty,max=100"`
|
||||
Method string `json:"method" form:"method" validate:"omitempty,oneof=GET POST PUT PATCH DELETE"`
|
||||
GroupName string `json:"group_name" form:"group_name" validate:"omitempty,max=100"`
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"server/internal/pkg/validator"
|
||||
)
|
||||
|
||||
type CreateSysMenuRequest struct {
|
||||
type CreateMenuRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=100"`
|
||||
Path *string `json:"path" validate:"omitempty,max=100"`
|
||||
Type *int16 `json:"type" validate:"required,oneof=0 1 2"`
|
||||
@@ -17,7 +17,7 @@ type CreateSysMenuRequest struct {
|
||||
PermissionCode string `json:"permission_code" validate:"required,min=1,max=100"`
|
||||
}
|
||||
|
||||
type UpdateSysMenuRequest struct {
|
||||
type UpdateMenuRequest struct {
|
||||
Name *string `json:"name" validate:"omitempty,min=1,max=100"`
|
||||
Path *string `json:"path" validate:"omitempty,max=100"`
|
||||
Type *int16 `json:"type" validate:"omitempty,oneof=0 1 2"`
|
||||
@@ -1,20 +1,20 @@
|
||||
package request
|
||||
|
||||
type CreateSysRoleRequest struct {
|
||||
type CreateRoleRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=100"`
|
||||
Code string `json:"code" validate:"required,max=100"`
|
||||
Status *int16 `json:"status" validate:"required,oneof=0 1"`
|
||||
}
|
||||
|
||||
type UpdateSysRoleRequest struct {
|
||||
type UpdateRoleRequest struct {
|
||||
Name *string `json:"name" validate:"min=1,max=100"`
|
||||
Status *int16 `json:"status" validate:"omitempty,oneof=0 1"`
|
||||
}
|
||||
|
||||
type SetSysRoleMenusRequest struct {
|
||||
type SetRoleMenusRequest struct {
|
||||
MenuIDs []int32 `json:"menu_ids" validate:"required,dive,gt=0"`
|
||||
}
|
||||
|
||||
type SetSysRoleApisRequest struct {
|
||||
type SetRoleApisRequest struct {
|
||||
ApiIDs []int32 `json:"api_ids" validate:"required,dive,gt=0"`
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"server/internal/pkg/validator"
|
||||
)
|
||||
|
||||
type CreateSysUserRequest struct {
|
||||
type CreateUserRequest struct {
|
||||
Username string `json:"username" validate:"required,min=1,max=50"`
|
||||
Account string `json:"account" validate:"required,min=5,max=100"`
|
||||
Password string `json:"password" validate:"required,min=6,max=255"`
|
||||
@@ -13,17 +13,17 @@ type CreateSysUserRequest struct {
|
||||
Status *int16 `json:"status" validate:"oneof=0 1"`
|
||||
}
|
||||
|
||||
type UpdateSysUserRequest struct {
|
||||
type UpdateUserRequest struct {
|
||||
Username *string `json:"username" validate:"omitempty,min=1,max=50"`
|
||||
AvatarID validator.NullInt32 `json:"avatar_id" validate:"omitempty"`
|
||||
Status *int16 `json:"status" validate:"omitempty,oneof=0 1"`
|
||||
}
|
||||
|
||||
type UpdateSysUserPassword struct {
|
||||
type UpdateUserPassword struct {
|
||||
Password string `json:"password" validate:"required,min=6,max=255"`
|
||||
}
|
||||
|
||||
type SetSysUserRolesRequest struct {
|
||||
type SetUserRolesRequest struct {
|
||||
RoleIDs []int32 `json:"role_ids" validate:"required,dive,gt=0"`
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ type LoginRequest struct {
|
||||
Password string `json:"password" validate:"required,min=6,max=255"`
|
||||
}
|
||||
|
||||
type SearchSysUserParams struct {
|
||||
type SearchUserParams struct {
|
||||
common.Pagination
|
||||
Username string `json:"username" validate:"omitempty,max=50"`
|
||||
}
|
||||
Reference in New Issue
Block a user