models

package
v0.0.0-...-a93d61e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostOrderTypeTime  = 1
	PostOrderTypeScore = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePostReq

type CreatePostReq struct {
	Title       string `json:"title" binding:"required"`
	Content     string `json:"content" binding:"required"`
	CommunityId int64  `json:"community_id" binding:"required"`
	AuthorId    int64  `json:"author_id"`
	PostId      int64  `json:"post_id"`
}

type LoginReq

type LoginReq struct {
	User     string `json:"user" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type PostsReq

type PostsReq struct {
	Page        uint  `json:"page"`
	PageSize    uint  `json:"page_size"`
	OrderType   int8  `json:"order_type"` // 1 时间,2 点赞
	CommunityId int64 `json:"community_id"`
}

type SignupReq

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

type User struct {
	UserId   int64  `db:"user_id"`
	Username string `db:"username"`
	Password string `db:"password"`
}

type VoteReq

type VoteReq struct {
	PostId    int64 `json:"post_id,string" binding:"required"`
	Direction int8  `json:"direction" binding:"oneof=1 0 -1"`
}

Jump to

Keyboard shortcuts

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