rts-sim-testing-service/dto/error.go

35 lines
1021 B
Go
Raw Normal View History

package dto
type ErrorCode int
// 1xxx表示各种逻辑错误
// 2xxx表示各种数据错误
// 3xxx表示各种参数错误
const (
LogicError = 1000
2023-09-12 10:00:13 +08:00
DynamicsError = 1001
DataNotExist = 2000
DataAlreadyExist = 2001
// DataOperationError 数据操作错误(增删改查操作出了意料之外的错误都算)
DataOperationError = 2002
ArgumentParseError = 3000
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-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-09-04 11:12:57 +08:00
}