error.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.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. RedisError = status.Error(10005, "Redis错误")
  14. VendorError = status.Error(10006, "三方错误")
  15. ElasticError = status.Error(10007, "ElasticSearch 错误")
  16. NoTokenError = status.Error(10008, "没有token")
  17. TokenExpiredError = status.Error(10009, "token已过期")
  18. TokenFailedError = status.Error(10010, "token错误")
  19. DistributeIdError = status.Error(10011, "分布式id错误")
  20. ErrRecordNotFound = status.Error(10012, "数据不存在")
  21. UserNotExist = status.Error(20001, "用户不存在")
  22. UserExist = status.Error(20002, "用户已存在")
  23. PasswordError = status.Error(20003, "密码错误")
  24. UserDisable = status.Error(20004, "密码错误")
  25. SuperGroupError = status.Error(20005, "不能删改超级管理员组")
  26. SuperUserError = status.Error(20006, "不能删改超级管理员")
  27. UserSelfError = status.Error(20007, "不能对当前账号进行该操作")
  28. GroupCanNotDel = status.Error(20008, "该权限组已被用户绑定,请先分配其他权限组给相关用户,再删除")
  29. GardenNotExist = status.Error(20009, "小区不存在")
  30. GardenExist = status.Error(20010, "小区已存在")
  31. GardenLimitError = status.Error(20011, "小区数量已达限制")
  32. )