添加评论
This commit is contained in:
83
keyBoard/Class/AiTalk/M/KBAICommentModel.h
Normal file
83
keyBoard/Class/AiTalk/M/KBAICommentModel.h
Normal file
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// KBAICommentModel.h
|
||||
// keyBoard
|
||||
//
|
||||
// Created by Mac on 2026/1/16.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class KBAIReplyModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Footer 状态枚举
|
||||
typedef NS_ENUM(NSInteger, KBAIReplyFooterState) {
|
||||
KBAIReplyFooterStateHidden, // 无二级评论,不显示
|
||||
KBAIReplyFooterStateExpand, // 显示"展开x条回复"(初始折叠状态)
|
||||
KBAIReplyFooterStateLoadMore, // 显示"加载更多"(已展开部分)
|
||||
KBAIReplyFooterStateCollapse // 显示"收起"(全部展开后)
|
||||
};
|
||||
|
||||
/// 一级评论模型
|
||||
@interface KBAICommentModel : NSObject
|
||||
|
||||
/// 评论ID
|
||||
@property(nonatomic, copy) NSString *commentId;
|
||||
|
||||
/// 用户ID
|
||||
@property(nonatomic, copy) NSString *userId;
|
||||
|
||||
/// 用户名
|
||||
@property(nonatomic, copy) NSString *userName;
|
||||
|
||||
/// 用户头像
|
||||
@property(nonatomic, copy) NSString *avatarUrl;
|
||||
|
||||
/// 评论内容
|
||||
@property(nonatomic, copy) NSString *content;
|
||||
|
||||
/// 点赞数
|
||||
@property(nonatomic, assign) NSInteger likeCount;
|
||||
|
||||
/// 是否已点赞
|
||||
@property(nonatomic, assign) BOOL isLiked;
|
||||
|
||||
/// 创建时间(时间戳)
|
||||
@property(nonatomic, assign) NSTimeInterval createTime;
|
||||
|
||||
#pragma mark - 二级评论相关
|
||||
|
||||
/// 所有二级评论(从服务器获取的完整数据)
|
||||
@property(nonatomic, strong) NSArray<KBAIReplyModel *> *replies;
|
||||
|
||||
/// 当前显示的二级评论(分页展开用)
|
||||
@property(nonatomic, strong) NSMutableArray<KBAIReplyModel *> *displayedReplies;
|
||||
|
||||
/// 二级评论总数
|
||||
@property(nonatomic, assign) NSInteger totalReplyCount;
|
||||
|
||||
/// 是否还有更多回复未展开
|
||||
@property(nonatomic, assign) BOOL hasMoreReplies;
|
||||
|
||||
/// 回复是否已展开
|
||||
@property(nonatomic, assign) BOOL isRepliesExpanded;
|
||||
|
||||
#pragma mark - Helper Methods
|
||||
|
||||
/// 格式化后的时间字符串
|
||||
- (NSString *)formattedTime;
|
||||
|
||||
/// 获取当前 Footer 状态
|
||||
- (KBAIReplyFooterState)footerState;
|
||||
|
||||
/// 展开更多回复(每次加载指定数量)
|
||||
/// @param count 本次加载的数量
|
||||
- (void)loadMoreReplies:(NSInteger)count;
|
||||
|
||||
/// 收起所有回复
|
||||
- (void)collapseReplies;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Reference in New Issue
Block a user