controller

package
v0.0.0-...-ee1e291 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(handler APIHandler) gin.HandlerFunc

Types

type APIHandler

type APIHandler interface {
	Handle() (*Response, error) //具体api逻辑
}

type ImportYYetsAPI

type ImportYYetsAPI struct {
	Params struct {
		Username string `json:"username"`
		Password string `json:"password"`
	} `http:"json"`
	DB *gorm.DB
}

func (*ImportYYetsAPI) Handle

func (i *ImportYYetsAPI) Handle() (*Response, error)

type Limiter

type Limiter interface {
	SetLimit(int)
	GetLimit() int
}

type Response

type Response struct {
	ErrorCode int         `json:"error_code"`
	Msg       string      `json:"msg"`
	Data      interface{} `json:"data,omitempty"`
}

func ErrorReturn

func ErrorReturn(msg interface{}) *Response

func SuccessReturn

func SuccessReturn(data ...interface{}) *Response

type Validator

type Validator interface {
	Validate() error //权限验证相关
}

Jump to

Keyboard shortcuts

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