feat: add validation tags to request DTOs
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package dto
|
||||
|
||||
type CreatePostRequest struct {
|
||||
Title string `json:"title"`
|
||||
URL string `json:"url"`
|
||||
Content string `json:"content"`
|
||||
Title string `json:"title" validate:"omitempty,min=3,max=200"`
|
||||
URL string `json:"url" validate:"required,url,max=2048"`
|
||||
Content string `json:"content" validate:"omitempty,max=10000"`
|
||||
}
|
||||
|
||||
type UpdatePostRequest struct {
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Title string `json:"title" validate:"required,min=3,max=200"`
|
||||
Content string `json:"content" validate:"omitempty,max=10000"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user