Documentation ¶
Index ¶
- Constants
- func FailWithDataLog(data interface{}, errCode errcode.Err, username string, content string, ...)
- func FailWithLog(code errcode.Err, username string, content string, req interface{}, ...)
- func FailWithSysLog(code errcode.Err, username string, content string, c *gin.Context)
- func Failed(code errcode.Err, c *gin.Context)
- func FailedNotFound(code errcode.Err, c *gin.Context)
- func Forbidden(errCode errcode.Err, c *gin.Context)
- func Ok(c *gin.Context)
- func OkWithData(data interface{}, c *gin.Context)
- func OkWithDataLog(data interface{}, username string, content string, req interface{}, ...)
- func OkWithLog(username string, content string, req interface{}, c *gin.Context)
- func OkWithSysLog(username string, content string, c *gin.Context)
- func ParamErr(c *gin.Context)
- func Result(code errcode.Err, data interface{}, c *gin.Context)
- func Unauthorized(errCode errcode.Err, c *gin.Context)
- type AutoUpdateConfig
- type GetNetwork
- type Init
- type InitStepValue
- type LoginTypeRes
- type Network
- type PageResult
- type Response
- type ServerStatus
- type SysRunDate
- type UpdateVersionInfo
- type VersionInfo
Constants ¶
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 ¶
FailWithSysLog @description: 返回操作失败,并记录失败日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2023/3/13 17:29 @success:
func Failed ¶
Failed @description: 返回错误 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/17 18:42 @success: http_code = 500
func FailedNotFound ¶
FailedNotFound @description: 数据没找到 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/18 14:31 @success: http_code = 404
func Forbidden ¶
Forbidden @description: 没有权限 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/28 18:05 @success:
func Ok ¶
Ok @description: 请求成功 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/18 14:03 @success: http_code = 200
func OkWithData ¶
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 ¶
OkWithLog @description: 返回操作成功并记录操作日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 16:16 @success:
func OkWithSysLog ¶
OkWithSysLog @description: 返回操作成功并记录系统日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2023/3/13 17:26 @success:
Types ¶
type AutoUpdateConfig ¶
type AutoUpdateConfig struct { AutoUpdate bool `json:"auto_update"` UpdateRange string `json:"update_range"` Time string `json:"time"` }
AutoUpdateConfig 自动升级配置
type GetNetwork ¶
GetNetwork 获取网卡配置
type InitStepValue ¶
InitStepValue 初始化步骤对应的值
type LoginTypeRes ¶
type LoginTypeRes struct {
LoginType int `json:"login_type"`
}
type PageResult ¶
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 ¶
SysRunDate 运行时长
type UpdateVersionInfo ¶
type UpdateVersionInfo struct { CurrentVersion string `json:"version_current"` LatestVersion string `json:"version_latest"` CanUpdate bool `json:"can_update"` //可升级 }
UpdateVersionInfo 升级时的版本信息