39 lines
828 B
Objective-C
39 lines
828 B
Objective-C
//
|
|
// 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
|