feat: release v1.0.0
This commit is contained in:
@@ -3,9 +3,11 @@ package request
|
||||
type CreateCategoryRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1"`
|
||||
Code string `json:"code" validate:"required,min=1"`
|
||||
Sort *int32 `json:"sort" validate:"required"`
|
||||
}
|
||||
|
||||
type UpdateCategoryRequest struct {
|
||||
Name *string `json:"name" validate:"omitempty,min=1"`
|
||||
Code *string `json:"code" validate:"omitempty,min=1"`
|
||||
Sort *int32 `json:"sort" validate:"omitempty"`
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
type CreatePostRequest struct {
|
||||
Title string `json:"title" validate:"required,min=1"`
|
||||
CoverID *int32 `json:"cover_id" validate:"required,min=1"`
|
||||
CoverID int32 `json:"cover_id" validate:"required,min=1"`
|
||||
Slug string `json:"slug" validate:"required,min=0"`
|
||||
Content string `json:"content" validate:"required,min=0"`
|
||||
Summary string `json:"summary" validate:"required,min=0"`
|
||||
@@ -14,6 +14,7 @@ type CreatePostRequest struct {
|
||||
Sort *int32 `json:"sort" validate:"required,min=0"`
|
||||
PublishedAt time.Time `json:"published_at" validate:"required"`
|
||||
CategoryID *int32 `json:"category_id" validate:"required,min=1"`
|
||||
Tags []int32 `json:"tags" validate:"omitempty,dive,min=1"`
|
||||
}
|
||||
|
||||
type UpdatePostRequest struct {
|
||||
@@ -27,4 +28,5 @@ type UpdatePostRequest struct {
|
||||
Sort *int32 `json:"sort" validate:"omitempty,min=0"`
|
||||
PublishedAt *time.Time `json:"published_at" validate:"omitempty"`
|
||||
CategoryID *int32 `json:"category_id" validate:"required,min=1"`
|
||||
Tags []int32 `json:"tags" validate:"omitempty,dive,min=1"`
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package request
|
||||
|
||||
import "server/internal/model/common"
|
||||
|
||||
type CreateSysApiRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=100"`
|
||||
GroupName string `json:"group_name" validate:"required,min=1,max=100"`
|
||||
@@ -15,3 +17,9 @@ type UpdateSysApiRequest struct {
|
||||
Method string `json:"method" validate:"required,oneof=GET POST PUT PATCH DELETE"`
|
||||
Sort *int32 `json:"sort" validate:"required,min=0"`
|
||||
}
|
||||
|
||||
type SearchSysApiParams struct {
|
||||
common.Pagination
|
||||
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"`
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
type CreateSysMenuRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=100"`
|
||||
Path string `json:"path" 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"`
|
||||
@@ -19,13 +19,13 @@ type CreateSysMenuRequest struct {
|
||||
|
||||
type UpdateSysMenuRequest struct {
|
||||
Name *string `json:"name" validate:"omitempty,min=1,max=100"`
|
||||
Path *string `json:"path" 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 *int32 `json:"icon" validate:"omitempty"`
|
||||
Icon validator.NullInt32 `json:"icon" validate:"omitempty"`
|
||||
PermissionCode *string `json:"permission_code" validate:"omitempty,min=1,max=100"`
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
package request
|
||||
@@ -1,12 +1,14 @@
|
||||
package request
|
||||
|
||||
type CreateSysRoleRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=100"`
|
||||
Code string `json:"code" validate:"required,max=100"`
|
||||
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 {
|
||||
Name *string `json:"name" validate:"min=1,max=100"`
|
||||
Name *string `json:"name" validate:"min=1,max=100"`
|
||||
Status *int16 `json:"status" validate:"omitempty,oneof=0 1"`
|
||||
}
|
||||
|
||||
type SetSysRoleMenusRequest struct {
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"server/internal/model/common"
|
||||
"server/internal/pkg/validator"
|
||||
)
|
||||
|
||||
type CreateSysUserRequest struct {
|
||||
Username string `json:"username" validate:"required"`
|
||||
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"`
|
||||
AvatarID *int32 `json:"avatar_id" validate:"omitempty"`
|
||||
Status *int16 `json:"status" validate:"oneof=0 1"`
|
||||
}
|
||||
|
||||
type UpdateSysUserRequest struct {
|
||||
Username *string `json:"username" validate:"omitempty,min=0,max=50"`
|
||||
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 {
|
||||
@@ -28,3 +31,8 @@ type LoginRequest struct {
|
||||
Account string `json:"account" validate:"required,min=5,max=100"`
|
||||
Password string `json:"password" validate:"required,min=6,max=255"`
|
||||
}
|
||||
|
||||
type SearchSysUserParams struct {
|
||||
common.Pagination
|
||||
Username string `json:"username" validate:"omitempty,max=50"`
|
||||
}
|
||||
|
||||
13
internal/model/request/tag.go
Normal file
13
internal/model/request/tag.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package request
|
||||
|
||||
type CreateTagRequest struct {
|
||||
Name string `json:"name" validate:"required,min=1"`
|
||||
Code string `json:"code" validate:"required,min=1"`
|
||||
Sort *int32 `json:"sort" validate:"required"`
|
||||
}
|
||||
|
||||
type UpdateTagRequest struct {
|
||||
Name *string `json:"name" validate:"omitempty,min=1"`
|
||||
Code *string `json:"code" validate:"omitempty,min=1"`
|
||||
Sort *int32 `json:"sort" validate:"omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user