dao

package
v0.0.0-...-d6956c3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	// 数据开始位置
	Start int `json:"start,omitempty"`
	// 返回数据条数
	Limit int `json:"limit,omitempty"`
	// 字段按照逗号隔开
	Fields string `json:"fields,omitempty"`
	// 排序:sort=otc_type,-created_at,*custom
	// 以符号开头,可选符号:(+或空 正序)(- 倒序)(* 自定义复杂排序标识关键词)
	Sorts []string `json:"sorts,omitempty"`
	// 分组
	GroupBy string `json:"group_by,omitempty"`
}

BaseRequest 公共请求

type IDao

type IDao interface {
	Close()
}

type IModel

type IModel = schema.Tabler

type ITest

type ITest interface {
	// Detail 查询一条
	Detail(ctx context.Context, condition *TestCondition, opts ...Option) (info *model.Test, err error)
	// List 查询多条
	List(ctx context.Context, condition *TestCondition, opts ...Option) (list []*model.Test, err error)
	// Add 添加
	Add(ctx context.Context, data *model.Test, opts ...Option) (err error)
	// Update 更新
	Update(ctx context.Context, condition *TestCondition, updateData map[string]interface{}, opts ...Option) (err error)
}

func NewTest

func NewTest(data ds.IData) ITest

NewTest 创建

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithBaseRequest

func WithBaseRequest(br *BaseRequest) Option

func WithBuild

func WithBuild(build standard.IBuilder) Option

func WithLimit

func WithLimit(limit int) Option

type TestCondition

type TestCondition struct {
	*BaseRequest

	// 查询参数
	Id  int32
	Ids []int32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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