note

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	ID        int       `json:"id"`                                  // 记录ID
	UserID    int       `json:"userID" db:"user_id" rel:"t_user.id"` // 用户ID
	Title     string    `json:"title"`                               // 标题
	Detail    string    `json:"detail"`                              // 详情
	CreatedAt time.Time `json:"createdAt" db:"created_at"`           // 创建时间
}

Entity 笔记 与表结构对应,其它结构在此基础上进行增改

func (Entity) Filter

func (e Entity) Filter() interface{}

Filter 过滤器

func (Entity) Join

func (e Entity) Join(f func(Entity) Entity) Entity

Join 连接 这里又怎么会知道要跟谁join呢?所以只能在ao里做,这里做是没意义的

func (Entity) Process

func (e Entity) Process() Entity

Process 处理

type EntityList

type EntityList []Entity

EntityList 列表

type Noter

type Noter interface {
	AddOne(ctx context.Context) (id int, err error)
	Add(ctx context.Context, entity Entity) (id int, err error)
	Mod(ctx context.Context, id int, entity Entity) (err error)
	Del(ctx context.Context, id int) (err error)
	GetPage(ctx context.Context, entity Entity, param app.CommonParam) (
		res EntityList,
		total int,
		err error,
	)
	Get(ctx context.Context, id int) (entity Entity, err error)
	GetList(ctx context.Context, ids []int64) (entitys EntityList, err error)
}

Noter 笔记接口

func New

func New() Noter

New 新建

type Pages

type Pages []struct {
	Entity
	Total int
}

Pages 分页列表

func (Pages) Transfer

func (p Pages) Transfer() (res []Entity, total int, err error)

Transfer 转换

Jump to

Keyboard shortcuts

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