// // IfishAttachment.m // Ifish // // Created by imac on 16/10/11. // Copyright © 2016年 lianxiang. All rights reserved. // #import "IfishAttachment.h" @implementation IfishAttachment - (NSString *)encodeAttachment{ NSDictionary *dict = @{@"push_link":self.pushlink,@"timestamp":self.timestamp,@"msg_type":self.pushType,@"pushId":self.pushId}; NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:0 error:nil]; NSString *encodeString = @""; if (data) { encodeString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; } return encodeString; } //其他协议如上传下载托管可根据自己的业务需求选择实现 #pragma mark - Getter - (NSString *)pushTitle{ if (!_pushlink) { _pushlink = @""; } return _pushlink; } - (NSString *)pushContext{ if (!_timestamp) { _timestamp = @""; } return _timestamp; } - (NSString *)pushType{ if (!_pushType) { _pushType = @""; } return _pushType; } - (NSString *)pushId{ if (!_pushId) { _pushId = @""; } return _pushId; } @end