HttpStatus.java 1.6 KB

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