MessageComReplyModel.m 1.3 KB
//
//  MessageComReplyModel.m
//  DreamSleep
//
//  Created by peter on 2022/10/17.
//

#import "MessageComReplyModel.h"

@implementation MessageComReplyModel

#pragma mark - YYModel
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper {
    return @{@"identifier" : @"id",
             @"userID" : @"user_id",
             @"preUserID" : @"pre_user_id",
             @"preContent" : @"pre_content",
             @"publishTime" : @"publish_time",
             @"nickName" : @"nick_name",
             @"userProfile" : @"user_profile"
    };
}

#pragma mark - public
+ (UIFont *)contentFont {
    return SysFont(14);
}

+ (UIFont *)preContentFont {
    return SysFont(14);
}

+ (CGFloat)contentLeftMargin {
    return 67;
}

+ (CGFloat)contentRightMargin {
    return 50;
}

- (CGFloat)contentHeight {
    CGFloat contentW = kScreenWidth - [MessageComReplyModel contentLeftMargin] - [MessageComReplyModel contentRightMargin];
    return [UILabel getHeightByWidth:contentW text:self.content font:[MessageComReplyModel contentFont]];
}

- (CGFloat)preContentHeight {
    return 20;
}

- (CGFloat)cellHeight {
    CGFloat iconH = 40;
    CGFloat contentH = [self contentHeight];
    CGFloat space = 6;
    CGFloat preContentHeight = [self preContentHeight];
    CGFloat bottomH = 72;
    return iconH +contentH + space + preContentHeight + bottomH;
}

@end