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: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type INote

type INote interface {
	GetPage(ctx context.Context, param PageParam) (r PageResult, err error)
	Get(ctx context.Context, id int) (r Result, err error)
	AddOne(ctx context.Context) (id int, err error)
	Mod(ctx context.Context, id int, p Param) (err error)
	Del(ctx context.Context, id int) (err error)
	Publish(ctx context.Context, id int) error
	Hide(ctx context.Context, id int) error
}

func New

func New(
	nm note.Noter,
) INote

type ModParam

type ModParam struct {
	NoteID int `json:"noteID"` // 记录ID
	Param
}

ModParam 修改参数

func (ModParam) Check

func (m ModParam) Check(ctx context.Context) error

Check 检查

type PageParam

type PageParam struct {
	Title  string `json:"title"`  // 标题
	Detail string `json:"detail"` // 详情

	app.CommonParam
}

PageParam 分页参数

type PageResult

type PageResult struct {
	Total int      `json:"total"` // 总数
	List  []Result `json:"list"`  // 列表
}

PageResult 分页结果

type Param

type Param struct {
	Title  string `json:"title"`  // 标题
	Detail string `json:"detail"` // 详情
}

Param 参数

func (Param) Check

func (p Param) Check(ctx context.Context) error

Check 检查

type Result

type Result struct {
	NoteID    int    `json:"noteID"`    // 笔记ID
	UserName  string `json:"userName"`  // 用户名
	Title     string `json:"title"`     // 标题
	Detail    string `json:"detail"`    // 详情
	CreatedAt int64  `json:"createdAt"` // 创建时间
}

Result 结果

func (Result) Init

func (r Result) Init(single note.Entity) (Result, error)

Init 初始化

Jump to

Keyboard shortcuts

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