优化异常定义

This commit is contained in:
zhangdeman001
2023-06-09 16:10:27 +08:00
parent 290d1a7bd3
commit a038f90ed8
3 changed files with 34 additions and 8 deletions

20
define.go Normal file
View File

@ -0,0 +1,20 @@
// Package exception ...
//
// Description : exception ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2023-06-09 15:54
package exception
// Code 状态码的结构
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 15:55 2023/6/9
type Code struct {
Value interface{} `json:"value"` // 状态码的值
Message map[string]string `json:"message"` // 状态码对应的文案(key -> 语言 , value -> 对应语言的描述)
Reason string `json:"reason"` // 产生此错误码的原因描述
Solution map[string]interface{} `json:"solution"` // 解决方案
}