YOUPAILZChatRoomInviactionUpSeatAttachment.m 1.1 KB

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