apiobj

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPageSize 返回列表的默认长度
	DefaultPageSize = 10
	// PageMaxCount 返回列表的最大长度
	PageMaxCount = 150
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	Cmd string `json:"cmd"`
	Env string `json:"env,omitempty"`
}

BaseRequest base request

type BaseResponse

type BaseResponse struct {
	Code      uint32 `json:"code"`
	Message   string `json:"message,omitempty"`
	Env       string `json:"env,omitempty"`
	RequestID string `json:"request_id,omitempty"`
}

BaseResponse base response

type DetailIdRequest

type DetailIdRequest struct {
	BaseRequest
	Request struct {
		ID uint `json:"id"`
	}
}

DetailIdRequest detail base request

type DetailNameRequest

type DetailNameRequest struct {
	BaseRequest
	Request struct {
		ID   uint   `json:"id"`
		Name string `json:"name"`
	}
}

DetailNameRequest detail base request

type Filter

type Filter struct {
	Field      string
	Value      []string
	ExactMatch bool
}

Filter 过滤条件

type PageQuery

type PageQuery struct {
	Offset    int       `json:",omitempty"`
	Limit     int       `json:",omitempty"`
	ListAll   bool      `json:",omitempty"`
	OrderBy   []string  `json:",omitempty"`
	Filters   []Filter  `json:",omitempty"`
	BeginTime time.Time `json:",omitempty"`
	EndTime   time.Time `json:",omitempty"`

	IsBackend    bool `json:"-"`
	CompanyID    uint `json:"-"` // CompanyID 大客户企业id
	DcEmployeeID uint `json:"-"` // DcEmployeeID 大客户员工id
	OperatorID   uint `json:"-"` // OperatorID 运营平台员工id
	AccountID    uint `json:"-"` // AccountID 用户小程序账户id
	UserID       uint `json:"-"` // UserID 用户id
	HsID         uint `json:"-"` // HsID 健康师id

}

PageQuery .

func (*PageQuery) Fill

func (p *PageQuery) Fill(req *http.Request)

Fill 填充值

func (PageQuery) IsValite

func (p PageQuery) IsValite(allower interface{}) error

IsValite 检查是否合法

type QueryRequest

type QueryRequest struct {
	BaseRequest

	Request PageQuery
}

QueryRequest query request

type QueryResponse

type QueryResponse struct {
	Total  int64 `json:"total"`
	Offset int   `json:"offset"`
	Limit  int   `json:"limit"`
}

QueryResponse .

Jump to

Keyboard shortcuts

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