feat: 统一sql命名、函数命名
This commit is contained in:
31
internal/model/request/menu.go
Normal file
31
internal/model/request/menu.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"server/internal/pkg/validator"
|
||||
)
|
||||
|
||||
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"`
|
||||
Component *string `json:"component" validate:"omitempty"`
|
||||
Hidden *bool `json:"hidden" validate:"omitempty"`
|
||||
Sort *int32 `json:"sort" validate:"required,min=0"`
|
||||
Status *int16 `json:"status" validate:"required,oneof=0 1"`
|
||||
ParentID *int32 `json:"parent_id" validate:"omitempty,gt=0"`
|
||||
Icon *int32 `json:"icon" validate:"omitempty"`
|
||||
PermissionCode string `json:"permission_code" validate:"required,min=1,max=100"`
|
||||
}
|
||||
|
||||
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"`
|
||||
Component *string `json:"component" validate:"omitempty"`
|
||||
Hidden *bool `json:"hidden" validate:"omitempty"`
|
||||
Sort *int32 `json:"sort" validate:"omitempty,min=0"`
|
||||
Status *int16 `json:"status" validate:"omitempty,oneof=0 1"`
|
||||
ParentID validator.NullInt32 `json:"parent_id" validate:"omitempty"`
|
||||
Icon validator.NullInt32 `json:"icon" validate:"omitempty"`
|
||||
PermissionCode *string `json:"permission_code" validate:"omitempty,min=1,max=100"`
|
||||
}
|
||||
Reference in New Issue
Block a user