error.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. UnsupportError = status.Error(10006, "不支持的操作")
  15. //
  16. UserPassError = status.Error(20001, "用户密码错误")
  17. UserNotExistError = status.Error(20002, "用户不存在")
  18. UserExistError = status.Error(20003, "用户已存在")
  19. ProjectExistError = status.Error(20004, "项目已存在")
  20. ProjectNotExistError = status.Error(20005, "项目不存在")
  21. DeviceExistError = status.Error(20006, "设备已存在")
  22. DeviceNotExistError = status.Error(20007, "设备不存在")
  23. ProjectNotMatchError = status.Error(20008, "项目不匹配")
  24. UserStatusError = status.Error(20009, "用户状态错误")
  25. DeviceTypeNotExistError = status.Error(20010, "设备类型不存在")
  26. DeviceAddCheckError = status.Error(20011, "设备未对接或未审批")
  27. DeviceDelStatusError = status.Error(20012, "设备当前状态不能拆机")
  28. VssAddError = status.Error(20013, "视频设备需提供摄像头数量")
  29. VssStatusError = status.Error(20014, "视频状态不支持该操作")
  30. EmailExist = status.Error(20023, "邮箱已存在")
  31. PhoneExist = status.Error(20024, "电话号码已存在")
  32. DeviceTypeExistError = status.Error(20025, "设备类型已存在")
  33. DeviceTypeNotAddedError = status.Error(20026, "设备类型未申请成功")
  34. DeviceTypeAddingError = status.Error(20027, "设备类型审批中")
  35. VedioNumOver = status.Error(20028, "视频设备国标号已耗尽")
  36. ChannelNumOver = status.Error(20029, "视频通道国标号已耗尽")
  37. LockError = status.Error(20030, "分布式锁获取失败")
  38. )