HttpStatus.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. namespace Infrastructure.Constant
  2. {
  3. public class HttpStatus
  4. {
  5. /// <summary>
  6. /// 操作成功
  7. /// </summary>
  8. public static readonly int SUCCESS = 200;
  9. /// <summary>
  10. /// 对象创建成功
  11. /// </summary>
  12. public static readonly int CREATED = 201;
  13. /// <summary>
  14. /// 请求已经被接受
  15. /// </summary>
  16. public static readonly int ACCEPTED = 202;
  17. /// <summary>
  18. /// 操作已经执行成功,但是没有返回数据
  19. /// </summary>
  20. public static readonly int NO_CONTENT = 204;
  21. /// <summary>
  22. /// 资源已被移除
  23. /// </summary>
  24. public static readonly int MOVED_PERM = 301;
  25. /// <summary>
  26. /// 重定向
  27. /// </summary>
  28. public static readonly int SEE_OTHER = 303;
  29. /// <summary>
  30. /// 资源没有被修改
  31. /// </summary>
  32. public static readonly int NOT_MODIFIED = 304;
  33. /// <summary>
  34. /// 参数列表错误(缺少,格式不匹配)
  35. /// </summary>
  36. public static readonly int BAD_REQUEST = 400;
  37. /// <summary>
  38. /// 未授权
  39. /// </summary>
  40. public static readonly int UNAUTHORIZED = 401;
  41. /// <summary>
  42. /// 访问受限,授权过期
  43. /// </summary>
  44. public static readonly int FORBIDDEN = 403;
  45. /// <summary>
  46. /// 资源,服务未找到
  47. /// </summary>
  48. public static readonly int NOT_FOUND = 404;
  49. /// <summary>
  50. /// 不允许的http方法
  51. /// </summary>
  52. public static readonly int BAD_METHOD = 405;
  53. /// <summary>
  54. /// 资源冲突,或者资源被锁
  55. /// </summary>
  56. public static readonly int CONFLICT = 409;
  57. /// <summary>
  58. /// 不支持的数据,媒体类型
  59. /// </summary>
  60. public static readonly int UNSUPPORTED_TYPE = 415;
  61. /// <summary>
  62. /// 系统内部错误
  63. /// </summary>
  64. public static readonly int ERROR = 500;
  65. /// <summary>
  66. /// 接口未实现
  67. /// </summary>
  68. public static readonly int NOT_IMPLEMENTED = 501;
  69. }
  70. }