action

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PathKey = "key"
)

Functions

func SetModel

func SetModel(key string, m *model.Model)

SetModel set model

Types

type Base

type Base struct {
	Models map[string]*model.Model

	TenantIDFunc func(ctx *gin.Context) (any, error)
	// contains filtered or unexported fields
}

Base acton

func GetBase

func GetBase() *Base

GetBase get base

func (*Base) GetModel

func (b *Base) GetModel(ctx *gin.Context) *model.Model

func (*Base) Handler

func (*Base) Handler() gin.HandlersChain

Handler action handler

func (*Base) SetModel

func (b *Base) SetModel(key string, m *model.Model)

func (*Base) String

func (*Base) String() string

String string

type Create

type Create struct {
	*Base
}

Create action

func NewCreate

func NewCreate(b *Base) *Create

NewCreate new create action 真实的

func (*Create) GenOpenAPI

func (e *Create) GenOpenAPI(m *model.Model) *spec.PathItemProps

GenOpenAPI gen open api method: post, Parameters: nil

func (*Create) Handler

func (e *Create) Handler() gin.HandlersChain

Handler create action handler

func (*Create) String

func (*Create) String() string

String print action name

type Delete

type Delete struct {
	*Base
}

Delete action

func NewDelete

func NewDelete(b *Base) *Delete

NewDelete new delete action

func (*Delete) Handler

func (e *Delete) Handler() gin.HandlersChain

Handler delete action handler

func (*Delete) String

func (*Delete) String() string

String print action name

type Get

type Get struct {
	*Base
}

Get action

func NewGet

func NewGet(b *Base) *Get

NewGet new get action

func (*Get) Handler

func (e *Get) Handler() gin.HandlersChain

Handler get action handler

func (*Get) String

func (*Get) String() string

String print action name

type Pagination

type Pagination struct {
	Page     int64 `form:"page" query:"page"`
	PageSize int64 `form:"pageSize" query:"pageSize"`
}

Pagination pagination params

func (*Pagination) GetPage

func (e *Pagination) GetPage() int64

GetPage get page

func (*Pagination) GetPageSize

func (e *Pagination) GetPageSize() int64

GetPageSize get page size

type Search struct {
	*Base
}

Search action

func NewSearch

func NewSearch(b *Base) *Search

NewSearch new search action

func (*Search) Handler

func (e *Search) Handler() gin.HandlersChain

Handler search action handler

func (*Search) String

func (*Search) String() string

String print action name

type Update

type Update struct {
	*Base
}

func NewUpdate

func NewUpdate(b *Base) *Update

NewUpdate new update action

func (*Update) Handler

func (e *Update) Handler() gin.HandlersChain

Handler update action handler

func (*Update) String

func (*Update) String() string

type VirtualAction

type VirtualAction interface {
	String() string
	Handler() gin.HandlerFunc
	SetModel(key string, m *model.Model)
	GetModel(ctx *gin.Context) *model.Model
}

VirtualAction virtual action

Jump to

Keyboard shortcuts

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