口袋优选

KBEventTool.m 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // YHEventTool.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/5/11.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "KBEventTool.h"
  9. #import <AdSupport/AdSupport.h>
  10. @implementation KBEventTool
  11. + (void)eventWithEventType:(NSInteger)type origin:(NSString *)origin category_id:(NSString *)category_id goods_id:(NSString *)goodId source:(NSString *)source {
  12. if (!origin) origin = @"0";
  13. if (!category_id) category_id = @"0";
  14. if (!goodId) goodId = @"";
  15. if (!source){
  16. source = Other;
  17. }
  18. NSString *deviceUUID = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
  19. NSLog(@"%@",deviceUUID);
  20. NSDictionary *param = @{@"type":@(type),
  21. @"idfa":deviceUUID,
  22. @"origin":origin,
  23. @"category_id":category_id,
  24. @"goods_id":goodId,
  25. @"path":source
  26. };
  27. NSString *url = [NSString stringWithFormat:@"%@/api/categoryNew/countBuy",BaseURL];
  28. [KBHttp post:url params:param success:^(id json) {
  29. NSLog(@"统计计数成功");
  30. } failure:^(NSError *error) {
  31. }];
  32. }
  33. @end