controller

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(g *gin.RouterGroup, c BaseInterface, path string)

Install Install

func ListPaging

func ListPaging(c *gin.Context, obj interface{}, db *model.GormDB, result func(data interface{}) interface{}, pagingMidd model.Middleware, midd ...model.Middleware)

ListPaging 处理通用 page size orderby search

Types

type Auth

type Auth func(c *gin.Context, must bool) model.Middleware

Auth CheckUser

type BaseInterface

type BaseInterface interface {
	ListAll(c *gin.Context)
	ListPaging(c *gin.Context)
	Detail(c *gin.Context)
	Add(c *gin.Context)
	Update(c *gin.Context)
	Delete(c *gin.Context)
	Count(c *gin.Context)
	// Install Install
	Install(g *gin.RouterGroup, path string)
}

BaseInterface ControllerInterface

type Controller

type Controller struct {
	DB    *model.GormDB
	Model model.Controller
	Auth
}

Controller Controller

func (*Controller) Add

func (t *Controller) Add(c *gin.Context)

Add Add

func (*Controller) Count

func (t *Controller) Count(c *gin.Context)

Count Count

func (*Controller) DefaultListPaging

func (t *Controller) DefaultListPaging(c *gin.Context, midd model.Middleware)

DefaultListPaging DefaultListPaging

func (*Controller) Delete

func (t *Controller) Delete(c *gin.Context)

Delete Delete

func (*Controller) Detail

func (t *Controller) Detail(c *gin.Context)

Detail Detail

func (*Controller) GetAuth

func (t *Controller) GetAuth() Auth

GetAuth GetAuth

func (*Controller) Install

func (t *Controller) Install(g *gin.RouterGroup, path string)

Install Install

func (*Controller) ListAll

func (t *Controller) ListAll(c *gin.Context)

ListAll ListAll

func (*Controller) ListPaging

func (t *Controller) ListPaging(c *gin.Context)

ListPaging ListPaging

func (*Controller) Update

func (t *Controller) Update(c *gin.Context)

Update Update

Jump to

Keyboard shortcuts

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