38 lines
1.2 KiB
Go
38 lines
1.2 KiB
Go
package dto
|
|
|
|
type ErrorCode int
|
|
|
|
// 1xxx表示各种逻辑错误
|
|
// 2xxx表示各种数据错误
|
|
// 3xxx表示各种参数错误
|
|
const (
|
|
LogicError = 1000
|
|
DynamicsError = 1001
|
|
DataNotExist = 2000
|
|
DataAlreadyExist = 2001
|
|
// DataOperationError 数据操作错误(增删改查操作出了意料之外的错误都算)
|
|
DataOperationError = 2002
|
|
ArgumentParseError = 3000
|
|
ArgumentError = 3001 //参数错误。指参数对应的数据不存在等情况
|
|
|
|
NoAuthOperationError = 4001
|
|
|
|
QueryDBError = 5000
|
|
|
|
OperationOfSignalNotSupported = 6000
|
|
OperationOfSignalError = 6001
|
|
)
|
|
|
|
var ErrorTipMap = map[int]string{
|
|
LogicError: "系统内部出错",
|
|
DynamicsError: "动力学接口出错",
|
|
DataNotExist: "数据不存在",
|
|
DataAlreadyExist: "数据已经存在",
|
|
DataOperationError: "数据操作错误",
|
|
ArgumentParseError: "输入参数格式错误",
|
|
NoAuthOperationError: "无权限操作",
|
|
QueryDBError: "数据库操作错误",
|
|
OperationOfSignalNotSupported: "信号机不支持该操作",
|
|
OperationOfSignalError: "信号机操作异常",
|
|
}
|