egin

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package egin gin 的封装

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoVerifyHandler

func AutoVerifyHandler(handlerFunc interface{}) func(*gin.Context)

func CopyStruct

func CopyStruct(src interface{}, dst interface{}) error

func E加载html模板路径

func E加载html模板路径(r *gin.Engine, 模板路径 string)

func E绑定静态文件目录 added in v1.1.2

func E绑定静态文件目录(r *gin.Engine, 静态目录路径 string)

E绑定静态文件目录 绑定静态文件目录 静态目录路径 静态文件目录路径 例如 E绑定静态文件目录(r, "./public")

func E获取多个文件

func E获取多个文件(c *gin.Context, 表单名称 string, 上传路径 string) ([]string, []error)

func E获取文件

func E获取文件(c *gin.Context, 表单名称 string, 上传路径 string) (string, error)

func I

func I(c *gin.Context, 规则 string, 默认值 string) string

func IAll added in v1.2.1

func IAll(c *gin.Context) map[string]interface{}

在gin中获取所有的参数 从json,post,get中获取 优先级 json>post>get 返回map[string]interface{}

func IVerify

func IVerify(c *gin.Context, 规则 string, 默认值 string, 验证规则 string, 验证规则消息 string) (string, error)

func ItoInt64

func ItoInt64(c *gin.Context, 规则 string, 默认值 string) int64

func NewError

func NewError(code int, msg string) error

func Verify

func Verify(c *gin.Context, dst interface{}) error

Verify 验证参数

func (b *AutoController) Get(c *gin.Context) {
	var req struct {
		TableName string `json:"tableName"`
	}
	if err := egin.Verify(c, &req); err != nil {
		c.JSON(200, gin.H{
			"status": 1,
			"msg":    err.Error(),
			"data":   "",
		})
		return
	}

Types

This section is empty.

Directories

Path Synopsis
gin日志类 可以保存访问日志和错误恢复日志
gin日志类 可以保存访问日志和错误恢复日志

Jump to

Keyboard shortcuts

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