YOUPAILZChatRoomEmptyChatAttachment.m 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // YOUPAILZChatRoomEmptyChatAttachment.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/11/9.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZChatRoomEmptyChatAttachment.h"
  9. @implementation YOUPAILZChatRoomEmptyChatAttachment
  10. - (NSString *)encodeAttachment{
  11. NSDictionary *dict = @{
  12. CMType : @(CustomOnChatRoomEmptyChat),
  13. CMData : @{
  14. CMClearMsg: self.clear_msg?self.clear_msg:@"",
  15. CMFrom: self.from_uid ?self.from_uid:@"",
  16. CMRoomId: self.roomid ?self.roomid:@"",
  17. }
  18. };
  19. NSData *data = [NSJSONSerialization dataWithJSONObject:dict
  20. options:0
  21. error:nil];
  22. NSString *content = nil;
  23. if (data) {
  24. content = [[NSString alloc] initWithData:data
  25. encoding:NSUTF8StringEncoding];
  26. }
  27. return content;
  28. }
  29. @end