response

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 Backup added in v1.1.0

type Backup struct {
	Period int `json:"period"`
}

type ChangePwd added in v1.1.0

type ChangePwd struct {
	RetryCount int `json:"retry_count"`
}

type GetNetwork added in v1.1.0

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

GetNetwork 获取网卡配置

type Init added in v1.1.0

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

type InitStepValue added in v1.1.0

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

InitStepValue 初始化步骤对应的值

type KeyQuery added in v1.1.0

type KeyQuery struct {
	Exist bool `json:"exist"`
	Bound bool `json:"bound"`
}

KeyQuery 查询ukey是否存在

type LoginTypeRes added in v1.1.0

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

type MaxAdmin added in v1.1.0

type MaxAdmin struct {
	MaxNum int `json:"max_num"`
}

type Network added in v1.1.0

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:"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

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

SysRunDate 运行时长

type UKeyInfo added in v1.1.0

type UKeyInfo struct {
	PubKey             string `json:"pub_key"`
	CommonName         string `json:"common_name"`
	OrganizationalUnit string `json:"ou"`
	SerialNumber       string `json:"serial_number"`
}

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 升级时的版本信息

type UserLogin added in v1.1.0

type UserLogin struct {
	RetryCount int `json:"retry_count"`
	*entity.User
	PwdDue bool `json:"pwd_due"`
}

type VersionInfo added in v1.1.0

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