views

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 精确查询
	EXACT = "exact"
	// 不区分大小写精确查询
	IEXACT = "iexact"
	// 包含查询
	CONTAINS = "contains"
	// 不区分大小写包含查询
	ICONTAINS = "icontains"
	// 小于查询
	LT = "lt"
	// 小于等于查询
	LTE = "lte"
	// 大于查询
	GT = "gt"
	// 大于等于查询
	GTE = "gte"
	// 包含查询
	IN = "in"
	// 开头查询
	STARTSWITH = "startswith"
	// 结尾查询
	ENDSWITH = "endswith"
	// 年查询
	YEAR = "year"
	// 月查询
	MONTH = "month"
	// 日查询
	DAY = "day"
	// 时查询
	HOUR = "hour"
	// 分查询
	MINUTE = "minute"
	// 秒查询
	SECOND = "second"
	// 是否为空查询
	ISNULL = "isnull"
	// 搜索查询
	SEARCH = "search"
	// 正则查询
	REGEX = "regex"
	// 不区分大小写正则查询
	IREGEX = "iregex"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ListAPIView

type ListAPIView struct {
	// contains filtered or unexported fields
}

------------------- 查询列表 -------------------

func NewListAPIView

func NewListAPIView(conf *ListAPIViewConf) *ListAPIView

func (*ListAPIView) List

func (v *ListAPIView) List(ctx iris.Context) response.IRFResult

type ListAPIViewConf

type ListAPIViewConf struct {
	Model interface{} // 设置 model
	// db    *gorm.DB    // 设置 db
	// 分页放到 view里面解析
	// Page         int      // 设置分页, 默认为 1
	// PageSize     int      // 设置分页大小, 默认为 10
	FilterFields []string // 设置过滤字段
}

type RetrieveAPIView

type RetrieveAPIView struct {
	// contains filtered or unexported fields
}

------------------- 根据主键获取单个对象 -------------------

func NewRetrieveAPIView

func NewRetrieveAPIView(conf *RetrieveAPIViewConf) *RetrieveAPIView

func (*RetrieveAPIView) GetBy

func (v *RetrieveAPIView) GetBy(ctx iris.Context, pk interface{}) response.IRFResult

type RetrieveAPIViewConf

type RetrieveAPIViewConf struct {
	Model interface{} // 设置 model

}

Jump to

Keyboard shortcuts

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