Documentation
¶
Index ¶
- func FailWithDataLog(data interface{}, err error, content string, req interface{}, ...)
- func FailWithLog(err error, content string, req interface{}, c *app.RequestContext)
- func Failed(c *app.RequestContext, code error)
- func Forbidden(err error, c *app.RequestContext)
- func Ok(c *app.RequestContext)
- func OkWithData(c *app.RequestContext, data interface{})
- func OkWithDataLog(data interface{}, content string, req interface{}, c *app.RequestContext)
- func OkWithLog(content string, req interface{}, c *app.RequestContext)
- func ParamErr(c *app.RequestContext)
- func RecordLog(content string, req interface{}, c *app.RequestContext)
- func Result(code error, data interface{}, c *app.RequestContext)
- func Unauthorized(err error, c *app.RequestContext)
- type AutoUpdateConfig
- type Backup
- type ChangePwd
- type GetNetwork
- type Init
- type InitStepValue
- type KeyQuery
- type LoginTypeRes
- type MaxAdmin
- type Network
- type PageResult
- type PlatformConfig
- type PwdValidDate
- type Response
- type ServerStatus
- type SysRunDate
- type UKeyInfo
- type UpdateVersionInfo
- type UserLogin
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FailWithDataLog ¶ added in v1.1.0
func FailWithDataLog(data interface{}, err error, content string, req interface{}, c *app.RequestContext)
FailWithDataLog @description: @param: @author: GJing @email: gjing1st@gmail.com @date: 2023/2/9 17:48 @success:
func FailWithLog ¶ added in v1.1.0
func FailWithLog(err error, content string, req interface{}, c *app.RequestContext)
FailWithLog @description: 返回操作失败,并记录失败日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 16:20 @success:
func Failed ¶ added in v1.1.0
func Failed(c *app.RequestContext, code error)
Failed @Description 请求失败,影响返回500 @params @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 19:56
func Forbidden ¶ added in v1.1.0
func Forbidden(err error, c *app.RequestContext)
Forbidden @description: 没有权限 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/28 18:05 @success:
func Ok ¶
func Ok(c *app.RequestContext)
Ok @Description 请求处理成功,直接返回200 @params @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 20:00
func OkWithData ¶
func OkWithData(c *app.RequestContext, data interface{})
OkWithData @params @Description 请求处理成功,返回响应200 @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 19:02
func OkWithDataLog ¶ added in v1.1.0
func OkWithDataLog(data interface{}, content string, req interface{}, c *app.RequestContext)
OkWithDataLog @description: 返回操作成功并记录操作日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 17:30 @success:
func OkWithLog ¶ added in v1.1.0
func OkWithLog(content string, req interface{}, c *app.RequestContext)
OkWithLog @description: 返回操作成功并记录操作日志 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 16:16 @success:
func ParamErr ¶
func ParamErr(c *app.RequestContext)
ParamErr @Description 请求参数错误,返回400 @params @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 19:58
func RecordLog ¶ added in v1.1.0
func RecordLog(content string, req interface{}, c *app.RequestContext)
func Result ¶ added in v1.1.0
func Result(code error, data interface{}, c *app.RequestContext)
func Unauthorized ¶ added in v1.1.0
func Unauthorized(err error, c *app.RequestContext)
Unauthorized @description: 未登录的错误 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/28 18:02 @success:
Types ¶
type AutoUpdateConfig ¶ added in v1.1.0
type AutoUpdateConfig struct { AutoUpdate bool `json:"auto_update"` UpdateRange string `json:"update_range"` Time string `json:"time"` }
AutoUpdateConfig 自动升级配置
type GetNetwork ¶ added in v1.1.0
GetNetwork 获取网卡配置
type InitStepValue ¶ added in v1.1.0
InitStepValue 初始化步骤对应的值
type LoginTypeRes ¶ added in v1.1.0
type LoginTypeRes struct {
LoginType string `json:"login_type"`
}
type PageResult ¶
type PageResult struct { List interface{} `json:"list"` Total int64 `json:"total"` Page int `json:"page"` PageSize int `json:"page_size"` }
PageResult 分页格式
type PlatformConfig ¶ added in v1.1.0
type PlatformConfig struct { Rate int `json:"rate"` //周期 Province string `json:"province"` //省 City string `json:"city"` //市 CSMPIP string `json:"csmp_ip"` Appid string `json:"appid"` AppSecret string `json:"app_secret"` TenantSecret string `json:"tenant_secret"` //用户口令 TenantKey string `json:"tenant_key"` //用户id }
type PwdValidDate ¶ added in v1.1.0
type PwdValidDate struct {
ValidDate int `json:"valid_date"`
}
type Response ¶
type Response struct { Code error `json:"code"` Data interface{} `json:"data"` Msg string `json:"msg"` }
Response 响应格式
type ServerStatus ¶ added in v1.1.0
type ServerStatus struct { ServiceStatus int `json:"service_status"` RunStatus int `json:"run_status"` }
ServerStatus 设备状态
type SysRunDate ¶ added in v1.1.0
SysRunDate 运行时长
type UpdateVersionInfo ¶ added in v1.1.0
type UpdateVersionInfo struct { CurrentVersion string `json:"version_current"` LatestVersion string `json:"version_latest"` CanUpdate bool `json:"can_update"` //可升级 }
UpdateVersionInfo 升级时的版本信息