| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //
- // JXCommentContent.h
- // AICity
- //
- // Created by TogetherWatch on 2025-10-20.
- // Feature: 010-ui-ios - iOS平台完整功能实现(对标Android)
- // Phase: 1 - 数据模型层
- //
- // 对应Android: CommentItem (CommentDialog.kt)
- //
- #import <Foundation/Foundation.h>
- NS_ASSUME_NONNULL_BEGIN
- /**
- * 评论内容数据模型
- */
- @interface JXCommentContent : NSObject
- #pragma mark - 基本信息
- @property (nonatomic, assign) long long commentId;
- @property (nonatomic, assign) long long userId;
- @property (nonatomic, copy) NSString *userName;
- @property (nonatomic, copy) NSString *userAvatar;
- @property (nonatomic, copy) NSString *content;
- #pragma mark - 交互数据
- @property (nonatomic, assign) long long likeCount;
- @property (nonatomic, assign) long long reply_count;
- @property (nonatomic, assign) long long replyCount;
- @property (nonatomic, assign) BOOL isLiked;
- @property (nonatomic, assign) BOOL isOpen;
- #pragma mark - 时间信息
- @property (nonatomic, assign) long long createdAt; // Unix时间戳(毫秒)
- #pragma mark - 用户认证
- @property (nonatomic, assign) BOOL isVerified; // 是否认证用户
- #pragma mark - 初始化方法
- - (instancetype)initWithDictionary:(NSDictionary *)dict;
- + (instancetype)commentWithDictionary:(NSDictionary *)dict;
- - (NSDictionary *)toDictionary;
- #pragma mark - UI格式化方法
- /**
- * 格式化时间显示
- * 规则:
- * - 今年内:显示 "月-日" 格式(如 "10-20")
- * - 非今年:显示 "年-月-日" 格式(如 "2024-10-20")
- */
- - (NSString *)formattedTime;
- /**
- * 格式化点赞数
- * 规则:
- * - >= 10000: "X.Xw"
- * - >= 1000: "X.Xk"
- * - < 1000: 原始数字
- */
- - (NSString *)formattedLikeCount;
- @end
- NS_ASSUME_NONNULL_END
|