ADHService.h 914 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // ADHService.h
  3. // AppDevelopHelper
  4. //
  5. // Created by woodpecker on 2017/11/4.
  6. // Copyright © 2017年 lifebetter. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface ADHService : NSObject
  10. /**
  11. service name
  12. */
  13. + (NSString *)serviceName;
  14. /**
  15. action list
  16. return @{
  17. @"actionName1" : selector1 string,
  18. @"actionName2" : selector2 string,
  19. };
  20. */
  21. + (NSDictionary<NSString*,NSString *> *)actionList;
  22. /**
  23. YES: all request use one shared service instance.
  24. NO: each request use a new service instance.
  25. */
  26. + (BOOL)isShared;
  27. /**
  28. called on service init
  29. */
  30. - (void)onServiceInit;
  31. @end
  32. @interface ADHAction: NSObject
  33. @property (nonatomic, strong) NSString * service;
  34. @property (nonatomic, strong) NSString * name;
  35. @property (nonatomic, strong) NSString * handler;
  36. + (ADHAction *)actionWithService: (NSString *)service name: (NSString *)name handler: (NSString *)handler;
  37. @end