1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // YOUPAILPFollowAttachment.m
- // zhimi
- //
- // Created by 张灿 on 2019/1/28.
- // Copyright © 2019年 caiPro. All rights reserved.
- //
- #import "YOUPAILPFollowAttachment.h"
- @implementation YOUPAILPFollowAttachment
- - (NSString *)encodeAttachment
- {
- NSDictionary *dict = @{
- CMType : @(CustomFollow),
- CMData : @{
- CMUserid: self.userid ?[NSNumber numberWithInteger:self.userid]:@0,
- CMSex: self.sex ?[NSNumber numberWithInteger:self.sex]:@0,
- CMAge: self.age ?[NSNumber numberWithInteger:self.age]:@0,
- CMNickname: self.nickname ?self.nickname:@"",
- CMAvatar: self.avatar ?self.avatar:@"",
- CMCity: self.city?self.city:@[],
- CMTimer: self.time ?self.time:@"",
- CMSign: self.sign ?self.sign:@"",
- CMGrade: self.grade ?self.grade:@{},
- }
- };
- NSData *data = [NSJSONSerialization dataWithJSONObject:dict
- options:0
- error:nil];
- NSString *content = nil;
- if (data) {
- content = [[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding];
- }
- return content;
- }
- - (NSString *)cellContent:(NIMMessage *)message{
- return @"YOUPAILPFollowContentView";
- }
- - (CGSize)contentSize:(NIMMessageModel *)model cellWidth:(CGFloat)width{
-
- return CGSizeMake(KScreenWidth, 94);
- }
- - (UIEdgeInsets)contentViewInsets:(NIMMessage *)message
- {
- return UIEdgeInsetsZero;
-
- }
- @end
|