1234567891011121314151617181920212223242526272829303132333435 |
- //
- // YOUPAILZLiveInfoUpdateAttachment.m
- // TIANYAN
- //
- // Created by CY on 2021/5/25.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAILZLiveInfoUpdateAttachment.h"
- @implementation YOUPAILZLiveInfoUpdateAttachment
- - (NSString *)encodeAttachment
- {
- NSDictionary *dict = @{
- CMType : @(CustomOnLiveInfoUpdate),
- CMData : @{
- CMAnchorCharm: self.anchor_charm?self.anchor_charm:@"",
- CMFans: self.fans ?self.fans:@"",
- CMAnchorRankInfo: self.anchor_rank_info ? self.anchor_rank_info:@{},
- CMRankTopThree: self.rank_top_three ? self.rank_top_three:@{},
- }
- };
- NSData *data = [NSJSONSerialization dataWithJSONObject:dict
- options:0
- error:nil];
- NSString *content = nil;
- if (data) {
- content = [[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding];
- }
- return content;
- }
- @end
|