typ

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdOmitReq

type IdOmitReq struct {
	IdReq `json:"id" form:"id" binding:"omitempty,gt=0"`
}

type IdReq

type IdReq struct {
	Id int64 `json:"id" form:"id" binding:"required,gt=0"`
}

type IsLimit

type IsLimit int

func (IsLimit) All

func (i IsLimit) All() bool

func (IsLimit) Val

func (i IsLimit) Val() int

type ListResp

type ListResp struct {
	Count int64       `json:"count"`
	List  interface{} `json:"list"`
}

type LoginReq

type LoginReq struct {
	// 4-24
	Username string `json:"username" binding:"required,gte=4,lte=24"`
	// 必需MD5
	Password string `json:"password" binding:"required,len=32"`
}

type LoginResp

type LoginResp struct {
	Token    string `json:"token"`
	Nickname string `json:"nickname"`
	Role     string `json:"role"`
}

type ObjectIdOmitReq

type ObjectIdOmitReq struct {
	ObjectIdReq `json:"id" form:"id" binding:"omitempty,len=24"`
}

type ObjectIdReq

type ObjectIdReq struct {
	Id string `json:"id" form:"id" binding:"required,len=24"`
}

func (ObjectIdReq) ObjectId

func (req ObjectIdReq) ObjectId() (primitive.ObjectID, error)

type PageReq

type PageReq struct {
	Page int `json:"page" form:"page,default=1" binding:"required,gte=1"`
	Size int `json:"size" form:"size,default=20" binding:"required,gte=1,lte=1000"`
}

func (PageReq) FindPage

func (req PageReq) FindPage(opt *options.FindOptions) *options.FindOptions

func (PageReq) Limit

func (req PageReq) Limit() (limit, start int)

type TimeStringReq

type TimeStringReq struct {
	// 格式 2006-01-02 15:04:05
	StartTime string `json:"startTime" form:"startTime"`
	EndTime   string `json:"endTime" form:"endTime"`
}

func (TimeStringReq) FieldMongoBson

func (req TimeStringReq) FieldMongoBson() (bson.M, bool)

func (TimeStringReq) FieldSQLCond

func (req TimeStringReq) FieldSQLCond(field string) []builder.Cond

type TimestampReq

type TimestampReq struct {
	// Unix 时间戳
	StartTimestamp int64 `json:"startTimestamp" form:"startTimestamp,default=0" binding:"omitempty,min=0"`
	EndTimestamp   int64 `json:"endTimestamp" form:"endTimestamp,default=0" binding:"omitempty,gtefield=StartTimestamp"`
}

func (TimestampReq) FieldMongoBson

func (req TimestampReq) FieldMongoBson() (bson.M, bool)

func (TimestampReq) FieldSQLCond

func (req TimestampReq) FieldSQLCond(field string) []builder.Cond

type UidOmitReq

type UidOmitReq struct {
	UidReq `json:"uid" form:"uid" binding:"omitempty,min=1"`
}

type UidReq

type UidReq struct {
	// 用户ID
	Uid int64 `json:"uid" form:"uid" binding:"required,min=1"`
}

Jump to

Keyboard shortcuts

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