job

package
v0.0.0-...-30be18a Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckConfig

type CheckConfig struct {
	Size   int64
	Suffix string
}

CheckConfig 文件上传验证

type Files

type Files struct {
	Path string `Testing:"文件地址(会从项目跟目录开始)"`
}

Files 文件配置

func JobNewFile

func JobNewFile() *Files

JobNewFile 初始化文件

type Job

type Job struct {
	W         http.ResponseWriter
	R         *http.Request
	File      *Files                 `Testing:"文件"`
	Input     map[string]string      `Testing:"接收的参数"`
	InputJson string                 `Testing:"接收的json数据"`
	GroupData map[string]interface{} `Testing:"跨方法的数据"`
	IsFlow    bool                   `Testing:"判断是否继续向下执行:true=继续执行,false=停止"`
}

Job 总工作台

func (*Job) InputFile

func (j *Job) InputFile(FileName string, FilePath string, Check map[string]interface{}) (string, error)

InputFile 接收文件 (接参数,文件放入位置,文件名)(文件位置,error)

func (*Job) JsonError

func (j *Job) JsonError(all ...interface{})

JsonError 返回成功的json格式

func (*Job) JsonSuccess

func (j *Job) JsonSuccess(all ...interface{})

JsonSuccess 返回成功的json格式(data,msg,code)

type Message

type Message struct {
	Code int         `json:"code" Testing:"状态码"`
	Msg  string      `json:"msg" Testing:"信息"`
	Data interface{} `json:"data" Testing:"数据"`
}

Message 返回数据格式

func (*Message) Json

func (message *Message) Json(all []interface{}) []byte

Json 返回json格式,判断前3个参数,分别是data,msg,code

Jump to

Keyboard shortcuts

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