types

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller added in v1.4.2

type Controller struct {
	Ctx *gin.Context
}

Controller

func (*Controller) DumpRequest added in v1.4.2

func (c *Controller) DumpRequest() string

DumpRequest

func (*Controller) GetLoggedUserId added in v1.4.2

func (c *Controller) GetLoggedUserId() int

获取已登陆用户的ID

func (*Controller) GetQueryByMethod added in v1.4.2

func (c *Controller) GetQueryByMethod(key, defaultValue string) string

根据ctx.httpMethod获取GET或POST参数

func (*Controller) GetQueryPostForm added in v1.4.2

func (c *Controller) GetQueryPostForm(keys ...string) string

从Get和Post里获取Key的值

func (*Controller) Json added in v1.4.2

func (c *Controller) Json(args ...interface{})

Json 输出方法 args 三个参数: 第一个是code int,代表状态码 第二个是msg string,代表信息 第三个是data gin.H,代表数据

func (*Controller) SetContext added in v1.4.2

func (c *Controller) SetContext(ctx *gin.Context)

SetContext

type ICheck added in v1.4.2

type ICheck interface {
	GetVersion() (version, key string)
	GetSign() (secretKey, key, timeKey, dev string, expiration int64)
	GetSession() (fn func() *redis.Client, key, prefix string, expiration int64)
}

type IController added in v1.4.2

type IController interface {
	SetContext(*gin.Context)
}

type Model added in v1.4.2

type Model struct {
	mysql.Model
}

func (*Model) New added in v1.4.2

func (m *Model) New(dbc *types.DBCollector, dialect *types.MysqlDialect) *gorm.DB

type Redis added in v1.4.2

type Redis struct {
	redis.Redis
}

func (*Redis) New added in v1.4.2

func (r *Redis) New(rdc *types.RedisCollector, client *types.RedisClient) *redis2.Client

type RestHandler added in v1.4.2

type RestHandler struct {
	Sort    int             // Sort
	Signed  bool            // Signed
	Logged  bool            // Logged
	Path    string          // Path
	Version string          // Version
	Http    string          // Http
	Method  string          // Method
	Handler IController     // Handler
	Https   map[string]byte // Https
}

func (*RestHandler) CallMethod added in v1.4.2

func (h *RestHandler) CallMethod(ctx *gin.Context)

CallMethod

func (*RestHandler) GetHttps added in v1.4.2

func (h *RestHandler) GetHttps() map[string]byte

GetHttps

type RestHandlers added in v1.4.2

type RestHandlers []RestHandler

func (RestHandlers) Len added in v1.4.2

func (rh RestHandlers) Len() int

RestHandlers 实现sort SDK中的Interface接口 Len

func (RestHandlers) Less added in v1.4.2

func (rh RestHandlers) Less(i, j int) bool

Less

func (RestHandlers) Swap added in v1.4.2

func (rh RestHandlers) Swap(i, j int)

Swap

type Restful added in v1.4.2

type Restful map[string]RestHandlers

Jump to

Keyboard shortcuts

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