// // YOUPAILZChatRoomModeUpdateAttrchment.m // VQU // // Created by CY on 2021/11/9. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAILZChatRoomModeUpdateAttrchment.h" @implementation YOUPAILZChatRoomModeUpdateAttrchment - (NSString *)encodeAttachment{ NSDictionary *dict = @{ CMType : @(CustomOnChatRoomModeUpdate), CMData : @{ CMChangeType: self.change_type?self.change_type:@"", CMFrom: self.from_uid ?self.from_uid:@"", CMRoomId: self.roomid ?self.roomid:@"", CMChangeData: self.changeData ?self.changeData:@{}, } }; NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:0 error:nil]; NSString *content = nil; if (data) { content = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; } return content; } @end