demo

package
v0.0.0-...-9dac4f2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: BSD-2-Clause, MIT, BSD-2-Clause, + 1 more Imports: 5 Imported by: 0

Documentation

Overview

Package demo nolint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCommonQuery

func GetCommonQuery(params http.BaseRequest) model.QueryOption

GetCommonQuery 获取公共查询条件

func ID

func ID(id int32) model.QueryOption

ID 条件

func Name

func Name(name string) model.QueryOption

Name 条件

Types

type Demo

type Demo struct {
	model.BaseModel

	Name  string `json:"name" pg:"name,notnull,unique,default:''"`
	Age   int32  `json:"age" pg:"age,notnull,default:0"`
	State int32  `json:"state" pg:"state,notnull,default:1"`
	// contains filtered or unexported fields
}

Demo 模块

type IDemo

type IDemo interface {
	Create(ctx context.Context, info *Demo, opts ...model.Option) (err error)
	Update(ctx context.Context, con model.IQuery, info *Demo, opts ...model.Option) (err error)
	Delete(ctx context.Context, con model.IQuery, opts ...model.Option) (err error)
	Detail(ctx context.Context, con model.IQuery, opts ...model.Option) (ret *Demo, err error)
	List(ctx context.Context, con model.IQuery, opts ...model.Option) (ret []*Demo, err error)
	Count(ctx context.Context, con model.IQuery, opts ...model.Option) (cnt int32, err error)
}

IDemo 标准

func New

func New(db pg.DBI) (IDemo, error)

New 创建

Jump to

Keyboard shortcuts

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