response

package
v0.0.0-...-d62a2a9 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR   = 7
	SUCCESS = 0
)

Variables

This section is empty.

Functions

func FailWithDataLog

func FailWithDataLog(data interface{}, errCode errcode.Err, username string, content string, req interface{}, c *gin.Context)

FailWithDataLog @description: @param: @author: GJing @email: gjing1st@gmail.com @date: 2023/2/9 17:48 @success:

func FailWithLog

func FailWithLog(code errcode.Err, username string, content string, req interface{}, c *gin.Context)

FailWithLog @description: 返回操作失败,并记录失败日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 16:20 @success:

func FailWithSysLog

func FailWithSysLog(code errcode.Err, username string, content string, c *gin.Context)

FailWithSysLog @description: 返回操作失败,并记录失败日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2023/3/13 17:29 @success:

func Failed

func Failed(code errcode.Err, c *gin.Context)

Failed @description: 返回错误 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/17 18:42 @success: http_code = 500

func FailedNotFound

func FailedNotFound(code errcode.Err, c *gin.Context)

FailedNotFound @description: 数据没找到 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/18 14:31 @success: http_code = 404

func Forbidden

func Forbidden(errCode errcode.Err, c *gin.Context)

Forbidden @description: 没有权限 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/28 18:05 @success:

func Ok

func Ok(c *gin.Context)

Ok @description: 请求成功 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/18 14:03 @success: http_code = 200

func OkWithData

func OkWithData(data interface{}, c *gin.Context)

OkWithData @description: 请求成功并返回data数据 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/18 14:37 @success:

func OkWithDataLog

func OkWithDataLog(data interface{}, username string, content string, req interface{}, c *gin.Context)

OkWithDataLog @description: 返回操作成功并记录操作日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 17:30 @success:

func OkWithLog

func OkWithLog(username string, content string, req interface{}, c *gin.Context)

OkWithLog @description: 返回操作成功并记录操作日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 16:16 @success:

func OkWithSysLog

func OkWithSysLog(username string, content string, c *gin.Context)

OkWithSysLog @description: 返回操作成功并记录系统日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2023/3/13 17:26 @success:

func ParamErr

func ParamErr(c *gin.Context)

ParamErr @description: 参数请求错误 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/18 14:11 @success: http_code = 400

func Result

func Result(code errcode.Err, data interface{}, c *gin.Context)

func Unauthorized

func Unauthorized(errCode errcode.Err, c *gin.Context)

Unauthorized @description: 未登录的错误 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/28 18:02 @success:

Types

type AutoUpdateConfig

type AutoUpdateConfig struct {
	AutoUpdate  bool   `json:"auto_update"`
	UpdateRange string `json:"update_range"`
	Time        string `json:"time"`
}

AutoUpdateConfig 自动升级配置

type GetNetwork

type GetNetwork struct {
	Admin Network `json:"admin"`
	SDF   Network `json:"sdf"`
}

GetNetwork 获取网卡配置

type Init

type Init struct {
	Initialized bool `json:"initialized"`
}

type InitStepValue

type InitStepValue struct {
	User    int `json:"user"`
	Network int `json:"network"`
}

InitStepValue 初始化步骤对应的值

type LoginTypeRes

type LoginTypeRes struct {
	LoginType int `json:"login_type"`
}

type Network

type Network struct {
	Addr    string `json:"addr"`
	Gateway string `json:"gateway"`
	Netmask string `json:"netmask"`
}

type PageResult

type PageResult struct {
	List     interface{} `json:"list"`
	Total    int64       `json:"total"`
	Page     int         `json:"page"`
	PageSize int         `json:"pageSize"`
}

type Response

type Response struct {
	Code errcode.Err `json:"code"`
	Data interface{} `json:"data"`
	Msg  string      `json:"msg"`
}

Response http.code=200时统一返回格式

type ServerStatus

type ServerStatus struct {
	ServiceStatus int `json:"service_status"`
	RunStatus     int `json:"run_status"`
}

ServerStatus 设备状态

type SysRunDate

type SysRunDate struct {
	Day    int `json:"day"`
	Hour   int `json:"hour"`
	Minute int `json:"minute"`
}

SysRunDate 运行时长

type UpdateVersionInfo

type UpdateVersionInfo struct {
	CurrentVersion string `json:"version_current"`
	LatestVersion  string `json:"version_latest"`
	CanUpdate      bool   `json:"can_update"` //可升级
}

UpdateVersionInfo 升级时的版本信息

type VersionInfo

type VersionInfo struct {
	Manufacturer string `json:"manufacturer"` //生产厂商
	Version      string `json:"version"`
	Serial       string `json:"serial"` //序列号
	//Algorithm    string `json:"algorithm"`
	DeviceModel string `json:"device_model"` //设备型号固定
}

VersionInfo 版本信息

Jump to

Keyboard shortcuts

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