cdts/xdts-ios 3/TreeHole/Code/Features/Bottle/Model/MessageNotification.m

39 lines
828 B
Mathematica
Raw Normal View History

2023-07-27 09:20:00 +08:00
//
// MessgaeNotification.m
// Youth
//
// Created by ko1o on 2022/1/10.
//
#import "MessageNotification.h"
@implementation MessageNotification
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
return @{@"time": @"label", @"content": @"msg"};
}
- (NSString *)iconUrl {
if (_type == MessageNotificationLearn) {
return @"learn";
}
return [self isSystemNotification] ? @"TH_msg_system_icon" : self.user.avatar;
}
- (NSString *)content {
return [self isSystemNotification] ? _content : nil;
}
- (NSString *)title {
if (_type == MessageNotificationLearn) {
return _title;
}
return [self isSystemNotification] ? @"系统通知" : _content;
}
- (BOOL)isSystemNotification {
return (self.type == MessageNotificationSystem || self.type == MessageNotificationLearn);
}
@end