12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // TXLiveMessageOpenLive.m
- // StudentDaya
- //
- // Created by 王智 on 2023/3/8.
- // Copyright © 2023 DayaMusic. All rights reserved.
- //
- #import "TXLiveMessageOpenLive.h"
- @implementation TXLiveMessageOpenLive
- - (NSData *)encodeMessage {
- NSMutableDictionary *parm = [NSMutableDictionary dictionary];
- NSMutableDictionary *content = [NSMutableDictionary dictionary];
- [content setValue:[self.userInfo getUserInfoDic] forKey:@"sendUserInfo"];
- [parm setValue:content forKey:@"content"];
- [parm setValue:self.objectName forKey:@"objectName"];
- return [NSJSONSerialization dataWithJSONObject:parm options:kNilOptions error:nil];
- }
- - (NSDictionary *)decodeData:(NSData *)data {
- if (data == nil) return nil;
- NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
- NSDictionary *json = [[NSDictionary alloc] initWithDictionary:dictionary];
- if (json == nil) return nil;
- return json;
- }
- - (void)evaluateSource:(NSDictionary *)msgDic {
- NSDictionary *content = [msgDic ks_dictionaryValueForKey:@"content"];
- self.userInfo = [TXLiveUser evaluateUserInfo:[content ks_dictionaryValueForKey:@"sendUserInfo"]];
- }
- + (NSString *)getObjectName {
- return @"RC:Chatroom:StartLive";
- }
- - (NSString *)objectName {
- return @"RC:Chatroom:StartLive";
- }
- @end
|