APBToygerDataCenter.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. //
  2. // APFDataCenter.h
  3. // APFaceDetectBiz
  4. //
  5. // Created by yukun.tyk on 9/8/16.
  6. // Copyright © 2016 Alipay. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <BioAuthEngine/BioAuthEngine.h>
  10. #import <ToygerService/ToygerService.h>
  11. #import <ToygerService/ToygerServiceInstance.h>
  12. //#import "APBToygerUploadContent.h"
  13. @class BisBehavTask;
  14. @protocol APBToygerDataCenterDelegate <NSObject>
  15. /**
  16. * 收到response的回调
  17. * @param success rpc是否成功
  18. * @param retCode 结果码
  19. * @param msg 结果信息
  20. * @param ext 扩展信息
  21. */
  22. - (void)didFinishUploadWithSuccess:(BOOL)success
  23. retCode:(NSString *)retCode
  24. retMessage:(NSString *)msg
  25. extInfo:(NSString *)ext;
  26. @end
  27. @interface APBToygerDataCenter : NSObject
  28. @property (nonatomic, weak) ToygerServiceInstance *togyerInstance;
  29. @property (nonatomic, copy) NSString *pubkey;
  30. /**
  31. * 初始化
  32. *
  33. * @param config 配置参数
  34. */
  35. - (instancetype)initWithConfig:(NSDictionary *)config;
  36. #ifdef SUPPORT_PB
  37. /**
  38. * 添加采集数据
  39. *
  40. * @param monitorImage 监控照片
  41. * @param panoImage 全景图,若该参数指定,将替换之前的全景图
  42. */
  43. - (void)addMonitorImage:(UIImage *)monitorImage
  44. replacePanoImage:(NSData *)panoImage
  45. andCypherKeyData:(NSData *)cypherKey;
  46. #else
  47. /**
  48. * 添加采集数据
  49. *
  50. * @param monitorImage 监控照片
  51. * @param panoImage 全景图,若该参数指定,将替换之前的全景图
  52. */
  53. - (void)addMonitorImage:(UIImage *)monitorImage
  54. replacePanoImage:(NSString *)panoImage
  55. andCypherKeyData:(NSString *)cypherKey;
  56. #endif
  57. /**
  58. * 清除采集数据
  59. *
  60. * @param monitorImage 监控照片
  61. * @param panoImage 全景图,
  62. */
  63. - (void)clearMonitorImage:(BOOL)monitor
  64. panoImage:(BOOL)pano;
  65. /**
  66. * 添加行为日志
  67. *
  68. * @param task 任务
  69. */
  70. - (void)addBehavTask:(BisBehavTask *)task;
  71. /**
  72. * clearTask
  73. *
  74. *
  75. */
  76. - (void)clearTask;
  77. /**
  78. * clear
  79. *
  80. *
  81. */
  82. - (void)clear;
  83. /**
  84. * 建立上传数据request
  85. *
  86. * @param monitor 是否上传监控照片
  87. * @param behav 是否上传行为日志
  88. * @param pano 是否上传全景图
  89. * @param type 触发类型
  90. * @param retry 重试次数
  91. */
  92. - (APBBisUploadGwRequest *)buildUploadRequestWithMonitorImage:(BOOL)monitor
  93. behavLog:(BOOL)behav
  94. panoImage:(BOOL)pano
  95. invokeType:(NSString *)type
  96. retryCnt:(NSInteger)retry;
  97. - (APBBisUploadGwRequest *)buildUploadRequestWithContent:(NSData *)data
  98. cypherKey:(NSData *)cypherKeyData
  99. invokeType:(NSString *)type
  100. retryCnt:(NSInteger)retry;
  101. /**
  102. * 设置delegate
  103. */
  104. - (void)setDelegate:(id<APBToygerDataCenterDelegate>)delegate;
  105. @end