1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // BehaviorTrackManger.m
- // FirstLink
- //
- // Created by jack on 15/7/23.
- // Copyright (c) 2015年 FirstLink. All rights reserved.
- //
- #import "BehaviorTrackManger.h"
- @implementation BehaviorTrackManger
- + (void)requestBehaviorType:(kBehaviorType)type jsonString:(NSString *)jsonString{
- NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/pvc/create_pvc.json", [[FKServerUtil sharedInstance] apiServer]];
- NSMutableDictionary *para = [NSMutableDictionary dictionary];
- [para addEntriesFromDictionary:[FLRequestHelper commonParamater]];
- NSString *dictJson;
- if (jsonString && jsonString.length > 0){
- dictJson = [FLRequestHelper JSONStringWithKeys:@[@"biz_json", @"code"] values:@[jsonString, [NSString stringWithFormat:@"%lu", (unsigned long)type]]];
- } else {
- dictJson = [FLRequestHelper JSONStringWithKeys:@[@"code"] values:@[[NSString stringWithFormat:@"%lu", (unsigned long)type]]];
- }
- [para setValue:dictJson forKey:@"pvc_json"];
-
- [[FLDataCenter sharedDataCenter] POST:urlString parameters:para success:^(MSGHeader *header, id responseObject) {
- if (header.code.intValue == RESPONSE_MSG_NORMAL) {
- }
- } failure:^(MSGHeader *header, NSError *error) {
-
- }];
- }
- + (void)requestBehavior:(NSString *)pageName
- areaName:(NSString *)areaName
- objType:(NSString *)objType
- objID:(NSString *)objID
- positionV1:(NSString *)v1
- positionV2:(NSString *)v2 {
- NSString *urlString = [NSString stringWithFormat:@"%@/link-site/api/pvc/track_index_click.json", [[FKServerUtil sharedInstance] apiServer]];
- NSMutableDictionary *para = [NSMutableDictionary dictionary];
- [para addEntriesFromDictionary:[FLRequestHelper commonParamater]];
-
- NSArray *keys = @[@"page", @"area_alias", @"object_type", @"object_id", @"object_position_lv1", @"object_position_lv2"];
- NSArray *values = @[[FLStringHelper replaceNilWithEmpty:pageName],
- [FLStringHelper replaceNilWithEmpty:areaName],
- [FLStringHelper replaceNilWithEmpty:objType],
- [FLStringHelper replaceNilWithEmpty:objID],
- [FLStringHelper replaceNilWithEmpty:v1],
- [FLStringHelper replaceNilWithEmpty:v2]];
-
-
- NSString *string = [FLRequestHelper JSONStringWithKeys:keys
- values:values];
- [para setValue:string forKey:@"post_json"];
-
- [[FLDataCenter sharedDataCenter] POST:urlString parameters:para success:^(MSGHeader *header, id responseObject) {
- if (header.code.intValue == RESPONSE_MSG_NORMAL) {
- }
- } failure:^(MSGHeader *header, NSError *error) {
-
- }];
- }
- @end
|