Documentation ¶
Index ¶
- type ChangePasswordRequest
- type CreatePostRequest
- type CreatePostResponse
- type CreateUserRequest
- type GetPostResponse
- type GetUserResponse
- type ListPostRequest
- type ListPostResponse
- type ListUserRequest
- type ListUserResponse
- type LoginRequest
- type LoginResponse
- type PostInfo
- type UpdatePostRequest
- type UpdateUserRequest
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangePasswordRequest ¶
type ChangePasswordRequest struct { // 旧密码. OldPassword string `json:"oldPassword" valid:"required,stringlength(6|18)"` // 新密码. NewPassword string `json:"newPassword" valid:"required,stringlength(6|18)"` }
ChangePasswordRequest 指定了 `POST /v1/users/{name}/change-password` 接口的请求参数.
type CreatePostRequest ¶
type CreatePostRequest struct { Title string `json:"title" valid:"required,stringlength(1|256)"` Content string `json:"content" valid:"required,stringlength(1|10240)"` }
CreatePostRequest 指定了 `POST /v1/posts` 接口的请求参数.
type CreatePostResponse ¶
type CreatePostResponse struct {
PostID string `json:"postID"`
}
CreatePostResponse 指定了 `POST /v1/posts` 接口的返回参数.
type CreateUserRequest ¶
type CreateUserRequest struct { Username string `json:"username" valid:"alphanum,required,stringlength(1|255)"` Password string `json:"password" valid:"required,stringlength(6|18)"` Nickname string `json:"nickname" valid:"required,stringlength(1|255)"` Email string `json:"email" valid:"required,email"` Phone string `json:"phone" valid:"required,stringlength(11|11)"` }
CreateUserRequest 指定了 `POST /v1/users` 接口的请求参数.
type GetPostResponse ¶
type GetPostResponse PostInfo
GetPostResponse 指定了 `GET /v1/posts/{postID}` 接口的返回参数.
type GetUserResponse ¶
type GetUserResponse UserInfo
GetUserResponse 指定了 `GET /v1/users/{name}` 接口的返回参数.
type ListPostRequest ¶
ListPostRequest 指定了 `GET /v1/posts` 接口的请求参数.
type ListPostResponse ¶
type ListPostResponse struct { TotalCount int64 `json:"totalCount"` Posts []*PostInfo `json:"posts"` }
ListPostResponse 指定了 `GET /v1/posts` 接口的返回参数.
type ListUserRequest ¶
ListUserRequest 指定了 `GET /v1/users` 接口的请求参数.
type ListUserResponse ¶
type ListUserResponse struct { TotalCount int64 `json:"totalCount"` Users []*UserInfo `json:"users"` }
ListUserResponse 指定了 `GET /v1/users` 接口的返回参数.
type LoginRequest ¶
type LoginRequest struct { Username string `json:"username" valid:"alphanum,required,stringlength(1|255)"` Password string `json:"password" valid:"required,stringlength(6|18)"` }
LoginRequest 指定了 `POST /login` 接口的请求参数.
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
LoginResponse 指定了 `POST /login` 接口的返回参数.
type PostInfo ¶
type PostInfo struct { Username string `json:"username,omitempty"` PostID string `json:"postID,omitempty"` Title string `json:"title"` Content string `json:"content"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` }
PostInfo 指定了博客的详细信息.
type UpdatePostRequest ¶
type UpdatePostRequest struct { Title *string `json:"title" valid:"stringlength(1|256)"` Content *string `json:"content" valid:"stringlength(1|10240)"` }
UpdatePostRequest 指定了 `PUT /v1/posts` 接口的请求参数.
type UpdateUserRequest ¶
type UpdateUserRequest struct { Nickname *string `json:"nickname" valid:"stringlength(1|255)"` Email *string `json:"email" valid:"email"` Phone *string `json:"phone" valid:"stringlength(11|11)"` }
UpdateUserRequest 指定了 `PUT /v1/users/{name}` 接口的请求参数.