2023-07-31 10:15:02 +08:00
|
|
|
package dto
|
|
|
|
|
|
|
|
type ErrorCode int
|
|
|
|
|
|
|
|
// 1xxx表示各种逻辑错误
|
|
|
|
// 2xxx表示各种数据错误
|
|
|
|
// 3xxx表示各种参数错误
|
|
|
|
const (
|
|
|
|
LogicError = 1000
|
2023-09-12 10:00:13 +08:00
|
|
|
DynamicsError = 1001
|
2023-07-31 10:15:02 +08:00
|
|
|
DataNotExist = 2000
|
|
|
|
DataAlreadyExist = 2001
|
|
|
|
// DataOperationError 数据操作错误(增删改查操作出了意料之外的错误都算)
|
|
|
|
DataOperationError = 2002
|
|
|
|
ArgumentParseError = 3000
|
2023-11-02 15:50:03 +08:00
|
|
|
ArgumentError = 3001 //参数错误。指参数对应的数据不存在等情况
|
2023-08-30 14:26:48 +08:00
|
|
|
|
|
|
|
NoAuthOperationError = 4001
|
2023-08-30 18:05:11 +08:00
|
|
|
|
|
|
|
QueryDBError = 5000
|
2023-10-17 10:16:11 +08:00
|
|
|
|
|
|
|
OperationOfSignalNotSupported = 6000
|
2023-10-19 15:08:43 +08:00
|
|
|
OperationOfSignalError = 6001
|
2023-07-31 10:15:02 +08:00
|
|
|
)
|
2023-09-04 11:12:57 +08:00
|
|
|
|
|
|
|
var ErrorTipMap = map[int]string{
|
2023-10-17 10:16:11 +08:00
|
|
|
LogicError: "系统内部出错",
|
|
|
|
DynamicsError: "动力学接口出错",
|
|
|
|
DataNotExist: "数据不存在",
|
|
|
|
DataAlreadyExist: "数据已经存在",
|
|
|
|
DataOperationError: "数据操作错误",
|
|
|
|
ArgumentParseError: "输入参数格式错误",
|
|
|
|
NoAuthOperationError: "无权限操作",
|
|
|
|
QueryDBError: "数据库操作错误",
|
|
|
|
OperationOfSignalNotSupported: "信号机不支持该操作",
|
2023-10-19 15:08:43 +08:00
|
|
|
OperationOfSignalError: "信号机操作异常",
|
2023-09-04 11:12:57 +08:00
|
|
|
}
|