RQHTTPResponse.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // RQHTTPResponse.h
  3. // RQCommon
  4. //
  5. // Created by 张嵘 on 2018/11/16.
  6. // Copyright © 2018 张嵘. All rights reserved.
  7. //
  8. #import "RQBaseModel.h"
  9. /// 请求数据返回的状态码
  10. typedef NS_ENUM(NSUInteger, RQHTTPResponseCode) {
  11. RQHTTPResponseCodeSuccess = 200, /// 请求成功
  12. RQHTTPResponseCodeJSJPSuccess = 0, /// 请求成功(极速驾培)
  13. RQHTTPResponseCodeNotLogin = 401, /// 用户尚未登录
  14. RQHTTPResponseCodeParametersVerifyFailure = 105, /// 参数验证失败
  15. RQHTTPResponseInsufficientRequestPermissionCode = 403, /// 请求权限不足
  16. RQHTTPResponseSystemExceptionCode = 500, /// 系统异常
  17. RQHTTPResponseBusinessExceptionCode = 502, /// 业务异常
  18. };
  19. @interface RQHTTPResponse : RQBaseModel
  20. /// The parsed RQObject object corresponding to the API response.
  21. /// The developer need care this data 切记:若没有数据是NSNull 而不是nil .对应于服务器json数据的 data
  22. @property (nonatomic, readonly, strong) id parsedResult;
  23. /// 自己服务器返回的状态码 对应于服务器json数据的 code
  24. @property (nonatomic, readonly, assign) RQHTTPResponseCode code;
  25. /// 自己服务器返回的信息 对应于服务器json数据的 code
  26. @property (nonatomic, readonly, copy) NSString *msg;
  27. // Initializes the receiver with the headers from the given response, and given the origin data and the
  28. // given parsed model object(s).
  29. - (instancetype)initWithResponseObject:(id)responseObject parsedResult:(id)parsedResult;
  30. @end