package
Version:
v0.0.0-...-a93d61e
Opens a new window with list of versions in this module.
Published: Apr 26, 2021
License: GPL-3.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
View Source
const (
PostOrderTypeTime = 1
PostOrderTypeScore = 2
)
type CreatePostReq struct {
Title string `json:"title" binding:"required"`
Content string `json:"content" binding:"required"`
AuthorId int64 `json:"author_id"`
PostId int64 `json:"post_id"`
}
type LoginReq struct {
User string `json:"user" binding:"required"`
Password string `json:"password" binding:"required"`
}
type PostsReq struct {
Page uint `json:"page"`
PageSize uint `json:"page_size"`
OrderType int8 `json:"order_type"`
}
type SignupReq struct {
User string `json:"user" binding:"required"`
Password string `json:"password" binding:"required"`
RePassword string `json:"re_password" binding:"required,eqfield=Password"`
}
type User struct {
UserId int64 `db:"user_id"`
Username string `db:"username"`
Password string `db:"password"`
}
type VoteReq struct {
PostId int64 `json:"post_id,string" binding:"required"`
Direction int8 `json:"direction" binding:"oneof=1 0 -1"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.