| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- //
- // 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 replyCount;
- @property (nonatomic, assign) BOOL isLiked;
- #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
|