HttpResult.java 723 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package com.futu.course.common.entity;
  2. import org.apache.commons.httpclient.HttpStatus;
  3. /**
  4. * http返回结果
  5. *
  6. */
  7. public class HttpResult {
  8. private int stateCode;
  9. private String content;
  10. public String getContent() {
  11. return content;
  12. }
  13. public void setContent(String content) {
  14. this.content = content;
  15. }
  16. public int getStateCode() {
  17. return stateCode;
  18. }
  19. /**
  20. * 获取请求状态
  21. * @return:
  22. */
  23. public boolean getOK() {
  24. return this.stateCode == HttpStatus.SC_OK
  25. || this.stateCode == HttpStatus.SC_MOVED_PERMANENTLY
  26. || this.stateCode == HttpStatus.SC_MOVED_TEMPORARILY;
  27. }
  28. public void setStateCode(int stateCode) {
  29. this.stateCode = stateCode;
  30. }
  31. }