v1

package
v0.0.0-...-49bf833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIInfo

type AIInfo struct {
	Username string `gorm:"column:username"` // username of the AI content
	PostID   string `gorm:"column:postId"`   // post of the AI content
	Content  string `gorm:"column:content"`  // content of the AI content
}

type ChangePasswordRequest

type ChangePasswordRequest struct {
	OldPassword string `json:"oldPassword" valid:"required,stringlength(6|18)"`
	NewPassword string `json:"newPassword" valid:"required,stringlength(6|18)"`
}

ChangePasswordRequest specifies the request parameters for `POST /v1/users/{username}/change-password`

type CreateAIRequest

type CreateAIRequest AIInfo

type CreatePostRequest

type CreatePostRequest struct {
	Title   string `json:"title" valid:"required,stringlength(1|255)"`
	Content string `json:"content" valid:"required"`
}

CreatePostRequest specifies the request parameters for `POST /v1/posts`

type CreatePostResponse

type CreatePostResponse struct {
	PostID string `json:"post_id"`
}

CreatePostResponse specifies the response parameters for `POST /v1/posts`

type CreateUserRequest

type CreateUserRequest struct {
	Postcount int64  `json:"postcount" valid:"stringlength(1|255)"`
	Username  string `json:"username" valid:"alphanum,required,stringlength(1|30)"`
	Password  string `json:"password" valid:"required,stringlength(6|18)"`
	Nickname  string `json:"nickname" valid:"required,stringlength(1|30)"`
	Email     string `json:"email" valid:"required,email"`
	// only male || female || other
	Gender string `json:"gender" valid:"required"`
	Phone  string `json:"phone" valid:"required,numeric,stringlength(11|11)"`
	QQ     string `json:"qq" valid:"numeric,stringlength(5|16)"`
}

CreateUserRequest specifies the request parameters for `POST /v1/users`

type GetAIResponse

type GetAIResponse AIInfo

type GetPostResponse

type GetPostResponse PostInfo

GetPostResponse specifies the request parameters for `GET /v1/posts/{post_id}`

type GetUserResponse

type GetUserResponse UserInfo

GetUserResponse specifies the response parameters for `GET /v1/users/{username}`

type ListAIRequest

type ListAIRequest struct {
	Offset int `json:"offset"`
	Limit  int `json:"limit"`
}

type ListAIResponse

type ListAIResponse struct {
	TotalCount int64     `json:"total_count,omitempty"`
	AIs        []*AIInfo `json:"AIs,omitempty"`
}

type ListPostsRequest

type ListPostsRequest struct {
	Offset int `form:"offset"`
	Limit  int `form:"limit"`
}

ListPostsRequest specifies the request parameters for `GET /v1/posts`

type ListPostsResponse

type ListPostsResponse struct {
	TotalCount int64       `json:"totalCount"`
	Posts      []*PostInfo `json:"posts"`
}

ListPostsResponse specifies the response parameters for `GET /v1/posts`

type ListUserRequest

type ListUserRequest struct {
	Offset int `form:"offset" valid:"numeric"`
	Limit  int `form:"limit" valid:"numeric"`
}

ListUserRequest specifies the request parameters for `GET /v1/users`

type ListUserResponse

type ListUserResponse struct {
	TotalCount int64       `json:"totalCount" valid:"numeric"`
	Users      []*UserInfo `json:"users"`
}

ListUserResponse specifies the response parameters for `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 specifies the request parameters for `POST /login`

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

LoginResponse specifies the response parameters for `POST /login`

type PostInfo

type PostInfo struct {
	Username  string `json:"username,omitempty"`
	PostID    string `json:"post_id,omitempty"`
	Title     string `json:"title"`
	Content   string `json:"content"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
}

PostInfo is the post's detail info

type UpdateAIRequest

type UpdateAIRequest AIInfo

type UpdatePostRequest

type UpdatePostRequest struct {
	Title   *string `json:"title" valid:"stringlength(1|255)"`
	Content *string `json:"content" valid:"stringlength(1|65535)"`
}

UpdatePostRequest specifies the request parameters for `PUT /v1/posts`

type UpdateUserRequest

type UpdateUserRequest struct {
	Nickname *string `json:"nickname" valid:"stringlength(1|255)"`
	Email    *string `json:"email" valid:"email"`
	Gender   *string `json:"gender" valid:"stringlength(1|10)"`
	Phone    *string `json:"phone" valid:"numeric,stringlength(11|11)"`
	QQ       *string `json:"qq" valid:"numeric,stringlength(5|16)"`
}

UpdateUserRequest specifies the request parameters for `PUT /v1/users/{username}`

type UserInfo

type UserInfo struct {
	PostCount int64  `json:"postcount"`
	Username  string `json:"username"`
	Nickname  string `json:"nickname"`
	Email     string `json:"email"`
	Gender    string `json:"gender"`
	Phone     string `json:"phone"`
	QQ        string `json:"qq"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
}

UserInfo is the user's all information that can be listed

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL