1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- //
- // TXLiveMessageKickOut.m
- // StudentDaya
- //
- // Created by 王智 on 2023/2/27.
- // Copyright © 2023 DayaMusic. All rights reserved.
- //
- #import "TXLiveMessageKickOut.h"
- @implementation TXLiveMessageKickOut
- - (NSData *)encodeMessage {
- NSMutableDictionary *parm = [NSMutableDictionary dictionary];
- NSMutableDictionary *content = [NSMutableDictionary dictionary];
-
- [content setValue:[self.userInfo getUserInfoDic] forKey:@"sendUserInfo"];
- [content setValue:self.targetId forKey:@"targetId"];
- [content setValue:self.targetName forKey:@"targetName"];
-
- [parm setValue:self.objectName forKey:@"objectName"];
- [parm setValue:content forKey:@"content"];
- 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"]];
- self.targetId = [content ks_stringValueForKey:@"targetId"];
- self.targetName = [content ks_stringValueForKey:@"targetName"];
- }
- + (NSString *)getObjectName {
- return @"RC:Chatroom:KickOut";
- }
- - (NSString *)objectName {
- return @"RC:Chatroom:KickOut";
- }
- @end
|