xreply

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPageSize = 50

	ModeOrigin = 1 // origin
	ModeTime   = 2 // sort by time
	ModeHot    = 3 // sort by hot

	FolderKindSub  = "s"
	FolderKindRoot = "r"

	CursorModePage   = 1 // pn ps翻页的
	CursorModeCursor = 2 // 按游标翻页的
)

const

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonReq

type CommonReq struct {
	Plat    int8   `form:"plat"`
	Build   int64  `form:"build"`
	Buvid   string `form:"buvid"`
	MobiApp string `form:"mobi_app"`
	Mid     int64  `form:"mid"`
	IP      string `form:"ip`
}

CommonReq ...

type CommonRes

type CommonRes struct {
	Assist    int         `json:"assist"`
	Blacklist int         `json:"blacklist"`
	Config    ReplyConfig `json:"config"`
	Upper     Upper       `json:"upper"`
}

type Cursor

type Cursor struct {
	IsBegin bool `json:"is_begin"`
	Prev    int  `json:"prev"`
	Next    int  `json:"next"`
	IsEnd   bool `json:"is_end"`
	Ps      int  `json:"ps"`
}

Cursor Common Cursor

func (*Cursor) Backward

func (c *Cursor) Backward() bool

Backward ...

func (*Cursor) Forward

func (c *Cursor) Forward() bool

Forward ...

func (*Cursor) Latest

func (c *Cursor) Latest() bool

Latest ...

type CursorReq

type CursorReq struct {
	Ps   int `form:"ps" validate:"omitempty,min=1,max=50" default:"20"`
	Prev int `form:"prev"`
	Next int `form:"next"`
	Mode int `form:"mode"`
}

CursorReq ...

func (*CursorReq) Backward

func (cq *CursorReq) Backward() bool

func (*CursorReq) Forward

func (cq *CursorReq) Forward() bool

func (*CursorReq) Latest

func (cq *CursorReq) Latest() bool

Latest ...

func (*CursorReq) Legal

func (cq *CursorReq) Legal() bool

Legal ...

type CursorRes

type CursorRes struct {
	AllCount    int   `json:"all_count,omitempty"`
	IsBegin     bool  `json:"is_begin"`
	Prev        int   `json:"prev"`
	Next        int   `json:"next"`
	IsEnd       bool  `json:"is_end"`
	Ps          int   `json:"ps,omitempty"`
	Mode        int   `json:"mode,omitempty"`
	SupportMode []int `json:"support_mode,omitempty"`
}

CursorRes ...

type ReplyCommonReq

type ReplyCommonReq struct {
	Oid  int64 `form:"oid" validate:"required"`
	Type int8  `form:"type" validate:"required"`
}

ReplyCommonReq ...

type ReplyConfig

type ReplyConfig struct {
	ShowAdmin int8 `json:"showadmin"`
	ShowEntry int8 `json:"showentry"`
	ShowFloor int8 `json:"showfloor"`
}

type ReplyReq

type ReplyReq struct {
	CommonReq
	ReplyCommonReq
	Cursor CursorReq
}

func (*ReplyReq) ModeInfo

func (req *ReplyReq) ModeInfo(hotMap map[int64]int8, floorMap map[int64]int8) (mode int, supportMode []int)

...

type ReplyRes

type ReplyRes struct {
	Cursor  CursorRes      `json:"cursor"`
	Hots    []*reply.Reply `json:"hots"`
	Notice  *reply.Notice  `json:"notice"`
	Replies []*reply.Reply `json:"replies"`
	Top     TopReply       `json:"top"`
	Folder  reply.Folder   `json:"folder"`
	CommonRes
}

type RootFolderReq

type RootFolderReq struct {
	CommonReq
	ReplyCommonReq
	Cursor CursorReq
	Root   int64 `form:"root" validate:"required"`
}

type RootFolderRes

type RootFolderRes struct {
	Cursor  CursorRes      `json:"cursor"`
	Replies []*reply.Reply `json:"replies"`
	CommonRes
}

type SubFolderReq

type SubFolderReq struct {
	CommonReq
	ReplyCommonReq
	Cursor CursorReq
}

type SubFolderRes

type SubFolderRes struct {
	Cursor  CursorRes      `json:"cursor"`
	Replies []*reply.Reply `json:"replies"`
	CommonRes
}

type TopReply

type TopReply struct {
	Admin *reply.Reply `json:"admin"`
	Upper *reply.Reply `json:"upper"`
}

type Upper

type Upper struct {
	Mid int64 `json:"mid"`
}

Jump to

Keyboard shortcuts

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