apiobj

package
v0.4.19 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 4 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"`
	Version string `json:"version,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
	EmployeeID uint `json:"-"` // DcEmployeeID 大客户员工id
	CustomerID uint `json:"-"` // HsID 健康师的客户id
	Uin        uint `json:"-"` // Uin 用户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