model

package
v0.0.0-...-228285a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiPostDetail

type ApiPostDetail struct {
	AuthorName string `json:"author_name"`
	VoteNum    int64  `json:"vote_num"`
	*Post
	*Community `json:"community"`
}

type CommentDetail

type CommentDetail struct {
	PostId       int64     `json:"post_id,string" db:"post_id" binding:"required"`
	CommentId    int64     `json:"comment_id,string" db:"comment_id"`
	UserId       int64     `json:"user_id,string" db:"user_id"`
	RevId        int64     `json:"rev_id,string" db:"rev_id"  binding:"required"`
	FatherId     int64     `json:"father_id,string" db:"father_id" binding:"required"`
	UserName     string    `json:"user_name" db:"user_name"`
	Content      string    `json:"content" db:"content" binding:"required"`
	RevName      string    `json:"rev_name" db:"rev_name"`
	IsTopComment int       `json:"is_top_comment" db:"is_top" binding:"required"`
	CreateTime   time.Time `json:"create_time" db:"create_time"`
}

type CommentList

type CommentList struct {
	*CommentDetail
	Replay []*CommentDetail `json:"replay"`
}

type Community

type Community struct {
	ID   int64  `json:"id"db:"community_id"`
	Name string `json:"name" db:"community_name"`
}

type CommunityDetail

type CommunityDetail struct {
	ID           int64     `json:"id"db:"community_id"`
	Name         string    `json:"name" db:"community_name"`
	Introduction string    `json:"introduction,omitempty" db:"introduction"`
	CreateTime   time.Time `json:"create_time" db:"create_time"`
}

type ParamLogin

type ParamLogin struct {
	UserName string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type ParamOrder

type ParamOrder struct {
	Page  int64  `form:"page"`
	Size  int64  `form:"size"`
	Order string `form:"order"`
}

type ParamSignUp

type ParamSignUp struct {
	UserName   string `json:"username" binding:"required"`
	Password   string `json:"password" binding:"required"`
	RePassword string `json:"re_password" binding:"required"`
}

type ParamVote

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

type Post

type Post struct {
	ID          int64     `json:"post_id" db:"post_id"`
	AuthorId    int64     `json:"author_id" db:"author_id"`
	CommunityId int64     `json:"community_id" db:"community_id" binding:"required"`
	Status      int32     `json:"status" db:"status"`
	Title       string    `json:"title" db:"title" binding:"required"`
	Content     string    `json:"content" db:"content" binding:"required"`
	CreateTime  time.Time `json:"create_time" db:"create_time"`
}

type User

type User struct {
	UserID   int64  `db:"user_id"`
	UserName string `db:"username"`
	Password string `db:"password"`
}

Jump to

Keyboard shortcuts

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