controller

package
v0.0.0-...-d233a18 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PageSize = 10

PageSize 每页的数据显示数量

Functions

func BindAndValid

func BindAndValid(c *gin.Context, form interface{}) (int, int)

BindAndValid 绑定并验证表单

func ErrorsSliceJoinToString

func ErrorsSliceJoinToString(errors []*validation.Error) string

高效将错误类型切片拼接字符串

func FileResponse

func FileResponse(c *gin.Context, httpCode int, file_md5 string, resCode int, data interface{})

Response 根据文件数据返回响应

func LogErrors

func LogErrors(errors []*validation.Error)

LogErrors 把验证错误输出到日志

func PageNum

func PageNum(c *gin.Context) int

func Response

func Response(c *gin.Context, httpCode, resCode int, data interface{})

Response 根据数据返回响应

Types

type OwlResponse

type OwlResponse struct {
	//请求命令
	Cmd string `json:"Cmd"`
	//返回状态
	Status int `json:"Status"`
	//返回结果
	Results string `json:"Results"`
	//key
	Key string `json:"Key"`
	//返回内容
	Data interface{} `json:"Data"`
	//程序响应IP
	ResponseHost string `json:"ResponseHost"`
	//内容的创建时间
	KeyCreateTime time.Time `json:"KeyCreateTime"`
}

OwlResponse 统一返回格式

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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