model

package
v0.0.0-...-bcec4d7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllStatus = iota
	CheckStatus
	SuccessStatus
	FailStatus
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminInput

type AdminInput struct {
	Username string
	Password string
	Nickname string
	Avatar   string
}

type ArticleGrpInput

type ArticleGrpInput struct {
	Name        string `v:"required|length:2, 30"`
	Tags        string `v:"length:1, 200"`
	Description string `v:"length:2, 200"`
	Onshow      bool   `v:"required"`
	Order       int    `json:"order" v:"integer|between:-9999,9999"`
}

type ArticleGrpListSafe

type ArticleGrpListSafe struct {
	entity.ArticleGrp
	ArticleCount uint `json:"article_count"`
	Onshow       Out  `json:"onshow,omitempty"`
	Order        Out  `json:"order,omitempty"`
}

type ArticleInput

type ArticleInput struct {
	GrpId       Id     `json:"grpId" v:"required|integer|between:1,4294967295"`
	Title       string `json:"title" v:"required|length:2, 100"`
	Author      string `json:"author" v:"length:2, 30"`
	Thumb       string `json:"thumb" v:"length:2, 200"`
	Tags        string `json:"tags" v:"length:2, 200"`
	Description string `json:"description" v:"length:2, 200"`
	Content     string `json:"content" v:"length:2, 100000"`
	Order       int    `json:"order" v:"integer|between:-9999,9999"`
	Ontop       uint   `json:"ontop" v:"boolean"`
	Onshow      uint   `json:"onshow" v:"boolean"`
	Hist        uint   `json:"hist" v:"integer|between:0,999999"`
	Post        uint   `json:"post" v:"integer|between:0,999999"`
}

type ArticleList

type ArticleList struct {
	entity.Article
	Content   Out `json:"content,omitempty"`
	DeletedAt Out `json:"deletedAt,omitempty"`
}

type ArticleListSafe

type ArticleListSafe struct {
	entity.Article
	ArticleSafe
	Content Out `json:"content,omitempty"`
}

type ArticleQuery

type ArticleQuery struct {
	ArticleQuerySafe
	Onshow bool `json:"onshow" dc:"是否查询只发布的文章"`
	IsDel  bool `json:"isDel" dc:"是否查询删除掉的文章"`
}

type ArticleQuerySafe

type ArticleQuerySafe struct {
	Paging
	GrpId  Id     `v:"integer|between:1,4294967295" json:"grpId"`
	Search string `v:"length: 1,30" json:"search" dc:"查询文本,会检索标题、标签、简介"`
}

type ArticleSafe

type ArticleSafe struct {
	*entity.Article
	Order     Out `json:"order,omitempty"`
	Ontop     Out `json:"ontop,omitempty"`
	Onshow    Out `json:"onshow,omitempty"`
	DeletedAt Out `json:"deletedAt,omitempty"`
}

type FileInfo

type FileInfo struct {
	Name string `json:"name" dc:"文件名称"`
	Url  string `json:"path" dc:"文件URL"`
	Dir  string `json:"-" dc:"文件DIR"` // dir不能暴露到外部,他包含着服务器的目录结构
}

type Id

type Id uint32

Id 主键类型

type IdInput

type IdInput struct {
	Id Id `json:"id" v:"required|integer|between:1,4294967295"`
}

IdInput 公共Id input,一般用作api中的upd和del

type LinkInput

type LinkInput struct {
	Name        string `json:"name" v:"required|length:1, 20"`
	Description string `json:"description" v:"length:2, 200"`
	Link        string `json:"link" v:"required|length:1, 200"`
}

type Login

type Login struct {
	Username string
	Password string
}

type Out

type Out bool

Out 标记剔除字段

type Paging

type Paging struct {
	Page int `v:"integer|between:1,9999999" json:"page" dc:"查询分页:页码,默认1"`
	Size int `v:"integer|between:1,100" json:"size" dc:"查询分页:条数,默认15"`
}

Paging 分页查询条件

type ReplyBody

type ReplyBody struct {
	Name    string `json:"name" v:"required|length:1,20"`
	Email   string `json:"email" v:"required|email|length:1,100"`
	Site    string `json:"site" v:"url|length:1,50"`
	Content string `json:"content" v:"required|length:2, 100000"`
}

ReplyBody 回复内容主体

type ReplyFloorApp

type ReplyFloorApp struct {
	Id        Id              `json:"id"        description:""`
	Pid       Id              `json:"pid"       description:"回复父id"`
	PName     string          `json:"pName"     description:"回复父名称"`
	Email     string          `json:"email"     description:"回复人邮箱"`
	Name      string          `json:"name"      description:"回复人名称"`
	Site      string          `json:"site"      description:"回复人网站"`
	Content   string          `json:"content"   description:"回复内容"`
	CreatedAt *gtime.Time     `json:"createdAt" description:"创建时间"`
	UpdatedAt *gtime.Time     `json:"updatedAt" description:"更新时间"`
	List      []ReplyFloorApp `json:"list"      description:"子回复列表"`
}

ReplyFloorApp 回复楼,是一个二维结构

type ReplyInput

type ReplyInput struct {
	ReplyInputApp
	Status ReplyStatus `json:"status" v:"in:1,2,3" dc:"审核状态,1待审核 2审核通过 3审核失败,默认2"`
}

ReplyInput 新增回复,多了Status

type ReplyInputApp

type ReplyInputApp struct {
	ReplyBody
	Aid Id `json:"aid" v:"required|integer|between:1,4294967295"`
	Pid Id `json:"pid" v:"required|integer|between:0,4294967295" dc:"如果传入pid,aid会自动跟随父回复"`
}

ReplyInputApp App新增回复

type ReplyQuery

type ReplyQuery struct {
	Paging
	Aid    Id          `json:"aid" v:"integer|between:1,4294967295"`
	Status ReplyStatus `json:"status" v:"in:1,2,3" dc:"查询状态,1待审核 2审核通过 3审核失败	,不传则查询所有"`
	Search string      `v:"length: 1,30" json:"search" dc:"查询文本,会检索名称,邮箱,内容"`
}

type ReplyShow

type ReplyShow struct {
	ArticleTitle string       `json:"articleTitle" dc:"回复的文章标题"`
	ParentReply  entity.Reply `json:"parentReply" dc:"父级回复"`
	entity.Reply
}

type ReplyStatus

type ReplyStatus uint8

ReplyStatus 回复审核状态

type SentenceInput

type SentenceInput struct {
	Id       Id
	BookId   Id
	TagIds   []Id
	Sentence string
}

type SentenceQuery

type SentenceQuery struct {
	Paging
	BookId Id
	// 根据指定id查询
	Ids []Id
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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