YOUPAILZLiveManageAttachment.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // YOUPAILZLiveManageAttachment.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/8/25.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZLiveManageAttachment.h"
  9. @implementation YOUPAILZLiveManageAttachment
  10. - (NSString *)encodeAttachment
  11. {
  12. NSDictionary *dict = @{
  13. CMType : @(CustomOnLiveManage),
  14. CMData : @{
  15. CMForbiddenUid: self.forbidden_uid?self.forbidden_uid:@"",
  16. CMName: self.name?self.name:@"",
  17. CMDes: self.des?self.des:@"",
  18. CMUserDes: self.user_des?self.user_des:@"",
  19. }
  20. };
  21. NSData *data = [NSJSONSerialization dataWithJSONObject:dict
  22. options:0
  23. error:nil];
  24. NSString *content = nil;
  25. if (data) {
  26. content = [[NSString alloc] initWithData:data
  27. encoding:NSUTF8StringEncoding];
  28. }
  29. return content;
  30. }
  31. @end