
主要变更: 1. 移除 UITableView,改为使用 EPMomentListView 以简化数据展示和交互。 2. 添加顶部固定文案 UILabel,提升用户体验。 3. 通过 EPMomentAPIHelper 统一管理 Moments 列表 API 请求,优化数据加载逻辑。 4. 更新 UI 约束,确保布局适配不同屏幕。 此重构旨在提升代码可维护性和用户界面的一致性。
37 lines
975 B
Objective-C
37 lines
975 B
Objective-C
//
|
||
// EPMomentAPIHelper.h
|
||
// YuMi
|
||
//
|
||
// Created by AI on 2025-10-10.
|
||
//
|
||
|
||
#import <Foundation/Foundation.h>
|
||
#import "BaseMvpPresenter.h"
|
||
#import "MomentsInfoModel.h"
|
||
#import "MomentsListInfoModel.h"
|
||
|
||
NS_ASSUME_NONNULL_BEGIN
|
||
|
||
/// 推荐/我的动态列表数据源类型
|
||
typedef NS_ENUM(NSInteger, EPMomentListSourceType) {
|
||
EPMomentListSourceTypeRecommend = 0,
|
||
EPMomentListSourceTypeMine = 1
|
||
};
|
||
|
||
/// 统一封装 Moments 列表 API
|
||
@interface EPMomentAPIHelper : BaseMvpPresenter
|
||
|
||
/// 拉取动态列表(默认 types:"0,2" 图片+文字)
|
||
/// page 从 0 开始,pageSize > 0
|
||
/// completion 返回 data 数组(字典数组) 或错误
|
||
- (void)fetchMomentsWithType:(EPMomentListSourceType)sourceType
|
||
page:(NSInteger)page
|
||
pageSize:(NSInteger)pageSize
|
||
completion:(void (^)(NSArray <MomentsInfoModel *>* _Nullable list, NSInteger code, NSString * _Nullable msg))completion;
|
||
|
||
@end
|
||
|
||
NS_ASSUME_NONNULL_END
|
||
|
||
|