error.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package errors
  4. import (
  5. "google.golang.org/grpc/status"
  6. )
  7. var (
  8. // 通用错误
  9. SystemError = status.Error(10001, "系统错误")
  10. ServiceError = status.Error(10002, "内部服务错误")
  11. ParamsError = status.Error(10003, "参数错误")
  12. DataBaseError = status.Error(10004, "数据库错误")
  13. NoRecordError = status.Error(10005, "查无记录")
  14. //
  15. UserPassError = status.Error(20001, "用户密码错误")
  16. UserNotExistError = status.Error(20002, "用户不存在")
  17. UserExistError = status.Error(20003, "用户已存在")
  18. ProjectExistError = status.Error(20004, "项目已存在")
  19. ProjectNotExistError = status.Error(20005, "项目不存在")
  20. DeviceExistError = status.Error(20006, "设备已存在")
  21. DeviceNotExistError = status.Error(20007, "设备不存在")
  22. ProjectNotMatchError = status.Error(20008, "项目不匹配")
  23. StaffExistError = status.Error(20009, "员工已存在")
  24. StaffNotExistError = status.Error(20010, "员工不存在")
  25. AlarmExistError = status.Error(20011, "告警配置已存在")
  26. AlarmNotExistError = status.Error(20012, "告警配置不存在")
  27. )