Commit b17d74f8 cgx

调试用户删除动态接口

1 个父辈 89a736c7
......@@ -121,6 +121,7 @@
D0691E0E288009D3008BFFAB /* ReadyItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E0D288009D3008BFFAB /* ReadyItemCell.m */; };
D0691E1128801D43008BFFAB /* RelaxItemsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E1028801D43008BFFAB /* RelaxItemsView.m */; };
D0691E1428801EF3008BFFAB /* ReadyTimeMarker.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E1328801EF3008BFFAB /* ReadyTimeMarker.m */; };
D06F2C5128F6AEC50023921E /* PersonDynViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D06F2C5028F6AEC50023921E /* PersonDynViewModel.m */; };
D070509A28071BAF006D72E1 /* DSNetworkTool.m in Sources */ = {isa = PBXBuildFile; fileRef = D070509928071BAF006D72E1 /* DSNetworkTool.m */; };
D070A78328DEE5C20039C5A7 /* BindMobileController.m in Sources */ = {isa = PBXBuildFile; fileRef = D070A78228DEE5C20039C5A7 /* BindMobileController.m */; };
D070A78528DEE6760039C5A7 /* BindMobileController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D070A78428DEE6760039C5A7 /* BindMobileController.storyboard */; };
......@@ -531,6 +532,8 @@
D0691E1028801D43008BFFAB /* RelaxItemsView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RelaxItemsView.m; sourceTree = "<group>"; };
D0691E1228801EF3008BFFAB /* ReadyTimeMarker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReadyTimeMarker.h; sourceTree = "<group>"; };
D0691E1328801EF3008BFFAB /* ReadyTimeMarker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReadyTimeMarker.m; sourceTree = "<group>"; };
D06F2C4F28F6AEC50023921E /* PersonDynViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PersonDynViewModel.h; sourceTree = "<group>"; };
D06F2C5028F6AEC50023921E /* PersonDynViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PersonDynViewModel.m; sourceTree = "<group>"; };
D070509828071BAF006D72E1 /* DSNetworkTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSNetworkTool.h; sourceTree = "<group>"; };
D070509928071BAF006D72E1 /* DSNetworkTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DSNetworkTool.m; sourceTree = "<group>"; };
D070A78128DEE5C20039C5A7 /* BindMobileController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BindMobileController.h; sourceTree = "<group>"; };
......@@ -1643,6 +1646,8 @@
D070A78D28DF02DE0039C5A7 /* DynamicViewModel.m */,
D053D0DA28F3C23200BB2B84 /* ReportViewModel.h */,
D053D0DB28F3C23200BB2B84 /* ReportViewModel.m */,
D06F2C4F28F6AEC50023921E /* PersonDynViewModel.h */,
D06F2C5028F6AEC50023921E /* PersonDynViewModel.m */,
);
path = ViewModel;
sourceTree = "<group>";
......@@ -2653,6 +2658,7 @@
D055BEC828252D8200BC11A4 /* AudioCourseCell.m in Sources */,
D0AEFE7C2817D13400230DC6 /* UITableViewCell+CardRadius.m in Sources */,
D01DC957287023C20035B78B /* RankHeadView.m in Sources */,
D06F2C5128F6AEC50023921E /* PersonDynViewModel.m in Sources */,
D0D5BB0D286D7A8D00D0507E /* TaskGroupModel.m in Sources */,
D0E3564028F55B50007190EE /* PraiseListController.m in Sources */,
D053D0DF28F40C6A00BB2B84 /* MessageController.m in Sources */,
......
......@@ -7,23 +7,28 @@
#import "CommunityController.h"
#import "CommunityView.h"
#import "ComListViewModel.h"
#import "DynamicController.h"
#import "MessageController.h"
#import "ReportController.h"
#import "DynamicDetailController.h"
#import "PersonDynViewModel.h"
@interface CommunityController () <CommunityViewDelegate, DynamicControllerDelegate, DynamicDetailControllerDelegate>
@property (nonatomic, strong) CommunityView *communityView;
@property (nonatomic, assign) int offset;
@property (nonatomic, strong) NSURLSessionDataTask *likeDataTask;
/// 存储动态id
@property (nonatomic, assign) int talkID;
@property (nonatomic, strong) ComListViewModel *comListViewModel;
@property (nonatomic, strong) PersonDynViewModel *personDynViewModel;
@end
@implementation CommunityController
- (void)loadView {
self.comListViewModel = [ComListViewModel new];
self.view = self.communityView;
}
......@@ -53,7 +58,22 @@
[LoginUtils jumpToLoginControllerWithTarget:self];
return;
}
[self.navigationController pushViewController:[MessageController new] animated:YES];
// [self.navigationController pushViewController:[MessageController new] animated:YES];
#warning - 测试删除接口
[self testDynDeleteAPI];
}
- (void)testDynDeleteAPI {
self.personDynViewModel = [PersonDynViewModel new];
self.personDynViewModel.oper_type = @"dynamic";
self.personDynViewModel.delete_id = 58;
[self.personDynViewModel communityDeleteOperationWithCompletion:^(PersonDynViewModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
[self.comListViewModel deleteComDynWithDynamicID:self.personDynViewModel.delete_id];
[self.communityView updateListView];
}
}];
}
#pragma mark - CommunityViewDelegate
......@@ -69,17 +89,17 @@
- (void)getDynamicListRequest:(BOOL)loadMore {
if (loadMore == NO) { self.offset = 1; }
[ComListViewModel querySleepDynamicListWithOffset:self.offset completion:^(ComListViewModel * _Nonnull requestModel) {
[self.comListViewModel querySleepDynamicListWithLoadMore:loadMore offset:self.offset completion:^(ComListViewModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
if (loadMore) {
if (self.offset > requestModel.totalCount) {
[DSProgressHUD showToast:@"无更多动态"];
[self.communityView updateCommunityMoments:loadMore listArr:@[]];
[self.communityView updateCommunityMoments:loadMore];
return;
}
}
self.offset++;
[self.communityView updateCommunityMoments:loadMore listArr:requestModel.listArr];
[self.communityView updateCommunityMoments:loadMore];
} else {
[DSProgressHUD showToast:requestModel.errMessage];
[self.communityView endRefreshing:loadMore];
......@@ -138,28 +158,16 @@
return;
}
// 1、用户点赞或取消点赞直接响应UI变化
if (comDynModel.isLike) {
comDynModel.likeCount--;
} else {
comDynModel.likeCount++;
}
comDynModel.isLike = !comDynModel.isLike;
[ComListViewModel updateLikeData:comDynModel];
[cell fireLikeAnimate];
[cell updateLikeUI];
// 2、更新点赞或取消点赞请求
if (self.likeDataTask) { [self.likeDataTask cancel]; }
self.likeDataTask = [ComListViewModel userDynamicPraiseWithTalkID:comDynModel.dynamicID completion:^(ComListViewModel * _Nonnull requestModel) {
self.likeDataTask = [ComListViewModel userDynamicPraiseWithComDynModel:comDynModel completion:^(ComListViewModel * _Nonnull requestModel) {
// 3、如果请求失败,延迟执行回退
if (requestModel.resCode != DSResCodeSuccess) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 修改数据model
if (comDynModel.isLike) {
comDynModel.likeCount--;
} else {
comDynModel.likeCount++;
}
comDynModel.isLike = !comDynModel.isLike;
[cell updateLikeUI];
[DSProgressHUD showToast:requestModel.errMessage];
});
......@@ -169,18 +177,19 @@
#pragma mark - DynamicControllerDelegate
- (void)publishSuccessWithData:(id)model {
[self.communityView insertUserDyModel:model];
[self.comListViewModel insertUserDyModel:model];
[self.communityView updateListView];
}
#pragma mark - DynamicDetailControllerDelegate
- (void)updateLikeOrRemark {
[self.communityView updateLikeOrRemarkView];
[self.communityView updateListView];
}
#pragma mark - lazy
- (CommunityView *)communityView {
if (!_communityView) {
_communityView = [[CommunityView alloc] initWithDelegate:self];
_communityView = [[CommunityView alloc] initWithDelegate:self comListViewModel:self.comListViewModel];
}
return _communityView;
}
......
......@@ -7,6 +7,7 @@
#import <UIKit/UIKit.h>
#import "ComDynamicCell.h"
#import "ComListViewModel.h"
NS_ASSUME_NONNULL_BEGIN
......@@ -43,14 +44,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) id<CommunityViewDelegate> delegate;
- (instancetype)initWithDelegate:(id<CommunityViewDelegate>)delegate;
- (instancetype)initWithDelegate:(id<CommunityViewDelegate>)delegate comListViewModel:(ComListViewModel *)comListVM;
/// 更新社区动态
- (void)updateCommunityMoments:(BOOL)loadMore listArr:(NSArray *)listArr;
/// 临时插入用户动态数据
/// @param dyModel dyModel
- (void)insertUserDyModel:(ComDynModel *)dyModel;
- (void)updateCommunityMoments:(BOOL)loadMore;
/// 结束加载动画
- (void)endRefreshing:(BOOL)loadMore;
......@@ -58,8 +55,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 显示举报、取消弹框
- (void)showInformCancelView;
/// 更新社区动态列表点赞或者评论view
- (void)updateLikeOrRemarkView;
/// 更新列表
- (void)updateListView;
@end
NS_ASSUME_NONNULL_END
......@@ -11,17 +11,18 @@
@interface CommunityView () <UITableViewDelegate, UITableViewDataSource, InformCancelAlertViewDelegate>
@property (nonatomic, strong) UIView *headView;
@property (nonatomic, strong) UITableView *listView;
@property (nonatomic, strong) NSMutableArray *listArr;
@property (nonatomic, strong) ComListViewModel *comListVM;
@property (nonatomic, strong) InformCancelAlertView *informCancelView;
@end
@implementation CommunityView
#pragma mark - 初始化
- (instancetype)initWithDelegate:(id<CommunityViewDelegate>)delegate {
- (instancetype)initWithDelegate:(id<CommunityViewDelegate>)delegate comListViewModel:(ComListViewModel *)comListVM {
if (self = [super init]) {
self.delegate = delegate;
self.listArr = [NSMutableArray array];
self.comListVM = comListVM;
self.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
[self addSubview:self.listView];
......@@ -43,24 +44,15 @@
}
#pragma mark - public
- (void)updateCommunityMoments:(BOOL)loadMore listArr:(NSArray *)listArr {
- (void)updateCommunityMoments:(BOOL)loadMore {
if (loadMore) {
[self.listArr addObjectsFromArray:listArr];
[self.listView.mj_footer endRefreshing];
} else {
self.listArr = [NSMutableArray arrayWithArray:listArr];
[self.listView.mj_header endRefreshing];
}
[self.listView reloadData];
}
- (void)insertUserDyModel:(ComDynModel *)dyModel {
if (!dyModel) { return; }
// 用户发的说说临时插入到动态列表第一条
[self.listArr insertObject:dyModel atIndex:0];
[self.listView reloadData];
}
- (void)endRefreshing:(BOOL)loadMore {
loadMore ? [self.listView.mj_footer endRefreshing] : [self.listView.mj_header endRefreshing];
}
......@@ -69,7 +61,7 @@
[self.informCancelView display];
}
- (void)updateLikeOrRemarkView {
- (void)updateListView {
[self.listView reloadData];
}
......@@ -88,7 +80,7 @@
#pragma mark - UITableViewDelegate, UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return self.listArr.count;
return self.comListVM.listArr.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
......@@ -96,7 +88,7 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
ComDynModel *model = self.listArr[indexPath.section];
ComDynModel *model = self.comListVM.listArr[indexPath.section];
return [model cellHeight:DynModelTypeCom];
}
......@@ -109,7 +101,7 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return section == self.listArr.count - 1 ? 6.5 : 12;;
return section == self.comListVM.listArr.count - 1 ? 6.5 : 12;;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
......@@ -121,7 +113,7 @@
if (!cell) {
cell = [[ComDynamicCell alloc] initWithCellType:DynModelTypeCom style:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([ComDynamicCell class])];
}
ComDynModel *model = self.listArr[indexPath.section];
ComDynModel *model = self.comListVM.listArr[indexPath.section];
cell.model = model;
WS(weakSelf);
__weak ComDynamicCell * weakCell = (ComDynamicCell *)cell;
......@@ -142,7 +134,7 @@
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ComDynModel *model = self.listArr[indexPath.section];
ComDynModel *model = self.comListVM.listArr[indexPath.section];
if (self.delegate && [self.delegate respondsToSelector:@selector(didSelectItemWithModel:)]) {
[self.delegate didSelectItemWithModel:model];
}
......
......@@ -6,28 +6,42 @@
//
#import "DSNetworkTool.h"
#import "ComDynModel.h"
NS_ASSUME_NONNULL_BEGIN
/// 社区动态列表、用户点赞
@interface ComListViewModel : DSNetworkTool
@property (nonatomic, assign) int offset;
@property (nonatomic, assign) int limit;
/// 总页数
@property (nonatomic, assign) int totalCount;
/// 社区动态列表数据
@property (nonatomic, strong) NSArray *listArr;
- (void)getComListWithCompletion:(void (^)(ComListViewModel *requestModel))completion;
/// 社区动态查询列表接口
/// @param loadMore loadMore
/// @param offset offset
/// @param completion completion
+ (NSURLSessionDataTask *)querySleepDynamicListWithOffset:(int)offset completion:(void (^)(ComListViewModel *requestModel))completion;
- (NSURLSessionDataTask *)querySleepDynamicListWithLoadMore:(BOOL)loadMore offset:(int)offset completion:(void (^)(ComListViewModel *requestModel))completion;
/// 删除个人社区动态
/// @param dynamicID 动态id
- (void)deleteComDynWithDynamicID:(int)dynamicID;
/// 临时插入用户动态数据
/// @param dyModel dyModel
- (void)insertUserDyModel:(ComDynModel *)dyModel;
/// 临时更新点赞数据
/// @param comDynModel comDynModel
+ (void)updateLikeData:(ComDynModel *)comDynModel;
/// 用户点赞、取消点赞接口
/// @param talkID talkID
/// @param comDynModel comDynModel
/// @param completion completion
+ (NSURLSessionDataTask *)userDynamicPraiseWithTalkID:(int)talkID completion:(void (^)(ComListViewModel *requestModel))completion;
+ (NSURLSessionDataTask *)userDynamicPraiseWithComDynModel:(ComDynModel *)comDynModel completion:(void (^)(ComListViewModel *requestModel))completion;
@end
NS_ASSUME_NONNULL_END
......@@ -6,10 +6,16 @@
//
#import "ComListViewModel.h"
#import "ComDynModel.h"
@implementation ComListViewModel
- (instancetype)init {
if (self = [super init]) {
self.listArr = [NSArray array];
}
return self;
}
- (void)getComListWithCompletion:(void (^)(ComListViewModel *requestModel))completion {
ComListViewModel * requestModel = [[ComListViewModel alloc] init];
NSDictionary *apiDic = [[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"comList" ofType:@"plist"]];
......@@ -26,13 +32,12 @@
completion(requestModel);
}
+ (NSURLSessionDataTask *)querySleepDynamicListWithOffset:(int)offset completion:(void (^)(ComListViewModel *requestModel))completion {
ComListViewModel * requestModel = [[ComListViewModel alloc] init];
- (NSURLSessionDataTask *)querySleepDynamicListWithLoadMore:(BOOL)loadMore offset:(int)offset completion:(void (^)(ComListViewModel *requestModel))completion {
NSString *api = @"query_sleep_dynamic_list";
NSString *argStr = [NSString stringWithFormat:@"query{%@(offset:%d)}", api, offset];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
return [ComListViewModel httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"社区动态查询列表接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
self.resCode = DSResCodeSuccess;
NSDictionary *resultDic = apiDic[@"result"];
NSArray *data_list = resultDic[@"data_list"];
NSMutableArray *tmpArr = [NSMutableArray array];
......@@ -40,22 +45,55 @@
ComDynModel *model = [ComDynModel yy_modelWithDictionary:data_list[i]];
[tmpArr addObject:model];
}
requestModel.listArr = [tmpArr copy];
requestModel.offset = [resultDic[@"offset"] intValue];
requestModel.limit = [resultDic[@"limit"] intValue];
requestModel.totalCount = [resultDic[@"count"] intValue];
completion(requestModel);
if (loadMore) {
NSMutableArray *tmpDyList = [NSMutableArray arrayWithArray:self.listArr];
[tmpDyList addObjectsFromArray:tmpArr.copy];
self.listArr = tmpDyList.copy;
} else {
self.listArr = tmpArr.copy;
}
self.totalCount = [resultDic[@"count"] intValue];
completion(self);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = [failureInfo[@"errorCode"] integerValue];
requestModel.errMessage = failureInfo[@"errMessage"];
completion(requestModel);
self.resCode = [failureInfo[@"errorCode"] integerValue];
self.errMessage = failureInfo[@"errMessage"];
completion(self);
}];
}
+ (NSURLSessionDataTask *)userDynamicPraiseWithTalkID:(int)talkID completion:(void (^)(ComListViewModel *requestModel))completion {
- (void)deleteComDynWithDynamicID:(int)dynamicID {
NSMutableArray *tmpListArr = [NSMutableArray arrayWithArray:self.listArr];
[tmpListArr enumerateObjectsUsingBlock:^(ComDynModel * obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.dynamicID == dynamicID) {
*stop = YES;
[tmpListArr removeObject:obj];
}
}];
self.listArr = tmpListArr.copy;
}
- (void)insertUserDyModel:(ComDynModel *)dyModel {
if (!dyModel) { return; }
// 用户发的说说临时插入到动态列表第一条
NSMutableArray *tmpListArr = [NSMutableArray arrayWithArray:self.listArr];
[tmpListArr insertObject:dyModel atIndex:0];
self.listArr = tmpListArr.copy;
}
+ (void)updateLikeData:(ComDynModel *)comDynModel {
if (comDynModel.isLike) {
comDynModel.likeCount--;
} else {
comDynModel.likeCount++;
}
comDynModel.isLike = !comDynModel.isLike;
}
+ (NSURLSessionDataTask *)userDynamicPraiseWithComDynModel:(ComDynModel *)comDynModel completion:(void (^)(ComListViewModel *requestModel))completion {
ComListViewModel * requestModel = [[ComListViewModel alloc] init];
NSString *api = @"user_dynamic_praise";
NSString *argStr = [NSString stringWithFormat:@"mutation{%@(talk_id:%d)}", api, talkID];
NSString *argStr = [NSString stringWithFormat:@"mutation{%@(talk_id:%d)}", api, comDynModel.dynamicID];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"用户动态点赞、取消点赞接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
......@@ -63,6 +101,15 @@
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = [failureInfo[@"errorCode"] integerValue];
requestModel.errMessage = failureInfo[@"errMessage"];
// 回滚数据model
if (comDynModel.isLike) {
comDynModel.likeCount--;
} else {
comDynModel.likeCount++;
}
comDynModel.isLike = !comDynModel.isLike;
completion(requestModel);
}];
}
......
......@@ -38,9 +38,6 @@ NS_ASSUME_NONNULL_BEGIN
/// @param completion 完成回调
- (NSURLSessionDataTask *)publishDynamicWithCompletion:(void (^)(DynamicViewModel *viewModel))completion;
/// 用户-删除动态,评论,回复接口
/// @param completion completion
- (NSURLSessionDataTask *)communityDeleteOperationWithCompletion:(void (^)(DynamicViewModel *viewModel))completion;
@end
NS_ASSUME_NONNULL_END
......@@ -36,18 +36,4 @@
}];
}
- (NSURLSessionDataTask *)communityDeleteOperationWithCompletion:(void (^)(DynamicViewModel *viewModel))completion {
NSString *api = @"community_delete_operation";
NSString *argStr = [NSString stringWithFormat:@"mutation{%@(oper_type:%@,delete_id:%d)}", api, self.oper_type, self.delete_id];
return [DynamicViewModel httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"用户删除动态、评论、回复接口apiDic:%@", apiDic);
self.resCode = DSResCodeSuccess;
completion(self);
} failure:^(id _Nonnull failureInfo) {
self.resCode = [failureInfo[@"errorCode"] integerValue];
self.errMessage = failureInfo[@"errMessage"];
completion(self);
}];
}
@end
//
// PersonDynViewModel.h
// DreamSleep
//
// Created by peter on 2022/10/12.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
/// 个人中心动态相关viewModel
@interface PersonDynViewModel : DSNetworkTool
/*
删除操作选项类别
dynamic:删除动态 comment:删除评论 reply:删除回复
*/
@property (nonatomic, copy) NSString *oper_type;
/*
被删除对象id
动态Id 评论Id 回复Id
*/
@property (nonatomic, assign) int delete_id;
/// 用户-删除动态,评论,回复接口
/// @param completion completion
- (NSURLSessionDataTask *)communityDeleteOperationWithCompletion:(void (^)(PersonDynViewModel *requestModel))completion;
@end
NS_ASSUME_NONNULL_END
//
// PersonDynViewModel.m
// DreamSleep
//
// Created by peter on 2022/10/12.
//
#import "PersonDynViewModel.h"
@implementation PersonDynViewModel
- (NSURLSessionDataTask *)communityDeleteOperationWithCompletion:(void (^)(PersonDynViewModel *requestModel))completion {
NSString *api = @"community_delete_operation";
NSString *argStr = [NSString stringWithFormat:@"mutation{%@(oper_type:\"%@\",delete_id:%d)}", api, self.oper_type, self.delete_id];
return [PersonDynViewModel httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"用户-删除动态,评论,回复接口apiDic:%@", apiDic);
self.resCode = DSResCodeSuccess;
completion(self);
} failure:^(id _Nonnull failureInfo) {
self.resCode = [failureInfo[@"errorCode"] integerValue];
self.errMessage = failureInfo[@"errMessage"];
completion(self);
}];
}
@end
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!