BPositionViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. //
  2. // BPositionViewController.m
  3. // HappyJob
  4. //
  5. // Created by 张晓光 on 2019/7/1.
  6. // Copyright © 2019 Bob. All rights reserved.
  7. //
  8. #import "BPositionViewController.h"
  9. #import "BPositionCell.h"
  10. #import "BHomeNoCertificationView.h"//认证结果
  11. #import "BHomeCertificationFailVC.h"//认证失败
  12. #import "BHomeCertificationingEnterpriseVC.h"//认证中
  13. #import "BHomeCertificationEnterpriseVC.h"//企业认证
  14. #import "BCheckPeopleViewController.h"//查看人员
  15. #import "BHomeEnterpriseAuthAPI.h"//企业认证
  16. #import "BHomeChangeIdentityAPI.h"
  17. #import "BPositionListAPI.h"//列表API
  18. #import "BPositionChangeIsPauseAPI.h"//暂停开启API
  19. #import "BPositionChangeUpdateTimeAPI.h"//刷新API
  20. #import "BPositionChangeIsOnStatusAPI.h"//结束下架
  21. #import "BReleaseJobsViewController.h"//发布职位
  22. #import "BPositonModel.h"
  23. #import "BPositionDataBox.h"
  24. #import "HJFullTimeDetailViewController.h"//全职详情
  25. #import "HJPartTimeDetailViewController.h"//兼职详情
  26. @interface BPositionViewController ()
  27. <
  28. UITableViewDelegate,
  29. FBAPIManagerDelegate,
  30. FBAPIManagerInterceptor,
  31. BPositionDataBoxDelegate,
  32. UINavigationControllerDelegate,
  33. UIGestureRecognizerDelegate
  34. >
  35. @property (nonatomic, strong) UIButton *certificationBtn;
  36. @property (nonatomic, strong) BHomeNoCertificationView *certificationView;
  37. @property (nonatomic, strong) HeaderSelectView *headerView;
  38. @property (nonatomic, strong) HJPageListView *tableView;
  39. @property (nonatomic, strong) NSIndexPath *selectIndexPath;
  40. @property (nonatomic, strong) BHomeEnterpriseAuthAPI *authAPI;//查询企业是否认证结果
  41. @property (nonatomic, strong) BHomeChangeIdentityAPI *IDAPI;//查询企业认证结果
  42. @property (nonatomic, strong) BPositionListAPI *listAPI;//列表API
  43. @property (nonatomic, strong) BPositionChangeIsPauseAPI *pauseAPI;//暂停开启api
  44. @property (nonatomic, strong) BPositionChangeUpdateTimeAPI *updateTimeAPI;//刷新API
  45. @property (nonatomic, strong) BPositionChangeIsOnStatusAPI *isOnStatus;//结束下架
  46. @property (nonatomic, strong) BPositonModel *model;
  47. @property (nonatomic, strong) BPositionDataBox *dataBox;
  48. @end
  49. @implementation BPositionViewController
  50. - (void)dealloc {
  51. [[NSNotificationCenter defaultCenter] removeObserver:self name:HJEnterpriseAuthResultNotification object:nil];
  52. [[NSNotificationCenter defaultCenter] removeObserver:self name:HJReleaseSuccessfulRefreshNotification object:nil];
  53. }
  54. - (void)viewWillAppear:(BOOL)animated {
  55. [super viewWillAppear:animated];
  56. self.navigationController.delegate = self;
  57. self.navigationController.interactivePopGestureRecognizer.delegate = self;
  58. }
  59. - (void)viewDidLoad {
  60. [super viewDidLoad];
  61. self.navigationItem.title = @"职位";
  62. [self hj_setupNavBar];
  63. [self.authAPI start];
  64. // 错误页面刷新事件
  65. [self.view.errorView.refreshButton addTarget:self action:@selector(refreshButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
  66. //认证成功通知回调
  67. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshEnterpriseAuthResult:) name:HJEnterpriseAuthResultNotification object:nil];
  68. //发布职位通知回调
  69. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(releaseSuccessfulRefreshNotification:) name:HJReleaseSuccessfulRefreshNotification object:nil];
  70. }
  71. #pragma mark - 导航栏的代理
  72. - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
  73. // 判断要显示的控制器是否是自己
  74. // BOOL isPushSelfClass = [viewController isKindOfClass:[self class]];
  75. [self.navigationController setNavigationBarHidden:NO animated:animated];
  76. }
  77. #pragma mark - event response
  78. /* 发布职位成功回调 */
  79. - (void)releaseSuccessfulRefreshNotification:(NSNotificationCenter *)noti {
  80. [self.listAPI start];
  81. }
  82. /* 认证成功回调 */
  83. - (void)refreshEnterpriseAuthResult:(NSNotificationCenter *)noti {
  84. [self.authAPI start];
  85. }
  86. /* 错误页面刷新 */
  87. - (void)refreshButtonClicked:(UIButton *)btn {
  88. [self.authAPI start];
  89. }
  90. /* 认证 */
  91. - (void)positionCertificationButtonClick:(UIButton *)btn {
  92. if ([[HJCompanyInfoModel companyInfo].authenticationStatus integerValue] == 1)
  93. {//认证中
  94. BHomeCertificationingEnterpriseVC *vc = [[BHomeCertificationingEnterpriseVC alloc]init];
  95. vc.hidesBottomBarWhenPushed = YES;
  96. [self.navigationController pushViewController:vc animated:YES];
  97. }
  98. if ([[HJCompanyInfoModel companyInfo].authenticationStatus integerValue] == 2)
  99. {//认证失败的
  100. BHomeCertificationFailVC *vc = [[BHomeCertificationFailVC alloc]init];
  101. vc.hidesBottomBarWhenPushed = YES;
  102. [self.navigationController pushViewController:vc animated:YES];
  103. }
  104. }
  105. #pragma mark - BPositionDataBoxDelegate
  106. /* 查看简历 */
  107. - (void)positionResume:(BPositionDataBox *)dataBox positionModel:(BPositonModel *)model {
  108. BCheckPeopleViewController *checkPeople = [[BCheckPeopleViewController alloc]init];
  109. checkPeople.hidesBottomBarWhenPushed = YES;
  110. checkPeople.positionId = model.ID;
  111. checkPeople.positionCategory = model.positionCategory;
  112. [self.navigationController pushViewController:checkPeople animated:YES];
  113. }
  114. /* 刷新 */
  115. - (void)positionRefresh:(BPositionDataBox *)dataBox positionModel:(BPositonModel *)model cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  116. self.selectIndexPath = indexPath;
  117. self.updateTimeAPI.ID = model.ID;
  118. [self.updateTimeAPI start];
  119. }
  120. /* 是否暂停 1:暂停 */
  121. - (void)positionStop:(BPositionDataBox *)dataBox positionModel:(BPositonModel *)model cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  122. //是否暂停 1:暂停
  123. self.selectIndexPath = indexPath;
  124. self.pauseAPI.ID = model.ID;
  125. if ([model.isPause boolValue])
  126. {
  127. self.pauseAPI.isPause = @"0";
  128. }
  129. else
  130. {
  131. self.pauseAPI.isPause = @"1";
  132. }
  133. [self.pauseAPI start];
  134. }
  135. /* 是否下架 */
  136. - (void)positionEnd:(BPositionDataBox *)dataBox positionModel:(BPositonModel *)model cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  137. //是否下架 0下架
  138. self.selectIndexPath = indexPath;
  139. self.isOnStatus.ID = model.ID;
  140. self.isOnStatus.isOn = @"0";
  141. [self endRecruitment];
  142. }
  143. /* 编辑 */
  144. - (void)positionEdit:(BPositionDataBox *)dataBox positionModel:(BPositonModel *)model {
  145. self.model = model;
  146. [self editPosition];
  147. }
  148. #pragma mark - FBAPIManagerInterceptor
  149. - (BOOL)manager:(FBBaseAPIManager *)manager shouldStartCallAPIWithParams:(NSDictionary *)params {
  150. [self.view fb_showLoading];
  151. return YES;
  152. }
  153. - (void)managerShouldFinishCallAPI:(FBBaseAPIManager *)manager {
  154. [self.view fb_dismiss];
  155. }
  156. #pragma mark - FBAPIManagerDelegate
  157. - (void)managerCallAPIDidSuccess:(FBBaseAPIManager *)manager {
  158. [self.view dismissErrorView];
  159. NSDictionary *dict = [manager fetchDataWithBox:self.dataBox];
  160. if (manager == self.authAPI)
  161. {
  162. if ([[dict valueForKeyPath:@"data.isAuth"] boolValue] == NO)
  163. { //没有提交企业认证
  164. [self createCertificationView];
  165. }
  166. else if ([[dict valueForKeyPath:@"data.isAuth"] boolValue] == YES)
  167. {//有提交企业认证
  168. [self autoLayOutViews];
  169. [self.IDAPI start];
  170. [self.listAPI start];
  171. }
  172. }
  173. if (manager == self.IDAPI)
  174. {
  175. if ([[HJCompanyInfoModel companyInfo].authenticationStatus integerValue] == 1)
  176. {//认证中
  177. [self.certificationBtn setTitle:@"您已提交企业认证,正在审核中,点击查看 >>" forState:UIControlStateNormal];
  178. }
  179. else if ([[HJCompanyInfoModel companyInfo].authenticationStatus integerValue] == 2)
  180. {//认证失败
  181. [self.certificationBtn setTitle:@"您已提交企业认证,审核未通过,点击认证 >>" forState:UIControlStateNormal];
  182. }
  183. }
  184. if (manager == self.listAPI)
  185. {
  186. [self.tableView managerCallAPIDidSuccess:manager];
  187. }
  188. if (manager == self.updateTimeAPI)
  189. {//刷新
  190. NSMutableDictionary *listDict = [self.dataBox.dataSource[self.selectIndexPath.row] mutableCopy];
  191. listDict[@"updateDate"] = [HJAppService time_timestampToString:[NSString stringWithFormat:@"%@",dict[@"data"][@"date"]] withType:kTimeStampWithSecond];
  192. [self.dataBox.dataSource setObject:listDict atIndexedSubscript:self.selectIndexPath.row];
  193. [self refreshCellForRow];
  194. }
  195. if (manager == self.pauseAPI)
  196. {//暂停和开启
  197. NSMutableDictionary *listDict = [self.dataBox.dataSource[self.selectIndexPath.row] mutableCopy];
  198. [listDict setValue:@(![listDict[@"isPause"] boolValue]) forKey:@"isPause"];
  199. [self.dataBox.dataSource setObject:listDict atIndexedSubscript:self.selectIndexPath.row];
  200. [self refreshCellForRow];
  201. }
  202. if (manager == self.isOnStatus)
  203. {//结束
  204. NSMutableDictionary *listDict = [self.dataBox.dataSource[self.selectIndexPath.row] mutableCopy];
  205. listDict[@"isOn"] = @"0";
  206. [self.dataBox.dataSource setObject:listDict atIndexedSubscript:self.selectIndexPath.row];
  207. [self refreshCellForRow];
  208. }
  209. }
  210. - (void)managerCallAPIDidFailed:(FBBaseAPIManager *)manager {
  211. if ([manager isKindOfClass:[BHomeEnterpriseAuthAPI class]])
  212. {
  213. [self.view showErrorView];
  214. }
  215. id fetchData = [manager fetchDataWithBox:self.dataBox];
  216. if ([fetchData isKindOfClass:[NSString class]])
  217. {
  218. [self.view fb_showFailureWithStatus:fetchData];
  219. }
  220. }
  221. #pragma mark - UITableViewDelegate
  222. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  223. NSDictionary *dict = [self.dataBox.dataSource objectAtIndex:indexPath.row];
  224. BPositonModel *model = [BPositonModel yy_modelWithJSON:dict];
  225. if ([model.positionCategory isEqualToString:@"8"])
  226. {
  227. HJFullTimeDetailViewController *vc = [[HJFullTimeDetailViewController alloc] init];
  228. vc.detailView.positionID = [model.ID integerValue];
  229. vc.detailView.positionType = [model.positionCategory integerValue];
  230. vc.hidesBottomBarWhenPushed = YES;
  231. vc.selfPublish = YES;
  232. [self.navigationController pushViewController:vc animated:YES];
  233. }
  234. else
  235. {
  236. HJPartTimeDetailViewController *vc = [[HJPartTimeDetailViewController alloc] init];
  237. vc.detailView.positionID = [model.ID integerValue];
  238. vc.detailView.positionType = [model.positionCategory integerValue];
  239. vc.hidesBottomBarWhenPushed = YES;
  240. vc.selfPublish = YES;
  241. [self.navigationController pushViewController:vc animated:YES];
  242. }
  243. }
  244. /* 编辑 */
  245. - (void)editPosition{
  246. HJConfirmPanelViewController *vc = [[HJConfirmPanelViewController alloc] init];
  247. vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  248. vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
  249. self.navigationController.definesPresentationContext = NO;
  250. vc.titleLabel.text = @"修改岗位信息需要重新审核,\n通过后求职者才能看到该岗位哦!";
  251. vc.titleIcon.image = nil;
  252. [vc.cancelButton setTitle:@"取消" forState:UIControlStateNormal];
  253. [vc.confirmButton setTitle:@"确定编辑" forState:UIControlStateNormal];
  254. [vc.confirmButton addTarget:self
  255. action:@selector(editButtonClicked:)
  256. forControlEvents:UIControlEventTouchUpInside];
  257. [self presentViewController:vc animated:YES completion:nil];
  258. }
  259. - (void)editButtonClicked:(UIButton *)sender {
  260. [self dismissViewControllerAnimated:NO completion:^{
  261. BReleaseJobsViewController *vc = [[BReleaseJobsViewController alloc]init];
  262. vc.model = self.model;
  263. vc.hidesBottomBarWhenPushed = YES;
  264. [self.navigationController pushViewController:vc animated:YES];
  265. }];
  266. }
  267. /* 下架 */
  268. - (void)endRecruitment {
  269. HJConfirmPanelViewController *vc = [[HJConfirmPanelViewController alloc] init];
  270. vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  271. vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
  272. self.navigationController.definesPresentationContext = NO;
  273. vc.titleLabel.text = @"岗位下架后不能对其进行任何操作,\n也无法查看该岗位的报名和面试信息。";
  274. vc.titleIcon.image = nil;
  275. [vc.cancelButton setTitle:@"取消" forState:UIControlStateNormal];
  276. [vc.confirmButton setTitle:@"确定下架" forState:UIControlStateNormal];
  277. [vc.confirmButton addTarget:self
  278. action:@selector(recruitmentButtonClicked:)
  279. forControlEvents:UIControlEventTouchUpInside];
  280. [self presentViewController:vc animated:YES completion:nil];
  281. }
  282. - (void)recruitmentButtonClicked:(UIButton *)sender {
  283. [self dismissViewControllerAnimated:NO completion:^{
  284. [self.isOnStatus start];
  285. }];
  286. }
  287. #pragma mark - private method
  288. /* 刷新 */
  289. - (void)refreshCellForRow {
  290. NSIndexPath *indexPath=[NSIndexPath indexPathForRow:self.selectIndexPath.row inSection:0];
  291. [self.tableView.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
  292. }
  293. /* 没有认证*/
  294. - (void)createCertificationView {
  295. __weak typeof(self) weakSelf = self;
  296. [self.view addSubview:self.certificationView];
  297. [self.certificationView mas_makeConstraints:^(MASConstraintMaker *make) {
  298. make.centerY.equalTo(weakSelf.view);
  299. make.left.right.offset(0);
  300. }];
  301. _certificationView.certificationBlock = ^{
  302. BHomeCertificationEnterpriseVC *enterpriseVC = [[BHomeCertificationEnterpriseVC alloc]init];
  303. enterpriseVC.hidesBottomBarWhenPushed = YES;
  304. [weakSelf.navigationController pushViewController:enterpriseVC animated:YES];
  305. };
  306. }
  307. - (void)autoLayOutViews {
  308. __weak typeof(self) weakSelf = self;
  309. self.view.backgroundColor = COLOR_GRAYFA;
  310. [self.view addSubview:self.certificationBtn];
  311. [self.view addSubview:self.tableView];
  312. [self.view addSubview:self.headerView];
  313. [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
  314. make.left.right.equalTo(weakSelf.view).offset(0);
  315. make.top.equalTo(weakSelf.view).offset(0);
  316. make.height.mas_equalTo(45);
  317. }];
  318. if ([[HJCompanyInfoModel companyInfo].authenticationStatus integerValue] == 1)
  319. {//认证中
  320. [self.certificationBtn setTitle:@"您已提交企业认证,正在审核中,点击查看 >>" forState:UIControlStateNormal];
  321. [self.certificationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  322. make.left.right.offset(0);
  323. make.top.equalTo(weakSelf.headerView.mas_bottom).offset(0);
  324. make.height.mas_equalTo(40);
  325. }];
  326. }
  327. else if ([[HJCompanyInfoModel companyInfo].authenticationStatus integerValue] == 2)
  328. {//认证失败
  329. [self.certificationBtn setTitle:@"您已提交企业认证,审核未通过,点击认证 >>" forState:UIControlStateNormal];
  330. [self.certificationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  331. make.left.right.offset(0);
  332. make.top.equalTo(weakSelf.headerView.mas_bottom).offset(0);
  333. make.height.mas_equalTo(40);
  334. }];
  335. }
  336. else
  337. {
  338. [self.certificationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  339. make.left.right.offset(0);
  340. make.top.equalTo(weakSelf.headerView.mas_bottom).offset(-40);
  341. make.height.mas_equalTo(40);
  342. }];
  343. }
  344. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  345. make.left.right.bottom.offset(0);
  346. make.top.equalTo(weakSelf.certificationBtn.mas_bottom).offset(0);
  347. }];
  348. //回调
  349. _headerView.changeBigScrollViewBlock = ^(NSInteger index) {
  350. //赋初始值
  351. weakSelf.listAPI.isOn = @"-1";
  352. weakSelf.listAPI.isPause = @"-1";
  353. weakSelf.listAPI.endDate = @"-1";
  354. weakSelf.listAPI.authenticationStatus = @"-1";
  355. if (index == 0)
  356. {//全部的
  357. }
  358. if (index == 1)
  359. {//正在
  360. weakSelf.listAPI.authenticationStatus = @"3";
  361. }
  362. if (index == 2)
  363. {//暂停
  364. weakSelf.listAPI.isPause = @"1";
  365. }
  366. if (index == 3)
  367. {//下架
  368. weakSelf.listAPI.isOn = @"0";
  369. }
  370. if (index == 4)
  371. { //结束
  372. weakSelf.listAPI.endDate = @"1";
  373. }
  374. if (index == 5)
  375. {//全部审核
  376. weakSelf.listAPI.authenticationStatus = @"0";
  377. }
  378. if (index == 6)
  379. {//审核通过
  380. weakSelf.listAPI.authenticationStatus = @"1";
  381. }
  382. if (index == 7)
  383. {//审核驳回
  384. weakSelf.listAPI.authenticationStatus = @"2";
  385. }
  386. [weakSelf.listAPI start];
  387. };
  388. }
  389. #pragma mark - setter and getter
  390. - (UIButton *)certificationBtn {
  391. if (_certificationBtn == nil)
  392. {
  393. _certificationBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  394. _certificationBtn.titleLabel.font = [UIFont systemFontOfSize:12];
  395. _certificationBtn.backgroundColor = [UIColor colorFromHexString:@"FFEBE3"];
  396. [_certificationBtn setTitleColor:[UIColor colorFromHexString:@"FF6300"] forState:UIControlStateNormal];
  397. [_certificationBtn addTarget:self action:@selector(positionCertificationButtonClick:) forControlEvents:UIControlEventTouchUpInside];
  398. }
  399. return _certificationBtn;
  400. }
  401. - (BPositionDataBox *)dataBox {
  402. if (_dataBox == nil)
  403. {
  404. _dataBox = [[BPositionDataBox alloc]init];
  405. _dataBox.delegate = self;
  406. }
  407. return _dataBox;
  408. }
  409. - (BHomeNoCertificationView *)certificationView {
  410. if (_certificationView == nil)
  411. {
  412. _certificationView = [[BHomeNoCertificationView alloc]init];
  413. }
  414. return _certificationView;
  415. }
  416. - (HeaderSelectView *)headerView {
  417. if (_headerView == nil)
  418. {
  419. _headerView = [[HeaderSelectView alloc]init];
  420. [_headerView showHeaderSelectViewArray:@[@"全部",@"正在招聘",@"暂停招聘",@"已下架",@"已结束",@"全部审核",@"正在审核",@"审核驳回"] andIndex:0 andShowLineView:YES andNumber:4];
  421. }
  422. return _headerView;
  423. }
  424. - (HJPageListView *)tableView {
  425. if (_tableView == nil)
  426. {
  427. _tableView = [[HJPageListView alloc] init];
  428. _tableView.tableView.delegate = self;
  429. _tableView.tableView.dataSource = self.dataBox;
  430. _tableView.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  431. _tableView.APIManager = self.listAPI;
  432. _tableView.dataBox = self.dataBox;
  433. //自定义空白页
  434. _tableView.blankView.imageView.image = [UIImage imageNamed:@"msg_blank"];
  435. _tableView.blankView.label.text = @"暂无数据~空空如也";
  436. }
  437. return _tableView;
  438. }
  439. - (BHomeEnterpriseAuthAPI *)authAPI {
  440. if (_authAPI == nil)
  441. {
  442. _authAPI = [[BHomeEnterpriseAuthAPI alloc]init];
  443. _authAPI.APIManagerDelegate = self;
  444. _authAPI.APIManagerInterceptor = self;
  445. }
  446. return _authAPI;
  447. }
  448. - (BHomeChangeIdentityAPI *)IDAPI {
  449. if (_IDAPI == nil)
  450. {
  451. _IDAPI = [[BHomeChangeIdentityAPI alloc]init];
  452. _IDAPI.APIManagerDelegate = self;
  453. }
  454. return _IDAPI;
  455. }
  456. - (BPositionListAPI *)listAPI {
  457. if (_listAPI == nil)
  458. {
  459. _listAPI = [[BPositionListAPI alloc]init];
  460. _listAPI.APIManagerDelegate = self;
  461. _listAPI.APIManagerInterceptor = self.tableView;
  462. }
  463. return _listAPI;
  464. }
  465. - (BPositionChangeIsPauseAPI *)pauseAPI {
  466. if (_pauseAPI == nil)
  467. {
  468. _pauseAPI = [[BPositionChangeIsPauseAPI alloc]init];
  469. _pauseAPI.APIManagerDelegate = self;
  470. _pauseAPI.APIManagerInterceptor = self;
  471. }
  472. return _pauseAPI;
  473. }
  474. - (BPositionChangeUpdateTimeAPI *)updateTimeAPI {
  475. if (_updateTimeAPI == nil)
  476. {
  477. _updateTimeAPI = [[BPositionChangeUpdateTimeAPI alloc]init];
  478. _updateTimeAPI.APIManagerDelegate = self;
  479. _updateTimeAPI.APIManagerInterceptor = self;
  480. }
  481. return _updateTimeAPI;
  482. }
  483. - (BPositionChangeIsOnStatusAPI *)isOnStatus {
  484. if (_isOnStatus == nil)
  485. {
  486. _isOnStatus = [[BPositionChangeIsOnStatusAPI alloc]init];
  487. _isOnStatus.APIManagerDelegate = self;
  488. _isOnStatus.APIManagerInterceptor = self;
  489. }
  490. return _isOnStatus;
  491. }
  492. /*
  493. #pragma mark - Navigation
  494. // In a storyboard-based application, you will often want to do a little preparation before navigation
  495. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  496. // Get the new view controller using [segue destinationViewController].
  497. // Pass the selected object to the new view controller.
  498. }
  499. */
  500. @end