Compare commits
2 Commits
7dc119ecde
...
54e37e59fc
| Author | SHA1 | Date | |
|---|---|---|---|
| 54e37e59fc | |||
| 5d4b38ddc4 |
92
docs/docs.go
92
docs/docs.go
@@ -1819,6 +1819,9 @@ const docTemplate = `{
|
||||
"definitions": {
|
||||
"dto.ConfirmAccountDeletionRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"token"
|
||||
],
|
||||
"properties": {
|
||||
"delete_posts": {
|
||||
"type": "boolean"
|
||||
@@ -1830,20 +1833,30 @@ const docTemplate = `{
|
||||
},
|
||||
"dto.CreatePostRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url"
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 10000
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 200,
|
||||
"minLength": 3
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 2048
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.ForgotPasswordRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"username_or_email"
|
||||
],
|
||||
"properties": {
|
||||
"username_or_email": {
|
||||
"type": "string"
|
||||
@@ -1852,12 +1865,20 @@ const docTemplate = `{
|
||||
},
|
||||
"dto.LoginRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"password",
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 50,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1875,31 +1896,51 @@ const docTemplate = `{
|
||||
},
|
||||
"dto.RegisterRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email",
|
||||
"password",
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 254
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 50,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.ResendVerificationRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email"
|
||||
],
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 254
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.ResetPasswordRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"new_password",
|
||||
"token"
|
||||
],
|
||||
"properties": {
|
||||
"new_password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
@@ -1920,39 +1961,60 @@ const docTemplate = `{
|
||||
},
|
||||
"dto.UpdateEmailRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email"
|
||||
],
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 254
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePasswordRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"current_password",
|
||||
"new_password"
|
||||
],
|
||||
"properties": {
|
||||
"current_password": {
|
||||
"type": "string"
|
||||
},
|
||||
"new_password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePostRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"title"
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 10000
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 200,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdateUsernameRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 50,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1816,6 +1816,9 @@
|
||||
"definitions": {
|
||||
"dto.ConfirmAccountDeletionRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"token"
|
||||
],
|
||||
"properties": {
|
||||
"delete_posts": {
|
||||
"type": "boolean"
|
||||
@@ -1827,20 +1830,30 @@
|
||||
},
|
||||
"dto.CreatePostRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url"
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 10000
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 200,
|
||||
"minLength": 3
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 2048
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.ForgotPasswordRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"username_or_email"
|
||||
],
|
||||
"properties": {
|
||||
"username_or_email": {
|
||||
"type": "string"
|
||||
@@ -1849,12 +1862,20 @@
|
||||
},
|
||||
"dto.LoginRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"password",
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 50,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1872,31 +1893,51 @@
|
||||
},
|
||||
"dto.RegisterRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email",
|
||||
"password",
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 254
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 50,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.ResendVerificationRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email"
|
||||
],
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 254
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.ResetPasswordRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"new_password",
|
||||
"token"
|
||||
],
|
||||
"properties": {
|
||||
"new_password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
@@ -1917,39 +1958,60 @@
|
||||
},
|
||||
"dto.UpdateEmailRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email"
|
||||
],
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 254
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePasswordRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"current_password",
|
||||
"new_password"
|
||||
],
|
||||
"properties": {
|
||||
"current_password": {
|
||||
"type": "string"
|
||||
},
|
||||
"new_password": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 128,
|
||||
"minLength": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdatePostRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"title"
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 10000
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 200,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.UpdateUsernameRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"maxLength": 50,
|
||||
"minLength": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6,27 +6,44 @@ definitions:
|
||||
type: boolean
|
||||
token:
|
||||
type: string
|
||||
required:
|
||||
- token
|
||||
type: object
|
||||
dto.CreatePostRequest:
|
||||
properties:
|
||||
content:
|
||||
maxLength: 10000
|
||||
type: string
|
||||
title:
|
||||
maxLength: 200
|
||||
minLength: 3
|
||||
type: string
|
||||
url:
|
||||
maxLength: 2048
|
||||
type: string
|
||||
required:
|
||||
- url
|
||||
type: object
|
||||
dto.ForgotPasswordRequest:
|
||||
properties:
|
||||
username_or_email:
|
||||
type: string
|
||||
required:
|
||||
- username_or_email
|
||||
type: object
|
||||
dto.LoginRequest:
|
||||
properties:
|
||||
password:
|
||||
maxLength: 128
|
||||
minLength: 8
|
||||
type: string
|
||||
username:
|
||||
maxLength: 50
|
||||
minLength: 3
|
||||
type: string
|
||||
required:
|
||||
- password
|
||||
- username
|
||||
type: object
|
||||
dto.RefreshTokenRequest:
|
||||
properties:
|
||||
@@ -39,23 +56,40 @@ definitions:
|
||||
dto.RegisterRequest:
|
||||
properties:
|
||||
email:
|
||||
maxLength: 254
|
||||
type: string
|
||||
password:
|
||||
maxLength: 128
|
||||
minLength: 8
|
||||
type: string
|
||||
username:
|
||||
maxLength: 50
|
||||
minLength: 3
|
||||
type: string
|
||||
required:
|
||||
- email
|
||||
- password
|
||||
- username
|
||||
type: object
|
||||
dto.ResendVerificationRequest:
|
||||
properties:
|
||||
email:
|
||||
maxLength: 254
|
||||
type: string
|
||||
required:
|
||||
- email
|
||||
type: object
|
||||
dto.ResetPasswordRequest:
|
||||
properties:
|
||||
new_password:
|
||||
maxLength: 128
|
||||
minLength: 8
|
||||
type: string
|
||||
token:
|
||||
type: string
|
||||
required:
|
||||
- new_password
|
||||
- token
|
||||
type: object
|
||||
dto.RevokeTokenRequest:
|
||||
properties:
|
||||
@@ -68,26 +102,43 @@ definitions:
|
||||
dto.UpdateEmailRequest:
|
||||
properties:
|
||||
email:
|
||||
maxLength: 254
|
||||
type: string
|
||||
required:
|
||||
- email
|
||||
type: object
|
||||
dto.UpdatePasswordRequest:
|
||||
properties:
|
||||
current_password:
|
||||
type: string
|
||||
new_password:
|
||||
maxLength: 128
|
||||
minLength: 8
|
||||
type: string
|
||||
required:
|
||||
- current_password
|
||||
- new_password
|
||||
type: object
|
||||
dto.UpdatePostRequest:
|
||||
properties:
|
||||
content:
|
||||
maxLength: 10000
|
||||
type: string
|
||||
title:
|
||||
maxLength: 200
|
||||
minLength: 3
|
||||
type: string
|
||||
required:
|
||||
- title
|
||||
type: object
|
||||
dto.UpdateUsernameRequest:
|
||||
properties:
|
||||
username:
|
||||
maxLength: 50
|
||||
minLength: 3
|
||||
type: string
|
||||
required:
|
||||
- username
|
||||
type: object
|
||||
handlers.APIInfo:
|
||||
properties:
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
package dto
|
||||
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username" validate:"required,min=3,max=50"`
|
||||
Password string `json:"password" validate:"required,min=8,max=128"`
|
||||
}
|
||||
|
||||
type RegisterRequest struct {
|
||||
Username string `json:"username"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username" validate:"required,min=3,max=50"`
|
||||
Email string `json:"email" validate:"required,email,max=254"`
|
||||
Password string `json:"password" validate:"required,min=8,max=128"`
|
||||
}
|
||||
|
||||
type ResendVerificationRequest struct {
|
||||
Email string `json:"email"`
|
||||
Email string `json:"email" validate:"required,email,max=254"`
|
||||
}
|
||||
|
||||
type ForgotPasswordRequest struct {
|
||||
UsernameOrEmail string `json:"username_or_email"`
|
||||
UsernameOrEmail string `json:"username_or_email" validate:"required"`
|
||||
}
|
||||
|
||||
type ResetPasswordRequest struct {
|
||||
Token string `json:"token"`
|
||||
NewPassword string `json:"new_password"`
|
||||
Token string `json:"token" validate:"required"`
|
||||
NewPassword string `json:"new_password" validate:"required,min=8,max=128"`
|
||||
}
|
||||
|
||||
type UpdateEmailRequest struct {
|
||||
Email string `json:"email"`
|
||||
Email string `json:"email" validate:"required,email,max=254"`
|
||||
}
|
||||
|
||||
type UpdateUsernameRequest struct {
|
||||
Username string `json:"username"`
|
||||
Username string `json:"username" validate:"required,min=3,max=50"`
|
||||
}
|
||||
|
||||
type UpdatePasswordRequest struct {
|
||||
CurrentPassword string `json:"current_password"`
|
||||
NewPassword string `json:"new_password"`
|
||||
CurrentPassword string `json:"current_password" validate:"required"`
|
||||
NewPassword string `json:"new_password" validate:"required,min=8,max=128"`
|
||||
}
|
||||
|
||||
type ConfirmAccountDeletionRequest struct {
|
||||
Token string `json:"token"`
|
||||
Token string `json:"token" validate:"required"`
|
||||
DeletePosts bool `json:"delete_posts"`
|
||||
}
|
||||
|
||||
type RefreshTokenRequest struct {
|
||||
RefreshToken string `json:"refresh_token" example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." binding:"required"`
|
||||
RefreshToken string `json:"refresh_token" example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." validate:"required"`
|
||||
}
|
||||
|
||||
type RevokeTokenRequest struct {
|
||||
RefreshToken string `json:"refresh_token" example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." binding:"required"`
|
||||
RefreshToken string `json:"refresh_token" example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." validate:"required"`
|
||||
}
|
||||
|
||||
@@ -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