HttpStatus.java 1.6 KB

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