
主要变更: 1. 新增 EPMomentPublishViewController.h 和 EPMomentPublishViewController.m 文件,提供图文发布页面的 UI 和逻辑。 2. 实现了发布按钮、文本输入框、图片选择功能,支持最多选择 9 张图片。 3. 集成了 TZImagePickerController 以便于用户选择图片。 4. 更新了 EPMomentViewController,添加了跳转到发布页面的逻辑。 此功能旨在提升用户体验,简化图文发布流程。
43 lines
1.5 KiB
Objective-C
43 lines
1.5 KiB
Objective-C
//
|
|
// EPMomentAPIHelper.m
|
|
// YuMi
|
|
//
|
|
// Created by AI on 2025-10-10.
|
|
//
|
|
|
|
#import <UIKit/UIKit.h>
|
|
#import "EPMomentAPIHelper.h"
|
|
#import "Api+Moments.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "BaseModel.h"
|
|
|
|
|
|
@implementation EPMomentAPIHelper
|
|
// [Api momentsRecommendList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
|
// if (code == 200 && data.data) {
|
|
// NSArray *array = [MomentsInfoModel modelsWithArray:data.data];
|
|
// if (completion) completion(array ?: @[], 200, @"success");
|
|
// } else {
|
|
// if (completion) completion(@[], code, msg);
|
|
// }
|
|
// } page:pageStr pageSize:pageSizeStr types:types];
|
|
|
|
- (void)fetchLatestMomentsWithNextID:(NSString *)nextID
|
|
completion:(void (^)(NSArray <MomentsInfoModel *>* _Nullable list, NSString *nextMomentID))completion
|
|
failure:(void(^)(NSInteger code, NSString * _Nullable msg))failure {
|
|
NSString *pageSizeStr = @"20";
|
|
NSString *types = @"0,2"; // 图片+文字
|
|
|
|
[Api momentsLatestList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
MomentsListInfoModel *listInfo = [MomentsListInfoModel modelWithDictionary:data.data];
|
|
if (completion) completion(listInfo.dynamicList ?: @[],
|
|
listInfo.nextDynamicId);
|
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
if (failure) failure(code, msg);
|
|
}] dynamicId:nextID pageSize:pageSizeStr types:types];
|
|
}
|
|
|
|
@end
|
|
|
|
|