更换类名和方法

This commit is contained in:
liyuhua
2023-12-06 10:45:27 +08:00
parent d500030a4e
commit 2fdfdff341
56 changed files with 1448 additions and 1456 deletions

View File

@@ -156,4 +156,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: cc88fa05da662ee682fc0eeb502faab221faa032 PODFILE CHECKSUM: cc88fa05da662ee682fc0eeb502faab221faa032
COCOAPODS: 1.14.2 COCOAPODS: 1.12.1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
//
// MewAccountInfoStorage.h
// yinmeng-ios
//
// Created by duoban on 2023/12/6.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MewAccountInfoStorage : NSObject
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// MewAccountInfoStorage.m
// yinmeng-ios
//
// Created by duoban on 2023/12/6.
//
#import "MewAccountInfoStorage.h"
@implementation MewAccountInfoStorage
@end

View File

@@ -1,40 +0,0 @@
//
// BaseMvpPresenter.h
// mew-ios
//
// Created by 触海 on 2023/11/6.
//
#import <Foundation/Foundation.h>
#import "BaseMvpProtocol.h"
#import "MewHttpRequestHelper.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^HttpSuccess)(BaseModel *data);
typedef void(^HttpFail)(NSInteger code, NSString * _Nullable msg);
@interface BaseMvpPresenter : NSObject
// 初始化view
- (void)attatchView:(id)view;
// 获取view
- (id)getView;
- (void)detatchView;
// 退出
- (void)logout;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success mew_showLoading:(BOOL)loading;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success errorToast:(BOOL)toast;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success mew_showLoading:(BOOL)loading errorToast:(BOOL)toast;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail mew_showLoading:(BOOL)loading;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail errorToast:(BOOL)toast;
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail mew_showLoading:(BOOL)loading errorToast:(BOOL)toast;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,114 +0,0 @@
//
// BaseMvpPresenter.m
// mew-ios
//
// Created by on 2023/11/6.
//
#import "BaseMvpPresenter.h"
#import "AccountInfoStorage.h"
#import "MewClientConfig.h"
@interface BaseMvpPresenter()
@property (nonatomic, weak) id view;
@end
@implementation BaseMvpPresenter
- (void)attatchView:(id)view {
self.view = view;
}
- (id)getView {
return self.view;
}
///
- (void)logout {
[[AccountInfoStorage instance] saveAccountInfo:nil];
[[AccountInfoStorage instance] saveTicket:nil];
///
[[MewClientConfig shareConfig] mew_resetHeartBratTimer];
[[self getView] mew_getTokenId];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success {
return [self createHttpCompletion:success fail:nil];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success mew_showLoading:(BOOL)loading {
return [self createHttpCompletion:success fail:nil mew_showLoading:loading];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success errorToast:(BOOL)toast {
return [self createHttpCompletion:success fail:nil errorToast:toast];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success mew_showLoading:(BOOL)loading errorToast:(BOOL)toast {
return [self createHttpCompletion:success fail:nil mew_showLoading:loading errorToast:toast];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail {
return [self createHttpCompletion:success fail:fail mew_showLoading:NO errorToast:YES];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail mew_showLoading:(BOOL)loading {
return [self createHttpCompletion:success fail:fail mew_showLoading:loading errorToast:YES];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail errorToast:(BOOL)toast {
return [self createHttpCompletion:success fail:fail mew_showLoading:NO errorToast:toast];
}
- (MewHttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail mew_showLoading:(BOOL)loading errorToast:(BOOL)toast {
// if (loading) {
// [self.view showAnchorLoading];
// }
return ^(BaseModel *data, NSInteger code, NSString * _Nullable msg) {
if (loading && [self.view respondsToSelector:@selector(mew_hideHUD)]) {
[self.view mew_hideHUD];
}
if (code == 200) {
success(data);
return;
}
switch (code) {
case 401: //
[self logout];
return;
case 407:
case 408:
// [[self getView] accountBanned:data];
return;
case 1415: //
[[self getView] mew_completeUserInfo];
return;
case 3009: //
[[self getView] accountCanceled:data.mewModel2dictionary];
return;
default:
break;
}
if (toast && [self.view respondsToSelector:@selector(mew_showErrorToast:)]) {
[self.view mew_showErrorToast:msg];
}
if (fail) {
fail(code, msg);
}
};
}
- (void)detatchView {
}
@end

View File

@@ -0,0 +1,34 @@
//
// MewBaseMvpPresenter.h
// yinmeng-ios
//
// Created by duoban on 2023/12/5.
//
#import "MewBaseMvpProtocol.h"
#import "MewHttpRequestHelper.h"
#import <Foundation/Foundation.h>
typedef void(^MewHttpSuccess)(BaseModel * _Nullable data);
typedef void(^MewHttpFail)(NSInteger code, NSString * _Nullable msg);
NS_ASSUME_NONNULL_BEGIN
@interface MewBaseMvpPresenter : NSObject
// 初始化view
- (void)mew_attatchView:(id)view;
// 获取view
- (id)mew_getView;
- (void)mew_detatchView;
// 退出
- (void)mew_logout;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success mew_showLoading:(BOOL)loading;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success errorToast:(BOOL)toast;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success mew_showLoading:(BOOL)loading errorToast:(BOOL)toast;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success fail:(MewHttpFail _Nullable)fail;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success fail:(MewHttpFail _Nullable)fail mew_showLoading:(BOOL)loading;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success fail:(MewHttpFail _Nullable)fail errorToast:(BOOL)toast;
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess _Nonnull)success fail:(MewHttpFail _Nullable)fail mew_showLoading:(BOOL)loading errorToast:(BOOL)toast;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,112 @@
//
// MewBaseMvpPresenter.m
// yinmeng-ios
//
// Created by duoban on 2023/12/5.
//
#import "MewBaseMvpPresenter.h"
#import "AccountInfoStorage.h"
#import "MewClientConfig.h"
@interface MewBaseMvpPresenter()
@property (nonatomic, weak) id view;
@end
@implementation MewBaseMvpPresenter
- (void)mew_attatchView:(id)view {
self.view = view;
}
- (id)mew_getView {
return self.view;
}
///
- (void)mew_logout {
[[AccountInfoStorage instance] saveAccountInfo:nil];
[[AccountInfoStorage instance] saveTicket:nil];
///
[[MewClientConfig shareConfig] mew_resetHeartBratTimer];
[[self mew_getView] mew_getTokenId];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success {
return [self mew_createHttpCompletion:success fail:nil];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success mew_showLoading:(BOOL)loading {
return [self mew_createHttpCompletion:success fail:nil mew_showLoading:loading];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success errorToast:(BOOL)toast {
return [self mew_createHttpCompletion:success fail:nil errorToast:toast];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success mew_showLoading:(BOOL)loading errorToast:(BOOL)toast {
return [self mew_createHttpCompletion:success fail:nil mew_showLoading:loading errorToast:toast];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success fail:(MewHttpFail)fail {
return [self mew_createHttpCompletion:success fail:fail mew_showLoading:NO errorToast:YES];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success fail:(MewHttpFail)fail mew_showLoading:(BOOL)loading {
return [self mew_createHttpCompletion:success fail:fail mew_showLoading:loading errorToast:YES];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success fail:(MewHttpFail)fail errorToast:(BOOL)toast {
return [self mew_createHttpCompletion:success fail:fail mew_showLoading:NO errorToast:toast];
}
- (MewHttpRequestHelperCompletion)mew_createHttpCompletion:(MewHttpSuccess)success fail:(MewHttpFail)fail mew_showLoading:(BOOL)loading errorToast:(BOOL)toast {
// if (loading) {
// [self.view showAnchorLoading];
// }
return ^(BaseModel *data, NSInteger code, NSString * _Nullable msg) {
if (loading && [self.view respondsToSelector:@selector(mew_hideHUD)]) {
[self.view mew_hideHUD];
}
if (code == 200) {
success(data);
return;
}
switch (code) {
case 401: //
[self mew_logout];
return;
case 407:
case 408:
// [[self mew_getView] accountBanned:data];
return;
case 1415: //
[[self mew_getView] mew_completeUserInfo];
return;
case 3009: //
[[self mew_getView] mew_accountCanceled:data.mewModel2dictionary];
return;
default:
break;
}
if (toast && [self.view respondsToSelector:@selector(mew_showErrorToast:)]) {
[self.view mew_showErrorToast:msg];
}
if (fail) {
fail(code, msg);
}
};
}
- (void)mew_detatchView {
}
@end

View File

@@ -1,26 +1,22 @@
// //
// BaseMvpProtocol.h // MewMewBaseMvpProtocol.h
// mew-ios // yinmeng-ios
// //
// Created by 触海 on 2023/11/6. // Created by duoban on 2023/12/5.
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "MewBaseViewController.h" #import "MewBaseViewController.h"
@class BaseModel; @class BaseModel;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol BaseMvpProtocol <NSObject, MewBaseViewControllerProtocol> @protocol MewBaseMvpProtocol <NSObject,MewBaseViewControllerProtocol>
/// 登录失效 /// 登录失效
- (void)mew_getTokenId; - (void)mew_getTokenId;
/// 跳转到填写用户资料 /// 跳转到填写用户资料
- (void)mew_completeUserInfo; - (void)mew_completeUserInfo;
/// 账号已注销 /// 账号已注销
- (void)accountCanceled:(NSDictionary *)data; - (void)mew_accountCanceled:(NSDictionary *)data;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -6,7 +6,7 @@
// //
#import "MewBaseViewController.h" #import "MewBaseViewController.h"
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN

View File

@@ -26,16 +26,16 @@
- (__kindof id)presenter { - (__kindof id)presenter {
if (_presenter == nil) { if (_presenter == nil) {
_presenter = [self createPresenter]; _presenter = [self createPresenter];
[_presenter attatchView:self]; [_presenter mew_attatchView:self];
} }
return _presenter; return _presenter;
} }
- (__kindof id)createPresenter { - (__kindof id)createPresenter {
return [[BaseMvpPresenter alloc] init]; return [[MewBaseMvpPresenter alloc] init];
} }
#pragma mark - BaseMvpProtocol #pragma mark - MewBaseMvpProtocol
- (void)mew_getTokenId { - (void)mew_getTokenId {
MewLoginViewController *loginVC = [[MewLoginViewController alloc] init]; MewLoginViewController *loginVC = [[MewLoginViewController alloc] init];
MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:loginVC]; MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:loginVC];
@@ -48,7 +48,7 @@
} }
- (void)accountCanceled:(NSDictionary *)data { - (void)mew_accountCanceled:(NSDictionary *)data {
// NSString *date = [NSString stringWithFormat:@"%.0f",[[data objectForKey:@"cancelDate"] doubleValue]]; // NSString *date = [NSString stringWithFormat:@"%.0f",[[data objectForKey:@"cancelDate"] doubleValue]];
// NSString *dateDes = [NSString stringWithFormat:@"注销时间:%@", [PLTimeUtil getDateWithYYMMDD:date]]; // NSString *dateDes = [NSString stringWithFormat:@"注销时间:%@", [PLTimeUtil getDateWithYYMMDD:date]];
// NSString *msg = [NSString stringWithFormat:@"%@\n\n请联系客服微信yinmeng-kefu咨询哦!", dateDes]; // NSString *msg = [NSString stringWithFormat:@"%@\n\n请联系客服微信yinmeng-kefu咨询哦!", dateDes];

View File

@@ -21,7 +21,7 @@ typedef void(^MewHttpRequestHelperCompletion)(BaseModel* data, NSInteger code, N
@interface MewHttpRequestHelper : NSObject @interface MewHttpRequestHelper : NSObject
/// 配置公参 /// 配置公参
+ (NSDictionary*)configBaseParmars:(NSDictionary *)parmars; + (NSDictionary*)mew_configBaseParmars:(NSDictionary *)parmars;
+ (void)GET:(NSString *)method + (void)GET:(NSString *)method
params:(NSDictionary *)params params:(NSDictionary *)params

View File

@@ -76,7 +76,7 @@ static const char *titleFrameStr = "titleFrame";
objc_setAssociatedObject(self, UIControl_enventIsIgnoreEvent, @(isIgnoreEvent), OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(self, UIControl_enventIsIgnoreEvent, @(isIgnoreEvent), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
} }
-(void)setmew_acceptEventInterval:(NSTimeInterval)mew_acceptEventInterval{ -(void)setMew_acceptEventInterval:(NSTimeInterval)mew_acceptEventInterval{
objc_setAssociatedObject(self, UIControl_acceptEventInterval, @(mew_acceptEventInterval), OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(self, UIControl_acceptEventInterval, @(mew_acceptEventInterval), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
} }
-(NSTimeInterval)mew_acceptEventInterval{ -(NSTimeInterval)mew_acceptEventInterval{

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/15. // Created by 触海 on 2023/11/15.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewHomePresenter : BaseMvpPresenter @interface MewHomePresenter : MewBaseMvpPresenter
- (void)mew_getNewFriendListWithGender:(NSString *)gender; - (void)mew_getNewFriendListWithGender:(NSString *)gender;

View File

@@ -21,10 +21,10 @@
/// Mew /// Mew
- (void)mew_getMewHomeFriendListWithGender:(NSString *)gender { - (void)mew_getMewHomeFriendListWithGender:(NSString *)gender {
[Api getMewHomeFriendListCompleted:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getMewHomeFriendListCompleted:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *array = [UserInfoModel mewModelsWithArray:data.data[@"randomList"]]; NSArray *array = [UserInfoModel mewModelsWithArray:data.data[@"randomList"]];
UserInfoModel *mineModel = [UserInfoModel mewModelWithDictionary:data.data[@"me"]]; UserInfoModel *mineModel = [UserInfoModel mewModelWithDictionary:data.data[@"me"]];
[[self getView] mew_getMewHomeFriendListSuccesss:array selfMine:mineModel]; [[self mew_getView] mew_getMewHomeFriendListSuccesss:array selfMine:mineModel];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
}] gender:gender]; }] gender:gender];
@@ -32,11 +32,11 @@
/// ///
- (void)mew_getNewFriendListWithGender:(NSString *)gender { - (void)mew_getNewFriendListWithGender:(NSString *)gender {
[Api getNewFriendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getNewFriendListComplection:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *array = [UserInfoModel mewModelsWithArray:data]; NSArray *array = [UserInfoModel mewModelsWithArray:data];
[[self getView] mew_getNewFriendListSuccess:array]; [[self mew_getView] mew_getNewFriendListSuccess:array];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] mew_getNewFriendListFail]; [[self mew_getView] mew_getNewFriendListFail];
}] gender:gender]; }] gender:gender];
} }
@@ -44,14 +44,14 @@
/// ///
- (void)mew_uploadVoice:(NSString *)filePath { - (void)mew_uploadVoice:(NSString *)filePath {
[Api qiniuUpLoadImage:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api qiniuUpLoadImage:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSString *key = data.data[@"key"]; NSString *key = data.data[@"key"];
NSString *token = data.data[@"token"]; NSString *token = data.data[@"token"];
[MEWUploadFile mewUploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull res) { [MEWUploadFile mewUploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull res) {
NSString *url = res[@"path"]; NSString *url = res[@"path"];
[[self getView] mew_uploadVoiceFileToThirdSuccess:url]; [[self mew_getView] mew_uploadVoiceFileToThirdSuccess:url];
} failure:^(NSNumber * _Nonnull code, NSString * _Nonnull message) { } failure:^(NSNumber * _Nonnull code, NSString * _Nonnull message) {
[[self getView] mew_uploadVoiceFileFail:message]; [[self mew_getView] mew_uploadVoiceFileFail:message];
}]; }];
@@ -89,9 +89,9 @@
/// ///
- (void)mew_getUserAttentionState:(NSString *)targetUid { - (void)mew_getUserAttentionState:(NSString *)targetUid {
NSString *uid = [[AccountInfoStorage instance] getUid]; NSString *uid = [[AccountInfoStorage instance] getUid];
[Api Mew_AttentionStatusCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_AttentionStatusCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
BOOL isLike = ((NSNumber *)data.data).boolValue; BOOL isLike = ((NSNumber *)data.data).boolValue;
[[self getView] mew_getUserAttentionSuccess:isLike]; [[self mew_getView] mew_getUserAttentionSuccess:isLike];
}] uid:uid isLikeUid:targetUid]; }] uid:uid isLikeUid:targetUid];
} }
@@ -99,9 +99,9 @@
/// ///
- (void)mew_getUserInfoWithUid:(NSString *)uid { - (void)mew_getUserInfoWithUid:(NSString *)uid {
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getUserInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data]; UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data];
[[self getView] mew_getUserInfoSuccess:userInfo]; [[self mew_getView] mew_getUserInfoSuccess:userInfo];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
}] uid:uid]; }] uid:uid];
@@ -109,9 +109,9 @@
/// ///
- (void)mew_getUserDetailInfoWithUid:(NSString *)uid { - (void)mew_getUserDetailInfoWithUid:(NSString *)uid {
[Api Mew_UserDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_UserDetailInfoCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel *infoModel = [UserInfoModel mewModelWithDictionary:data.data]; UserInfoModel *infoModel = [UserInfoModel mewModelWithDictionary:data.data];
[[self getView] mew_getUserDetailInfoSuccess:infoModel]; [[self mew_getView] mew_getUserDetailInfoSuccess:infoModel];
}] uid:uid page:@"1" pageSize:@"20"]; }] uid:uid page:@"1" pageSize:@"20"];
} }
@@ -123,11 +123,11 @@
NSString * uid= [AccountInfoStorage instance].getUid; NSString * uid= [AccountInfoStorage instance].getUid;
NSString * pageStr = [NSString stringWithFormat:@"%d", page]; NSString * pageStr = [NSString stringWithFormat:@"%d", page];
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize]; NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
[Api Mew_GetAttentionListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_GetAttentionListCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [UserInfoModel mewModelsWithArray:data.data]; NSArray * array = [UserInfoModel mewModelsWithArray:data.data];
[[self getView] mew_getUserAttentionListSuccess:array state:state]; [[self mew_getView] mew_getUserAttentionListSuccess:array state:state];
}fail:^(NSInteger code, NSString * _Nullable msg) { }fail:^(NSInteger code, NSString * _Nullable msg) {
// [[self getView] mew_getUserAttentionListFail:state]; // [[self mew_getView] mew_getUserAttentionListFail:state];
}] uid:uid pageNo:pageStr pageSize:pageSizeStr]; }] uid:uid pageNo:pageStr pageSize:pageSizeStr];
} }
@@ -135,8 +135,8 @@
/// ///
- (void)mewPublishVoiceShowDura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url { - (void)mewPublishVoiceShowDura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url {
[Api mewPublishVoiceShow:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api mewPublishVoiceShow:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mewPublishVoiceShowSuccess]; [[self mew_getView] mewPublishVoiceShowSuccess];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
@@ -148,8 +148,8 @@
NSString *uid = [[AccountInfoStorage instance] getUid]; NSString *uid = [[AccountInfoStorage instance] getUid];
NSString *ticket = [[AccountInfoStorage instance] getTicket]; NSString *ticket = [[AccountInfoStorage instance] getTicket];
NSString *type = state ? @"1" : @"2"; NSString *type = state ? @"1" : @"2";
[Api Mew_AttentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_AttentionCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_attentionUserSuccess:state]; [[self mew_getView] mew_attentionUserSuccess:state];
}] uid:uid likedUid:targetUid ticket:ticket type:type]; }] uid:uid likedUid:targetUid ticket:ticket type:type];
} }

View File

@@ -344,7 +344,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
} }
[AccountInfoStorage instance].MewThirdUserInfo = userInfo; [AccountInfoStorage instance].MewThirdUserInfo = userInfo;
[MewHUDTool showLoadingWithMessage:@"正在登录中"]; [MewHUDTool mew_showLoadingWithMessage:@"正在登录中"];
[self.presenter mew_thirdLoginWithApple:identityToken unionId:userID]; [self.presenter mew_thirdLoginWithApple:identityToken unionId:userID];
// [Api loginWithThirdPart:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) { // [Api loginWithThirdPart:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {

View File

@@ -206,7 +206,7 @@
- (MewLoginPasswordPresent *)present { - (MewLoginPasswordPresent *)present {
if (!_present) { if (!_present) {
_present = [[MewLoginPasswordPresent alloc] init]; _present = [[MewLoginPasswordPresent alloc] init];
[_present attatchView:self]; [_present mew_attatchView:self];
} }
return _present; return _present;
} }

View File

@@ -326,7 +326,7 @@
- (MewLoginVerifCodePresent *)present { - (MewLoginVerifCodePresent *)present {
if (!_present) { if (!_present) {
_present = [[MewLoginVerifCodePresent alloc] init]; _present = [[MewLoginVerifCodePresent alloc] init];
[_present attatchView:self]; [_present mew_attatchView:self];
} }
return _present; return _present;
} }

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/19. // Created by 触海 on 2023/11/19.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewPartyPresenter : BaseMvpPresenter @interface MewPartyPresenter : MewBaseMvpPresenter
- (void)mew_partyRecommendRoomList; - (void)mew_partyRecommendRoomList;
@end @end

View File

@@ -17,11 +17,11 @@
/// ///
- (void)mew_partyRecommendRoomList { - (void)mew_partyRecommendRoomList {
NSString *uid = [AccountInfoStorage instance].getUid; NSString *uid = [AccountInfoStorage instance].getUid;
[Api mew_partyRecommendRoomListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api mew_partyRecommendRoomListComplection:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [MewHomeRecommendRoomModel mewModelsWithArray:data.data]; NSArray * array = [MewHomeRecommendRoomModel mewModelsWithArray:data.data];
[[self getView] mew_partyRecommendRoomListSuccess:array]; [[self mew_getView] mew_partyRecommendRoomListSuccess:array];
}fail:^(NSInteger code, NSString * _Nullable msg) { }fail:^(NSInteger code, NSString * _Nullable msg) {
// [[self getView] getmew_partyRecommendRoomListFail:msg state:state]; // [[self mew_getView] getmew_partyRecommendRoomListFail:msg state:state];
}] uid:uid]; }] uid:uid];
} }

View File

@@ -133,7 +133,7 @@ NSString * const kCancelAccount = @"cancelAccount";
NSLog(@"%@",error); NSLog(@"%@",error);
}]; }];
} else if ([message.name isEqualToString:kJSGetDeviceInfo]) { } else if ([message.name isEqualToString:kJSGetDeviceInfo]) {
NSDictionary *basicParmars = [MewHttpRequestHelper configBaseParmars:[[NSDictionary alloc] init]]; NSDictionary *basicParmars = [MewHttpRequestHelper mew_configBaseParmars:[[NSDictionary alloc] init]];
NSString *json = [basicParmars mj_JSONString]; NSString *json = [basicParmars mj_JSONString];
NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceInfo\",%@)", json]; NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceInfo\",%@)", json];
[self.webview evaluateJavaScript:js completionHandler:^(id _Nullable ohter, NSError * _Nullable error) { [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable ohter, NSError * _Nullable error) {

View File

@@ -5,12 +5,12 @@
// Created by 触海 on 2023/11/6. // Created by 触海 on 2023/11/6.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
#import <NIMSDK/NIMSDK.h> #import <NIMSDK/NIMSDK.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MainPresenter : BaseMvpPresenter<NIMLoginManagerDelegate> @interface MainPresenter : MewBaseMvpPresenter<NIMLoginManagerDelegate>
/// 获取Ticket /// 获取Ticket
- (void)mew_autoLogin; - (void)mew_autoLogin;
/// IM登录 /// IM登录

View File

@@ -20,7 +20,7 @@
- (void)mew_autoLogin { - (void)mew_autoLogin {
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo]; AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
if (accountModel == nil || accountModel.uid == nil || accountModel.access_token == nil) { if (accountModel == nil || accountModel.uid == nil || accountModel.access_token == nil) {
[[self getView] mew_getTokenId]; [[self mew_getView] mew_getTokenId];
return; return;
} }
@@ -29,13 +29,13 @@
} }
// ticket // ticket
[Api mew_requestTicket:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api mew_requestTicket:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *tickets = [data.data valueForKey:@"tickets"]; NSArray *tickets = [data.data valueForKey:@"tickets"];
NSString *ticket = [tickets[0] valueForKey:@"ticket"]; NSString *ticket = [tickets[0] valueForKey:@"ticket"];
[[AccountInfoStorage instance] saveTicket:ticket]; [[AccountInfoStorage instance] saveTicket:ticket];
[[self getView] mew_autoLoginSuccess]; [[self mew_getView] mew_autoLoginSuccess];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[self logout]; [self mew_logout];
}] access_token:accountModel.access_token issue_type:@"multi"]; }] access_token:accountModel.access_token issue_type:@"multi"];
} }
@@ -43,7 +43,7 @@
- (void)mew_loginNIM { - (void)mew_loginNIM {
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo]; AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
if (accountModel == nil) { if (accountModel == nil) {
[[self getView] mew_getTokenId]; [[self mew_getView] mew_getTokenId];
return; return;
} }
@@ -64,15 +64,15 @@
/// ///
- (void)mew_getUserInfo { - (void)mew_getUserInfo {
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getUserInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]]; [[self mew_getView] mew_getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
}] uid:[[AccountInfoStorage instance] getUid]]; }] uid:[[AccountInfoStorage instance] getUid]];
} }
/// ///
- (void)checkTranscation { - (void)mew_checkTranscation {
NSString *uid = [AccountInfoStorage instance].getUid; NSString *uid = [AccountInfoStorage instance].getUid;
NSArray *array = [MEWRechargeStorage mewGetAllReciptsWithUid:uid]; NSArray *array = [MEWRechargeStorage mewGetAllReciptsWithUid:uid];
if (array == nil && array.count == 0) { if (array == nil && array.count == 0) {
@@ -80,7 +80,7 @@
} }
NSString *transcationIdStr = [array mewToJSONString]; NSString *transcationIdStr = [array mewToJSONString];
[Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api requestCheckTranscationIds:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
}] transcationIdStr:transcationIdStr]; }] transcationIdStr:transcationIdStr];

View File

@@ -21,7 +21,7 @@
#import "MewBaseNavigationController.h" #import "MewBaseNavigationController.h"
#import "MewBaseViewController.h" #import "MewBaseViewController.h"
#import "MewLoginViewController.h" #import "MewLoginViewController.h"
#import "LoginFullInfoViewController.h" #import "MewLoginFullInfoViewController.h"
#import "MewPartyViewController.h" #import "MewPartyViewController.h"
#import "MewSessionListViewController.h" #import "MewSessionListViewController.h"
#import "MewHomeViewController.h" #import "MewHomeViewController.h"
@@ -35,7 +35,7 @@
NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey"; NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
@interface MewTabBarController() < @interface MewTabBarController() <
BaseMvpProtocol, MainProtocol, MewBaseMvpProtocol, MainProtocol,
NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate, NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate,
NIMChatManagerDelegate,NIMBroadcastManagerDelegate> NIMChatManagerDelegate,NIMBroadcastManagerDelegate>
@@ -163,7 +163,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
} }
#pragma mark - BaseMvpProtocol #pragma mark - MewBaseMvpProtocol
// //
- (void)mew_getTokenId { - (void)mew_getTokenId {
MewLoginViewController *lvc = [[MewLoginViewController alloc] init]; MewLoginViewController *lvc = [[MewLoginViewController alloc] init];
@@ -175,7 +175,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
// //
- (void)mew_completeUserInfo { - (void)mew_completeUserInfo {
LoginFullInfoViewController * bindPhoneVC = [[LoginFullInfoViewController alloc] init]; MewLoginFullInfoViewController * bindPhoneVC = [[MewLoginFullInfoViewController alloc] init];
MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:bindPhoneVC]; MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:bindPhoneVC];
nav.modalPresentationStyle = UIModalPresentationFullScreen; nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self.navigationController presentViewController:nav animated:YES completion:nil]; [self.navigationController presentViewController:nav animated:YES completion:nil];
@@ -238,7 +238,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
- (MainPresenter *)presenter { - (MainPresenter *)presenter {
if (_presenter == nil) { if (_presenter == nil) {
_presenter = [[MainPresenter alloc] init]; _presenter = [[MainPresenter alloc] init];
[_presenter attatchView:self]; [_presenter mew_attatchView:self];
} }
return _presenter; return _presenter;
} }

View File

@@ -9,27 +9,27 @@
#import "NewEncryptTool.h" #import "NewEncryptTool.h"
@implementation Api (Login) @implementation Api (Login)
/// ///
+ (void)Mew_PhoneQuickLogin:(HttpRequestHelperCompletion)completion accessToken:(NSString *)accessToken token:(NSString *)token { + (void)Mew_PhoneQuickLogin:(MewHttpRequestHelperCompletion)completion accessToken:(NSString *)accessToken token:(NSString *)token {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"5OuUEI/lxBioS84/A1+LB6USUuyY1yofu3VeNn4bGRA="];///acc/oneclick/login NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"5OuUEI/lxBioS84/A1+LB6USUuyY1yofu3VeNn4bGRA="];///acc/oneclick/login
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, token, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, token, nil];
} }
/// ///
/// @param completion /// @param completion
/// @param phone /// @param phone
/// @param code /// @param code
+ (void)Mew_LoginWithCode:(HttpRequestHelperCompletion)completion phone:(NSString *)phone code:(NSString *)code client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type { + (void)Mew_LoginWithCode:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone code:(NSString *)code client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"QFgInRYQSkXdbIyvBsVUvA=="];////oauth/token NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"QFgInRYQSkXdbIyvBsVUvA=="];////oauth/token
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,code,client_secret,version, client_id, grant_type, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,code,client_secret,version, client_id, grant_type, nil];
} }
/// ///
/// @param completion /// @param completion
/// @param phone /// @param phone
/// @param password /// @param password
+ (void)Mew_LoginWithPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone password:(NSString *)password client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type { + (void)Mew_LoginWithPassword:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone password:(NSString *)password client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"QFgInRYQSkXdbIyvBsVUvA=="];///oauth/token NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"QFgInRYQSkXdbIyvBsVUvA=="];///oauth/token
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,password,client_secret,version, client_id, grant_type, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,password,client_secret,version, client_id, grant_type, nil];
} }
/// ///
@@ -37,9 +37,9 @@
/// @param phone /// @param phone
/// @param newPwd /// @param newPwd
/// @param smsCode /// @param smsCode
+ (void)Mew_ResetPasswordWithPhone:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode { + (void)Mew_ResetPasswordWithPhone:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"ZstXKg9XrXuRUPW6jNgkzQ=="];///acc/pwd/reset NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"ZstXKg9XrXuRUPW6jNgkzQ=="];///acc/pwd/reset
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, smsCode, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, smsCode, nil];
} }
@@ -49,16 +49,16 @@
/// @param unionid unionid /// @param unionid unionid
/// @param access_token access_token /// @param access_token access_token
/// @param type /// @param type
+ (void)Mew_LoginWithThirdPart:(HttpRequestHelperCompletion)completion openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type { + (void)Mew_LoginWithThirdPart:(MewHttpRequestHelperCompletion)completion openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"jenVNOO6MbwSC77wnPIMng=="];///acc/third/login NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"jenVNOO6MbwSC77wnPIMng=="];///acc/third/login
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, openid, unionid, access_token, type, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, openid, unionid, access_token, type, nil];
} }
/// ///
/// @param completion /// @param completion
+ (void)Mew_RandomNick:(HttpRequestHelperCompletion)completion { + (void)Mew_RandomNick:(MewHttpRequestHelperCompletion)completion {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"7oWMT+wxmM3FF/aCDKLrRw=="];////random/nick/get NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"7oWMT+wxmM3FF/aCDKLrRw=="];////random/nick/get
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil];
} }
/// ///
@@ -66,12 +66,12 @@
/// @param phone /// @param phone
/// @param code /// @param code
/// @param ticket ticket /// @param ticket ticket
+ (void)Mew_BindMoblieCode:(HttpRequestHelperCompletion)complection + (void)Mew_BindMoblieCode:(MewHttpRequestHelperCompletion)complection
phone:(NSString *)phone phone:(NSString *)phone
code:(NSString *)code code:(NSString *)code
ticket:(NSString *)ticket { ticket:(NSString *)ticket {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"l+R2IRWIqi9yPiDc6rg+jg=="];///withDraw/phone NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"l+R2IRWIqi9yPiDc6rg+jg=="];///withDraw/phone
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, phone, code, ticket, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:complection, __FUNCTION__, phone, code, ticket, nil];
} }
@end @end

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/22. // Created by 触海 on 2023/11/22.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewLoginBindPhonePresent : BaseMvpPresenter @interface MewLoginBindPhonePresent : MewBaseMvpPresenter
@end @end

View File

@@ -8,8 +8,8 @@
#import "MewLoginBindPhonePresent.h" #import "MewLoginBindPhonePresent.h"
@implementation MewLoginBindPhonePresent @implementation MewLoginBindPhonePresent
- (id<BaseMvpProtocol>)getView { - (id<MewBaseMvpProtocol>)mew_getView {
return ((id<BaseMvpProtocol>) [super getView]); return ((id<MewBaseMvpProtocol>) [super mew_getView]);
} }
@end @end

View File

@@ -5,12 +5,12 @@
// Created by 触海 on 2023/11/9. // Created by 触海 on 2023/11/9.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
#import "MewEnum.h" #import "MewEnum.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewLoginForgetPasswordPresent : BaseMvpPresenter @interface MewLoginForgetPasswordPresent : MewBaseMvpPresenter
/// 获取手机的验证码 /// 获取手机的验证码
/// @param phone 手机号 /// @param phone 手机号
/// @param type 类型 /// @param type 类型

View File

@@ -5,20 +5,20 @@
// Created by on 2023/11/9. // Created by on 2023/11/9.
// //
#import "LoginForgetPasswordPresent.h" #import "MewLoginForgetPasswordPresent.h"
///Tool ///Tool
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "DESEncrypt.h" #import "DESEncrypt.h"
#import "MewConstant.h" #import "MewConstant.h"
///Protocol ///Protocol
#import "LoginForgetPasswordProtocol.h" #import "MewLoginForgetPasswordProtocol.h"
///Api ///Api
#import "Api+Login.h" #import "Api+Login.h"
@implementation LoginForgetPasswordPresent @implementation MewLoginForgetPasswordPresent
- (id<LoginForgetPasswordProtocol>)getView { - (id<MewLoginForgetPasswordProtocol>)mew_getView {
return (id<LoginForgetPasswordProtocol>)[super getView]; return (id<MewLoginForgetPasswordProtocol>)[super mew_getView];
} }
/// ///
@@ -26,8 +26,8 @@
/// @param type /// @param type
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type { - (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) { [Api mew_phoneSmsCode:[self mew_createHttpCompletion:^(id _Nonnull data) {
[[self getView] mew_phoneSmsCodeSuccess]; [[self mew_getView] mew_phoneSmsCodeSuccess];
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]]; }] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
} }
@@ -38,8 +38,8 @@
- (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode { - (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api resetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_ResetPasswordWithPhone:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] resetPasswrodSuccess]; [[self mew_getView] mew_resetPasswrodSuccess];
} mew_showLoading:YES] phone:desPhone newPwd:desPassword smsCode:smsCode]; } mew_showLoading:YES] phone:desPhone newPwd:desPassword smsCode:smsCode];
} }

View File

@@ -5,12 +5,12 @@
// Created by 触海 on 2023/11/6. // Created by 触海 on 2023/11/6.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
@class MewThirdUserInfo; @class MewThirdUserInfo;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewLoginFullInfoPresenter : BaseMvpPresenter @interface MewLoginFullInfoPresenter : MewBaseMvpPresenter
/// 获取保存的第三方的数据模型 /// 获取保存的第三方的数据模型
- (MewThirdUserInfo *)mew_getMewThirdUserInfo; - (MewThirdUserInfo *)mew_getMewThirdUserInfo;

View File

@@ -5,36 +5,36 @@
// Created by on 2023/11/6. // Created by on 2023/11/6.
// //
#import "LoginFullInfoPresenter.h" #import "MewLoginFullInfoPresenter.h"
#import "Api+Login.h" #import "Api+Login.h"
///Tool ///Tool
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "NSMutableDictionary+MEWSafe.h" #import "NSMutableDictionary+MEWSafe.h"
///Api ///Api
#import "LoginFullInfoProtocol.h" #import "MewLoginFullInfoProtocol.h"
///Model ///Model
#import "ThirdUserInfo.h" #import "MewThirdUserInfo.h"
@implementation LoginFullInfoPresenter @implementation MewLoginFullInfoPresenter
#pragma mark - Super #pragma mark - Super
- (id<LoginFullInfoProtocol>)getView { - (id<MewLoginFullInfoProtocol>)mew_getView {
return (id<LoginFullInfoProtocol>)[super getView]; return (id<MewLoginFullInfoProtocol>)[super mew_getView];
} }
#pragma mark - Public Method #pragma mark - Public Method
/// ///
- (ThirdUserInfo *)getThirdUserInfo { - (MewThirdUserInfo *)getThirdUserInfo {
if ([AccountInfoStorage instance].thirdUserInfo) { if ([AccountInfoStorage instance].MewThirdUserInfo) {
return [AccountInfoStorage instance].thirdUserInfo; return [AccountInfoStorage instance].MewThirdUserInfo;
} }
return nil; return nil;
} }
/// ///
- (void)randomRequestNick { - (void)randomRequestNick {
[Api randomNick:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_RandomNick:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] requestRandomNickSuccess:data.data]; [[self mew_getView] mew_requestRandomNickSuccess:data.data];
}]]; }]];
} }
@@ -77,8 +77,8 @@
[params mewSafeSetObject:shareChannel forKey:@"shareChannel"]; [params mewSafeSetObject:shareChannel forKey:@"shareChannel"];
} }
[Api mew_completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api mew_completeUserInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] complementInfoSuccess]; [[self mew_getView] mew_complementInfoSuccess];
}] userInfo:params]; }] userInfo:params];
} }

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/8. // Created by 触海 on 2023/11/8.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewLoginPasswordPresent : BaseMvpPresenter @interface MewLoginPasswordPresent : MewBaseMvpPresenter
/// 使用手机号和密码登录 /// 使用手机号和密码登录
/// @param phone 手机号 /// @param phone 手机号

View File

@@ -17,22 +17,22 @@
#import "MewLoginPasswordProtocol.h" #import "MewLoginPasswordProtocol.h"
@implementation MewLoginPasswordPresent @implementation MewLoginPasswordPresent
- (id<MewLoginPasswordProtocol>)getView { - (id<MewLoginPasswordProtocol>)mew_getView {
return (id<MewLoginPasswordProtocol>)[super getView]; return (id<MewLoginPasswordProtocol>)[super mew_getView];
} }
/// ///
- (void)mew_loginWithPhone:(NSString *)phone password:(NSString *)password { - (void)mew_loginWithPhone:(NSString *)phone password:(NSString *)password {
NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api Mew_LoginWithPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_LoginWithPassword:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
AccountModel *model = [AccountModel mewModelWithDictionary:data.data]; AccountModel *model = [AccountModel mewModelWithDictionary:data.data];
if (model && model.access_token.length > 0){ if (model && model.access_token.length > 0){
[[AccountInfoStorage instance] saveAccountInfo:model]; [[AccountInfoStorage instance] saveAccountInfo:model];
} }
[[self getView] mew_phoneAndPasswordLoginSuccess]; [[self mew_getView] mew_phoneAndPasswordLoginSuccess];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] mew_phoneAndPasswordLoginFail:msg]; [[self mew_getView] mew_phoneAndPasswordLoginFail:msg];
} mew_showLoading:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"]; } mew_showLoading:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
} }
@end @end

View File

@@ -5,12 +5,12 @@
// Created by 触海 on 2023/11/6. // Created by 触海 on 2023/11/6.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
#import "YMEnum.h" #import "MewEnum.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewLoginPresenter : BaseMvpPresenter @interface MewLoginPresenter : MewBaseMvpPresenter
/// 一键登录 /// 一键登录
- (void)mew_phoneQuickLogin:(NSString *)accessToken token:(NSString*) token; - (void)mew_phoneQuickLogin:(NSString *)accessToken token:(NSString*) token;

View File

@@ -17,25 +17,25 @@
@implementation MewLoginPresenter @implementation MewLoginPresenter
#pragma mark - Super #pragma mark - Super
- (id<MewLoginProtocol>)getView { - (id<MewLoginProtocol>)mew_getView {
return (id<MewLoginProtocol>)[super getView]; return (id<MewLoginProtocol>)[super mew_getView];
} }
#pragma mark - Public Method #pragma mark - Public Method
/// ///
- (void)Mew_PhoneQuickLogin:(NSString *)accessToken token:(NSString *)token { - (void)Mew_PhoneQuickLogin:(NSString *)accessToken token:(NSString *)token {
[Api Mew_PhoneQuickLogin:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_PhoneQuickLogin:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
}] accessToken:accessToken token:token]; }] accessToken:accessToken token:token];
} }
- (void)mew_thirdLoginWithApple:(NSString *)token unionId:(NSString *)unionId { - (void)mew_thirdLoginWithApple:(NSString *)token unionId:(NSString *)unionId {
[Api Mew_LoginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_LoginWithThirdPart:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
AccountModel *model = [AccountModel mewModelWithDictionary:data.data]; AccountModel *model = [AccountModel mewModelWithDictionary:data.data];
if (model != nil) { if (model != nil) {
[[AccountInfoStorage instance] saveAccountInfo:model]; [[AccountInfoStorage instance] saveAccountInfo:model];
[[self getView] mew_loginSuccess]; [[self mew_getView] mew_loginSuccess];
} }
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {

View File

@@ -22,9 +22,9 @@
- (void)mew_phoneSmsCode:(NSString *)phone type:(GetSmsType)type { - (void)mew_phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type]; NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api mew_phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api mew_phoneSmsCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_phoneSmsCodeSuccess]; [[self mew_getView] mew_phoneSmsCodeSuccess];
}] mobile:desPhone type:typeStr]; }] mobile:desPhone type:typeStr];
} }
@@ -36,8 +36,8 @@
NSString * uid = [[AccountInfoStorage instance] getUid]; NSString * uid = [[AccountInfoStorage instance] getUid];
NSString * ticket = [[AccountInfoStorage instance] getTicket]; NSString * ticket = [[AccountInfoStorage instance] getTicket];
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)];
// [Api checkMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { // [Api checkMoblieCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
// [[self getView] mew_checkMoblieCodeWithMoblieSuccess]; // [[self mew_getView] mew_checkMoblieCodeWithMoblieSuccess];
// }] mobile:desPhone code:code uid:uid ticket:ticket]; // }] mobile:desPhone code:code uid:uid ticket:ticket];
} }
@@ -47,8 +47,8 @@
- (void)mew_bindkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code { - (void)mew_bindkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code {
NSString * ticket = [[AccountInfoStorage instance] getTicket]; NSString * ticket = [[AccountInfoStorage instance] getTicket];
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)];
[Api Mew_BindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_BindMoblieCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_bindMoblieCodeWithMoblieSuccess]; [[self mew_getView] mew_bindMoblieCodeWithMoblieSuccess];
}] phone:desPhone code:code ticket:ticket]; }] phone:desPhone code:code ticket:ticket];
} }
@end @end

View File

@@ -5,12 +5,12 @@
// Created by 触海 on 2023/11/8. // Created by 触海 on 2023/11/8.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
#import "MewEnum.h" #import "MewEnum.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewLoginVerifCodePresent : BaseMvpPresenter @interface MewLoginVerifCodePresent : MewBaseMvpPresenter
/// 获取手机的验证码 /// 获取手机的验证码
/// @param phone 手机号 /// @param phone 手机号

View File

@@ -20,8 +20,8 @@
@implementation MewLoginVerifCodePresent @implementation MewLoginVerifCodePresent
#pragma mark - Super #pragma mark - Super
- (id)getView { - (id)mew_getView {
return (id<MewLoginVerifCodeProtocol>)[super getView]; return (id<MewLoginVerifCodeProtocol>)[super mew_getView];
} }
/// ///
@@ -30,8 +30,8 @@
- (void)mew_phoneSmsCode:(NSString *)phone type:(GetSmsType)type { - (void)mew_phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api mew_phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api mew_phoneSmsCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_phoneSmsCodeSuccess]; [[self mew_getView] mew_phoneSmsCodeSuccess];
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]]; }] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
} }
@@ -40,13 +40,13 @@
/// @param code /// @param code
- (void)mew_loginWithPhone:(NSString *)phone code:(NSString *)code { - (void)mew_loginWithPhone:(NSString *)phone code:(NSString *)code {
NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api Mew_LoginWithCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_LoginWithCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
AccountModel *accountModel = [AccountModel mewModelWithDictionary:data.data]; AccountModel *accountModel = [AccountModel mewModelWithDictionary:data.data];
if (accountModel && accountModel.access_token.length > 0) { if (accountModel && accountModel.access_token.length > 0) {
[[AccountInfoStorage instance] saveAccountInfo:accountModel]; [[AccountInfoStorage instance] saveAccountInfo:accountModel];
} }
[[self getView] mew_loginWithPhoneSuccess]; [[self mew_getView] mew_loginWithPhoneSuccess];
} mew_showLoading:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"]; } mew_showLoading:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
} }
@@ -57,8 +57,8 @@
- (void)mew_bindWithPhone:(NSString *)phone code:(NSString *)code { - (void)mew_bindWithPhone:(NSString *)phone code:(NSString *)code {
NSString *ticket = [[AccountInfoStorage instance] getTicket]; NSString *ticket = [[AccountInfoStorage instance] getTicket];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api Mew_BindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_BindMoblieCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_bindWithPhoneSuccess]; [[self mew_getView] mew_bindWithPhoneSuccess];
} mew_showLoading:YES] phone:desPhone code:code ticket:ticket]; } mew_showLoading:YES] phone:desPhone code:code ticket:ticket];
} }

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/22. // Created by 触海 on 2023/11/22.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MineLoginPasswordPresenter : BaseMvpPresenter @interface MineLoginPasswordPresenter : MewBaseMvpPresenter
/// 设置登录密码 /// 设置登录密码
/// @param phone 手机号 /// @param phone 手机号
/// @param newPwd 密码 /// @param newPwd 密码

View File

@@ -21,8 +21,8 @@
NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)]; NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api Mew_SetLoingPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_SetLoingPassword:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] setLoginPasswordSuccess]; [[self mew_getView] mew_setLoginPasswordSuccess];
} mew_showLoading:YES] phone:desPhone newPwd:desNewPwd]; } mew_showLoading:YES] phone:desPhone newPwd:desNewPwd];
} }
@@ -36,8 +36,8 @@
NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)]; NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
NSString * desPwd = [DESEncrypt encryptUseDES:pwd key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPwd = [DESEncrypt encryptUseDES:pwd key:KeyWithType(KeyType_PasswordEncode)];
[Api Mew_ModifyLoingPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_ModifyLoingPassword:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_modifyLoginPasswordSuccess]; [[self mew_getView] mew_modifyLoginPasswordSuccess];
}] phone:desPhone newPwd:desNewPwd pwd:desPwd]; }] phone:desPhone newPwd:desNewPwd pwd:desPwd];
} }

View File

@@ -5,7 +5,7 @@
// Created by on 2023/11/22. // Created by on 2023/11/22.
// //
#import "LoginBindPhoneViewController.h" #import "MewLoginBindPhoneViewController.h"
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <ReactiveObjC/ReactiveObjC.h> #import <ReactiveObjC/ReactiveObjC.h>
@@ -15,11 +15,11 @@
//#import "NSString+Utils.h" //#import "NSString+Utils.h"
///Tool ///Tool
#import "LoginBindPhonePresent.h" #import "MewLoginBindPhonePresent.h"
///VC ///VC
//#import "LoginVerifCodeViewController.h" //#import "LoginVerifCodeViewController.h"
@interface LoginBindPhoneViewController () @interface MewLoginBindPhoneViewController ()
///Label ///Label
@property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *titleLabel;
/// ///
@@ -34,13 +34,13 @@
@property (nonatomic,strong) UIButton *backButton; @property (nonatomic,strong) UIButton *backButton;
@end @end
@implementation LoginBindPhoneViewController @implementation MewLoginBindPhoneViewController
- (BOOL)mew_isHiddenNavBar { - (BOOL)mew_isHiddenNavBar {
return YES; return YES;
} }
#pragma mark - life cycle #pragma mark - life cycle
- (LoginBindPhonePresent *)createPresenter { - (MewLoginBindPhonePresent *)createPresenter {
return [[LoginBindPhonePresent alloc] init]; return [[MewLoginBindPhonePresent alloc] init];
} }
- (void)viewDidLoad { - (void)viewDidLoad {
@@ -148,7 +148,7 @@
- (void)mew_backButtonAction:(UIButton *)sender { - (void)mew_backButtonAction:(UIButton *)sender {
///退 ///退
[self dismissViewControllerAnimated:NO completion:^{ [self dismissViewControllerAnimated:NO completion:^{
[self.presenter logout]; [self.presenter mew_logout];
}]; }];
} }

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/16. // Created by 触海 on 2023/11/16.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewMessagePresenter : BaseMvpPresenter @interface MewMessagePresenter : MewBaseMvpPresenter
- (void)mew_getChatLimitReceiverUid:(NSString *)receiverUid; - (void)mew_getChatLimitReceiverUid:(NSString *)receiverUid;
/// 获取用户信息 /// 获取用户信息

View File

@@ -17,29 +17,29 @@
@implementation MewMessagePresenter @implementation MewMessagePresenter
- (void)mew_getChatLimitReceiverUid:(NSString *)receiverUid { - (void)mew_getChatLimitReceiverUid:(NSString *)receiverUid {
[Api Mew_GetChatLimit:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_GetChatLimit:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
MewChatLimitModel *chatLimit = [MewChatLimitModel mewModelWithJSON:data.data]; MewChatLimitModel *chatLimit = [MewChatLimitModel mewModelWithJSON:data.data];
[[self getView] mew_onGetLimitChat:chatLimit]; [[self mew_getView] mew_onGetLimitChat:chatLimit];
} mew_showLoading:NO errorToast:NO] receiverUid:receiverUid]; } mew_showLoading:NO errorToast:NO] receiverUid:receiverUid];
} }
/// ///
/// @param uid uid /// @param uid uid
- (void)mew_getMessageUserInfo:(NSString *)uid { - (void)mew_getMessageUserInfo:(NSString *)uid {
[Api Mew_UserDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_UserDetailInfoCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel * infoModel = [UserInfoModel mewModelWithDictionary:data.data]; UserInfoModel * infoModel = [UserInfoModel mewModelWithDictionary:data.data];
[[self getView] mew_onGetSessionUserInfoSuccess:infoModel]; [[self mew_getView] mew_onGetSessionUserInfoSuccess:infoModel];
}fail:^(NSInteger code, NSString * _Nullable msg) { }fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]mew_onGetSessionUserInfoFail]; [[self mew_getView]mew_onGetSessionUserInfoFail];
}] uid:uid page:@"1" pageSize:@"20"]; }] uid:uid page:@"1" pageSize:@"20"];
} }
/// ///
- (void)mew_getFansLike:(NSString *)likeUid { - (void)mew_getFansLike:(NSString *)likeUid {
NSString * uid = [AccountInfoStorage instance].getUid; NSString * uid = [AccountInfoStorage instance].getUid;
[Api Mew_AttentionStatusCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_AttentionStatusCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
BOOL isLike = [data.data boolValue]; BOOL isLike = [data.data boolValue];
[[self getView] mew_getFansLikeSuccess:isLike]; [[self mew_getView] mew_getFansLikeSuccess:isLike];
}] uid:uid isLikeUid:likeUid]; }] uid:uid isLikeUid:likeUid];
} }
@@ -49,8 +49,8 @@
NSString * uid = [[AccountInfoStorage instance] getUid]; NSString * uid = [[AccountInfoStorage instance] getUid];
NSString * ticket = [[AccountInfoStorage instance] getTicket]; NSString * ticket = [[AccountInfoStorage instance] getTicket];
NSString * type = @"1"; NSString * type = @"1";
[Api Mew_AttentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_AttentionCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_attentionUserSuccess:targetUid]; [[self mew_getView] mew_attentionUserSuccess:targetUid];
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil]; [[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
} mew_showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type]; } mew_showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type];
} }

View File

@@ -16,19 +16,19 @@ NS_ASSUME_NONNULL_BEGIN
/// @param page 当前页数 /// @param page 当前页数
/// @param pageSize 一页多少个 /// @param pageSize 一页多少个
/// @param roomType 类型4个播房其他派对房不传所有房间 /// @param roomType 类型4个播房其他派对房不传所有房间
+ (void)Mew_RequestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType; + (void)Mew_RequestMineCollectRoomList:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType;
/// 退出当前账号 /// 退出当前账号
/// @param completion 完成 /// @param completion 完成
/// @param access_token token /// @param access_token token
+ (void)Mew_LogoutCurrentAccount:(HttpRequestHelperCompletion)completion access_token:(NSString *)access_token; + (void)Mew_LogoutCurrentAccount:(MewHttpRequestHelperCompletion)completion access_token:(NSString *)access_token;
/// 获取用户详情 /// 获取用户详情
/// @param completion 完成 /// @param completion 完成
/// @param uid 发起关注的人 /// @param uid 发起关注的人
/// @param page page /// @param page page
/// @param pageSize pagesize /// @param pageSize pagesize
+ (void)Mew_UserDetailInfoCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize; + (void)Mew_UserDetailInfoCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize;
/// 关注某人 /// 关注某人
/// @param completion 完成 /// @param completion 完成
@@ -36,13 +36,13 @@ NS_ASSUME_NONNULL_BEGIN
/// @param likedUid 被关注的人 /// @param likedUid 被关注的人
/// @param ticket ticket /// @param ticket ticket
/// @param type 1 关注 2取消关注 /// @param type 1 关注 2取消关注
+ (void)Mew_AttentionCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type; + (void)Mew_AttentionCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type;
/// 查询两个人的关注状态 /// 查询两个人的关注状态
/// @param completion 完成 /// @param completion 完成
/// @param uid 自己的uid /// @param uid 自己的uid
/// @param isLikeUid 要查询的那个人的uid /// @param isLikeUid 要查询的那个人的uid
+ (void)Mew_AttentionStatusCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid; + (void)Mew_AttentionStatusCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid;
/// 获取关注列表 /// 获取关注列表
@@ -50,13 +50,13 @@ NS_ASSUME_NONNULL_BEGIN
/// @param uid 用户的uid /// @param uid 用户的uid
/// @param pageNo 当前页数 /// @param pageNo 当前页数
/// @param pageSize 一页多少个 /// @param pageSize 一页多少个
+ (void)Mew_GetAttentionListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize; + (void)Mew_GetAttentionListCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize;
/// 请求充值列表 /// 请求充值列表
/// @param complection 完成 /// @param complection 完成
/// @param channelType channel /// @param channelType channel
+ (void)Mew_GetRechargeList:(HttpRequestHelperCompletion)complection + (void)Mew_GetRechargeList:(MewHttpRequestHelperCompletion)complection
channelType:(NSString *)channelType; channelType:(NSString *)channelType;
/// 苹果下单 /// 苹果下单
@@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param ticket ticket /// @param ticket ticket
/// @param deviceInfo uuid /// @param deviceInfo uuid
/// @param clientIp ip地址 /// @param clientIp ip地址
+ (void)Mew_RequestIAPRecharge:(HttpRequestHelperCompletion)complection + (void)Mew_RequestIAPRecharge:(MewHttpRequestHelperCompletion)complection
chargeProdId:(NSString *)chargeProdId chargeProdId:(NSString *)chargeProdId
uid:(NSString *)uid uid:(NSString *)uid
ticket:(NSString *)ticket ticket:(NSString *)ticket
@@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param transcationId 内购的唯一标识符 /// @param transcationId 内购的唯一标识符
/// @param uid 用户uid /// @param uid 用户uid
/// @param ticket ticket /// @param ticket ticket
+ (void)Mew_CheckReceipt:(HttpRequestHelperCompletion)complection + (void)Mew_CheckReceipt:(MewHttpRequestHelperCompletion)complection
receipt:(NSString *)receipt receipt:(NSString *)receipt
chooseEnv:(NSString *)chooseEnv chooseEnv:(NSString *)chooseEnv
chargeRecordId:(NSString *)chargeRecordId chargeRecordId:(NSString *)chargeRecordId
@@ -96,21 +96,21 @@ NS_ASSUME_NONNULL_BEGIN
/// @param transcationId 内购的唯一标识符 /// @param transcationId 内购的唯一标识符
/// @param uid 用户uid /// @param uid 用户uid
/// @param ticket ticket /// @param ticket ticket
+ (void)Mew_CheckReceipt:(HttpRequestHelperCompletion)completion chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket; + (void)Mew_CheckReceipt:(MewHttpRequestHelperCompletion)completion chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket;
/// 设置登录密码 /// 设置登录密码
/// @param completion 完成 /// @param completion 完成
/// @param phone 手机号 /// @param phone 手机号
/// @param newPwd 新的密码 /// @param newPwd 新的密码
+ (void)Mew_SetLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd; + (void)Mew_SetLoingPassword:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd;
/// 修改 登录密码 /// 修改 登录密码
/// @param completion 完成 /// @param completion 完成
/// @param phone 手机号 /// @param phone 手机号
/// @param newPwd 新的密码 /// @param newPwd 新的密码
/// @param pwd 旧密码 /// @param pwd 旧密码
+ (void)Mew_ModifyLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd; + (void)Mew_ModifyLoingPassword:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd;
@end @end

View File

@@ -15,17 +15,17 @@
/// @param page /// @param page
/// @param pageSize /// @param pageSize
/// @param roomType 4 /// @param roomType 4
+ (void)Mew_RequestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType { + (void)Mew_RequestMineCollectRoomList:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"xbrIaF3tjG37mRyRC97ZrffhHg2YaksxPephr1wGtYI="];//fans/fansRoomList NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"xbrIaF3tjG37mRyRC97ZrffhHg2YaksxPephr1wGtYI="];//fans/fansRoomList
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize, roomType, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize, roomType, nil];
} }
/// 退 /// 退
/// @param completion /// @param completion
/// @param access_token token /// @param access_token token
+ (void)Mew_LogoutCurrentAccount:(HttpRequestHelperCompletion)completion access_token:(NSString *)access_token { + (void)Mew_LogoutCurrentAccount:(MewHttpRequestHelperCompletion)completion access_token:(NSString *)access_token {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"73cfDtRGGthZvJUN7DktoA=="];///acc/logout NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"73cfDtRGGthZvJUN7DktoA=="];///acc/logout
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, access_token, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, access_token, nil];
} }
@@ -34,9 +34,9 @@
/// @param uid /// @param uid
/// @param page page /// @param page page
/// @param pageSize pagesize /// @param pageSize pagesize
+ (void)Mew_UserDetailInfoCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize { + (void)Mew_UserDetailInfoCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"W7uzbHnGUU1RiDHmTvViGQ=="];///user/detail/get NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"W7uzbHnGUU1RiDHmTvViGQ=="];///user/detail/get
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, page, pageSize, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, page, pageSize, nil];
} }
@@ -46,18 +46,18 @@
/// @param likedUid /// @param likedUid
/// @param ticket ticket /// @param ticket ticket
/// @param type 1 2 /// @param type 1 2
+ (void)Mew_AttentionCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type { + (void)Mew_AttentionCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"atxkzRc+U9YS4UOIpECXlw=="];///fans/like NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"atxkzRc+U9YS4UOIpECXlw=="];///fans/like
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, likedUid, ticket, type, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, likedUid, ticket, type, nil];
} }
/// ///
/// @param completion /// @param completion
/// @param uid uid /// @param uid uid
/// @param isLikeUid uid /// @param isLikeUid uid
+ (void)Mew_AttentionStatusCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid { + (void)Mew_AttentionStatusCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"2D8AkLpUg8cU9aQTxO+Mmw=="];///fans/islike NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"2D8AkLpUg8cU9aQTxO+Mmw=="];///fans/islike
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, uid, isLikeUid, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion,__FUNCTION__, uid, isLikeUid, nil];
} }
/// ///
@@ -65,9 +65,9 @@
/// @param uid uid /// @param uid uid
/// @param pageNo /// @param pageNo
/// @param pageSize /// @param pageSize
+ (void)Mew_GetAttentionListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize { + (void)Mew_GetAttentionListCompletion:(MewHttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"INF19c+8RN4ef4v8DIWwJQ=="];///fans/following NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"INF19c+8RN4ef4v8DIWwJQ=="];///fans/following
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, pageNo, pageSize, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, pageNo, pageSize, nil];
} }
@@ -75,9 +75,9 @@
/// ///
/// @param completion /// @param completion
/// @param channelType channel /// @param channelType channel
+ (void)Mew_GetRechargeList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType { + (void)Mew_GetRechargeList:(MewHttpRequestHelperCompletion)completion channelType:(NSString *)channelType {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"tJGng+8YSnwgwk5S0i5New=="];////chargeprod/list NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"tJGng+8YSnwgwk5S0i5New=="];////chargeprod/list
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,channelType, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodGET completion:completion, __FUNCTION__,channelType, nil];
} }
/// ///
@@ -87,9 +87,9 @@
/// @param ticket ticket /// @param ticket ticket
/// @param deviceInfo uuid /// @param deviceInfo uuid
/// @param clientIp ip /// @param clientIp ip
+ (void)Mew_RequestIAPRecharge:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId uid:(NSString *)uid ticket:(NSString *)ticket deviceInfo:(NSString *)deviceInfo clientIp:(NSString *)clientIp { + (void)Mew_RequestIAPRecharge:(MewHttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId uid:(NSString *)uid ticket:(NSString *)ticket deviceInfo:(NSString *)deviceInfo clientIp:(NSString *)clientIp {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"bwrNIwSuCtX9ebT29xed93rJaaaSsuxrTFso6OAppms="];//storeKitV/placeOrder NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"bwrNIwSuCtX9ebT29xed93rJaaaSsuxrTFso6OAppms="];//storeKitV/placeOrder
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,chargeProdId, uid, ticket, deviceInfo, clientIp, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__,chargeProdId, uid, ticket, deviceInfo, clientIp, nil];
} }
@@ -101,9 +101,9 @@
/// @param transcationId /// @param transcationId
/// @param uid uid /// @param uid uid
/// @param ticket ticket /// @param ticket ticket
+ (void)Mew_CheckReceipt:(HttpRequestHelperCompletion)completion receipt:(NSString *)receipt chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket { + (void)Mew_CheckReceipt:(MewHttpRequestHelperCompletion)completion receipt:(NSString *)receipt chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"/sdsv2QZR4mbqOhGOocSTQ=="];////verify/setiap NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"/sdsv2QZR4mbqOhGOocSTQ=="];////verify/setiap
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,receipt, chooseEnv, chargeRecordId, transcationId, uid, ticket, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__,receipt, chooseEnv, chargeRecordId, transcationId, uid, ticket, nil];
} }
/// ///
/// @param completion /// @param completion
@@ -112,17 +112,17 @@
/// @param transcationId /// @param transcationId
/// @param uid uid /// @param uid uid
/// @param ticket ticket /// @param ticket ticket
+ (void)Mew_CheckReceipt:(HttpRequestHelperCompletion)completion chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket { + (void)Mew_CheckReceipt:(MewHttpRequestHelperCompletion)completion chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket {
NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"10iACYRNJ/Q7R019Q4DRNFPf0nODacTzggh6x9bvmOw="];//storeKitV2/verifyOrder NSString *getUrl = [NewEncryptTool MEW_aesDecrypt:@"10iACYRNJ/Q7R019Q4DRNFPf0nODacTzggh6x9bvmOw="];//storeKitV2/verifyOrder
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, chooseEnv, chargeRecordId, transcationId, uid, ticket, nil]; [self makeRequest:getUrl method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, chooseEnv, chargeRecordId, transcationId, uid, ticket, nil];
} }
/// ///
/// @param completion /// @param completion
/// @param phone /// @param phone
/// @param newPwd /// @param newPwd
+ (void)Mew_SetLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd { + (void)Mew_SetLoingPassword:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd {
[self makeRequest:@"acc/pwd/set" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, nil]; [self makeRequest:@"acc/pwd/set" method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, nil];
} }
/// ///
@@ -130,8 +130,8 @@
/// @param phone /// @param phone
/// @param newPwd /// @param newPwd
/// @param pwd /// @param pwd
+ (void)Mew_ModifyLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd { + (void)Mew_ModifyLoingPassword:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd {
[self makeRequest:@"acc/pwd/modify" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, phone, newPwd, pwd, nil]; [self makeRequest:@"acc/pwd/modify" method:MewHttpRequestHelperMethodPOST completion:completion,__FUNCTION__, phone, newPwd, pwd, nil];
} }
@end @end

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/9. // Created by 触海 on 2023/11/9.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewMineCollectRoomPresenter : BaseMvpPresenter @interface MewMineCollectRoomPresenter : MewBaseMvpPresenter
/// 获取收藏房间列表 /// 获取收藏房间列表
/// @param page 当前的页数 /// @param page 当前的页数

View File

@@ -20,11 +20,11 @@
/// @param type 4 /// @param type 4
- (void)mew_getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state type:(NSString *)type { - (void)mew_getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state type:(NSString *)type {
NSString * uid = [AccountInfoStorage instance].getUid; NSString * uid = [AccountInfoStorage instance].getUid;
[Api Mew_RequestMineCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_RequestMineCollectRoomList:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [MewMineCollectRoomModel mewModelsWithArray:data.data[@"fansRoomList"]]; NSArray * array = [MewMineCollectRoomModel mewModelsWithArray:data.data[@"fansRoomList"]];
[[self getView] mew_fonGetCollectRoomListSuccess:array state:state]; [[self mew_getView] mew_fonGetCollectRoomListSuccess:array state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] mew_getCollectRoomListFail:state]; [[self mew_getView] mew_getCollectRoomListFail:state];
}] uid:uid page:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize] roomType:type.length ? type : NULL]; }] uid:uid page:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize] roomType:type.length ? type : NULL];
} }

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/22. // Created by 触海 on 2023/11/22.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewMineRechargePresenter : BaseMvpPresenter @interface MewMineRechargePresenter : MewBaseMvpPresenter
/// 获取钱包信息 /// 获取钱包信息
- (void)mew_getUserWalletInfo; - (void)mew_getUserWalletInfo;

View File

@@ -23,9 +23,9 @@
- (void)mew_getUserWalletInfo { - (void)mew_getUserWalletInfo {
NSString * uid = [AccountInfoStorage instance].getUid; NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket; NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api mew_getUserWalletInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api mew_getUserWalletInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
MewWalletInfoModel * model = [MewWalletInfoModel mewModelWithDictionary:data.data]; MewWalletInfoModel * model = [MewWalletInfoModel mewModelWithDictionary:data.data];
[[self getView] mew_getUserWalletInfo:model]; [[self mew_getView] mew_getUserWalletInfo:model];
}] uid:uid ticket:ticket]; }] uid:uid ticket:ticket];
} }
@@ -33,9 +33,9 @@
/// ///
/// @param channel 8 /// @param channel 8
- (void)mew_requestRechargeListWithChannel:(NSString *)channel { - (void)mew_requestRechargeListWithChannel:(NSString *)channel {
[Api Mew_GetRechargeList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_GetRechargeList:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [MewRechargeListModel mewModelsWithArray:data.data]; NSArray * array = [MewRechargeListModel mewModelsWithArray:data.data];
[[self getView] mew_requestRechargeListSucccess:array]; [[self mew_getView] mew_requestRechargeListSucccess:array];
}] channelType:channel]; }] channelType:channel];
} }
@@ -46,15 +46,15 @@
NSString * ticket = [AccountInfoStorage instance].getTicket; NSString * ticket = [AccountInfoStorage instance].getTicket;
NSString * deviceInfo = [YYUtility deviceID]; NSString * deviceInfo = [YYUtility deviceID];
NSString * clientIp= [YYUtility ipAddress]; NSString * clientIp= [YYUtility ipAddress];
[Api Mew_RequestIAPRecharge:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_RequestIAPRecharge:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
NSString *orderId = (NSString *)data.data[@"recordId"]; NSString *orderId = (NSString *)data.data[@"recordId"];
NSString *mew_uuid = (NSString *)data.data[@"appAccountToken"]; NSString *mew_uuid = (NSString *)data.data[@"appAccountToken"];
[[self getView] mew_requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:mew_uuid]; [[self mew_getView] mew_requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:mew_uuid];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
if(code != 50000){ if(code != 50000){
[[self getView]mew_showErrorToast:msg]; [[self mew_getView]mew_showErrorToast:msg];
} }
[[self getView] mew_requestIAPRechargeOrderFail]; [[self mew_getView] mew_requestIAPRechargeOrderFail];
}] chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp]; }] chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
} }
@@ -64,10 +64,10 @@
- (void)mew_checkReceiptWithOrderId:(NSString *)orderId transcationId:(NSString *)transcationId errorToast:(BOOL)errorToast{ - (void)mew_checkReceiptWithOrderId:(NSString *)orderId transcationId:(NSString *)transcationId errorToast:(BOOL)errorToast{
NSString * uid = [AccountInfoStorage instance].getUid; NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket; NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api Mew_CheckReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_CheckReceipt:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_checkReceiptSuccess:transcationId]; [[self mew_getView] mew_checkReceiptSuccess:transcationId];
}fail:^(NSInteger code, NSString * _Nullable msg) { }fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]mew_checkReceiptFailWithCode:code transcationId:transcationId]; [[self mew_getView]mew_checkReceiptFailWithCode:code transcationId:transcationId];
} mew_showLoading:NO errorToast:errorToast] chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket]; } mew_showLoading:NO errorToast:errorToast] chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
} }
@@ -78,8 +78,8 @@
- (void)mew_checkReceiptWithData:(NSString *)receipt orderId:(NSString *)orderId transcationId:(NSString *)transcationId { - (void)mew_checkReceiptWithData:(NSString *)receipt orderId:(NSString *)orderId transcationId:(NSString *)transcationId {
NSString * uid = [AccountInfoStorage instance].getUid; NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket; NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api Mew_CheckReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_CheckReceipt:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_checkReceiptSuccess:transcationId]; [[self mew_getView] mew_checkReceiptSuccess:transcationId];
} mew_showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket]; } mew_showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
} }
@@ -88,8 +88,8 @@
/// @param transcations /// @param transcations
- (void)mew_checkTranscationIds:(NSArray *)transcations { - (void)mew_checkTranscationIds:(NSArray *)transcations {
NSString * transcationIdStr = [transcations mewToJSONString]; NSString * transcationIdStr = [transcations mewToJSONString];
[Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api requestCheckTranscationIds:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_checkTranscationIdsSuccess]; [[self mew_getView] mew_checkTranscationIdsSuccess];
}] transcationIdStr:transcationIdStr]; }] transcationIdStr:transcationIdStr];
} }

View File

@@ -5,12 +5,12 @@
// Created by 触海 on 2023/11/9. // Created by 触海 on 2023/11/9.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
@class UserInfoModel; @class UserInfoModel;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewMineSettingPresenter : BaseMvpPresenter @interface MewMineSettingPresenter : MewBaseMvpPresenter
/// 获取用户信息 /// 获取用户信息
- (void)mew_getUserInfo; - (void)mew_getUserInfo;

View File

@@ -18,8 +18,8 @@
#import "Base.h" #import "Base.h"
@implementation MewMineSettingPresenter @implementation MewMineSettingPresenter
- (id<MewMineSettingProtocol>)getView { - (id<MewMineSettingProtocol>)mew_getView {
return (id<MewMineSettingProtocol>)[super getView]; return (id<MewMineSettingProtocol>)[super mew_getView];
} }
/// ///
@@ -45,15 +45,15 @@
cancelItem.subTitle = @""; cancelItem.subTitle = @"";
cancelItem.type = MewMineSettingItemType_Cancel_Account; cancelItem.type = MewMineSettingItemType_Cancel_Account;
NSArray *dataModel = @[phoneItem, loginItem, aboutusItem, cancelItem]; NSArray *dataModel = @[phoneItem, loginItem, aboutusItem, cancelItem];
[[self getView] mew_getMineSettingDatasourceSuccess:dataModel]; [[self mew_getView] mew_getMineSettingDatasourceSuccess:dataModel];
} }
/// ///
- (void)mew_getUserInfo { - (void)mew_getUserInfo {
NSString *uid = [[AccountInfoStorage instance] getUid]; NSString *uid = [[AccountInfoStorage instance] getUid];
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getUserInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data]; UserInfoModel *userInfo = [UserInfoModel mewModelWithDictionary:data.data];
[[self getView] mew_onGetUserInfoSuccess:userInfo]; [[self mew_getView] mew_onGetUserInfoSuccess:userInfo];
}] uid:uid]; }] uid:uid];
} }
@@ -61,9 +61,9 @@
- (void)mew_logoutCurrentAccount { - (void)mew_logoutCurrentAccount {
/// ///
AccountModel *model = [[AccountInfoStorage instance] accountModel]; AccountModel *model = [[AccountInfoStorage instance] accountModel];
[Api Mew_LogoutCurrentAccount:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_LogoutCurrentAccount:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] mew_logoutCurrentAccountSuccess]; [[self mew_getView] mew_logoutCurrentAccountSuccess];
[self logout]; [self mew_logout];
}] access_token:model.access_token]; }] access_token:model.access_token];
} }

View File

@@ -5,11 +5,11 @@
// Created by 触海 on 2023/11/9. // Created by 触海 on 2023/11/9.
// //
#import "BaseViewController.h" #import "MewBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewMineAboutUsViewController : BaseViewController @interface MewMineAboutUsViewController : MewBaseViewController
@end @end

View File

@@ -6,11 +6,11 @@
// //
#import "MewMineAboutUsViewController.h" #import "MewMineAboutUsViewController.h"
#import "YMWebViewController.h" #import "MewWebViewController.h"
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
/// Tool /// Tool
#import "YMMacro.h" #import "MewMacro.h"
#import "MEWThemeColor.h" #import "MEWThemeColor.h"
#import "Base.h" #import "Base.h"
#import "YYUtility.h" #import "YYUtility.h"
@@ -47,7 +47,7 @@
#pragma mark - Action Event #pragma mark - Action Event
/// ///
- (void)mew_pushPrivacyView:(UITapGestureRecognizer *)tap { - (void)mew_pushPrivacyView:(UITapGestureRecognizer *)tap {
YMWebViewController *controller = [[YMWebViewController alloc] init]; MewWebViewController *controller = [[MewWebViewController alloc] init];
controller.url = URLWithType(kPrivacyURL); controller.url = URLWithType(kPrivacyURL);
[self.navigationController pushViewController:controller animated:NO]; [self.navigationController pushViewController:controller animated:NO];
} }

View File

@@ -12,7 +12,7 @@
#import "MewMineLoginPasswordViewController.h" #import "MewMineLoginPasswordViewController.h"
#import "MewWebViewController.h" #import "MewWebViewController.h"
#import "MineLoginPasswordViewController.h" #import "MewMineLoginPasswordViewController.h"
// Presenter // Presenter
#import "MewMineSettingProtocol.h" #import "MewMineSettingProtocol.h"
#import "MewMineSettingPresenter.h" #import "MewMineSettingPresenter.h"

View File

@@ -5,13 +5,13 @@
// Created by 触海 on 2023/11/7. // Created by 触海 on 2023/11/7.
// //
#import "BaseMvpPresenter.h" #import "MewBaseMvpPresenter.h"
#import "MewRoomInfoModel.h" #import "MewRoomInfoModel.h"
@class UserInfoModel; @class UserInfoModel;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MewRoomPresenter : BaseMvpPresenter @interface MewRoomPresenter : MewBaseMvpPresenter
/// 进入房间 /// 进入房间
/// - Parameters: /// - Parameters:

View File

@@ -30,15 +30,15 @@
/// RAC /// RAC
[[RACSignal combineLatest:@[room, user] reduce:^id(MewRoomInfoModel *room, UserInfoModel *user){ [[RACSignal combineLatest:@[room, user] reduce:^id(MewRoomInfoModel *room, UserInfoModel *user){
[[self getView] mew_initEnterCurrentRoomSuccess:room user:user]; [[self mew_getView] mew_initEnterCurrentRoomSuccess:room user:user];
return nil; return nil;
}] subscribeError:^(NSError * _Nullable error) { }] subscribeError:^(NSError * _Nullable error) {
[[self getView] enterCurrentRoomFail:error.code]; [[self mew_getView] enterCurrentRoomFail:error.code];
}]; }];
/// ///
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getUserInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel *userInfo = [UserInfoModel mewModelWithJSON:data.data]; UserInfoModel *userInfo = [UserInfoModel mewModelWithJSON:data.data];
[user sendNext:userInfo]; [user sendNext:userInfo];
[user sendCompleted]; [user sendCompleted];
@@ -47,7 +47,7 @@
}] uid:uid]; }] uid:uid];
/// ///
[Api Mew_GetRoomInformation:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_GetRoomInformation:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
MewRoomInfoModel *roomInfo = [MewRoomInfoModel mewModelWithJSON:data.data]; MewRoomInfoModel *roomInfo = [MewRoomInfoModel mewModelWithJSON:data.data];
[room sendNext:roomInfo]; [room sendNext:roomInfo];
[room sendCompleted]; [room sendCompleted];
@@ -69,9 +69,9 @@
/// ///
[[NIMSDK sharedSDK].chatroomManager enterChatroom:request completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom, NIMChatroomMember * _Nullable me) { [[NIMSDK sharedSDK].chatroomManager enterChatroom:request completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom, NIMChatroomMember * _Nullable me) {
if (error) { if (error) {
[[self getView] enterCurrentRoomFail:error.code]; [[self mew_getView] enterCurrentRoomFail:error.code];
} else { } else {
[[self getView] enterCurrentRoomSuccess:chatroom]; [[self mew_getView] enterCurrentRoomSuccess:chatroom];
} }
}]; }];
} }
@@ -117,11 +117,11 @@
mgId = @"0"; mgId = @"0";
} }
[Api Mew_OpenRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_OpenRoom:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
MewRoomInfoModel *roomInfo = [MewRoomInfoModel mewModelWithJSON:data.data]; MewRoomInfoModel *roomInfo = [MewRoomInfoModel mewModelWithJSON:data.data];
[[self getView] openCurrentRoomSuccess:roomInfo]; [[self mew_getView] openCurrentRoomSuccess:roomInfo];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] enterCurrentRoomFail:code]; [[self mew_getView] enterCurrentRoomFail:code];
}] title:title type:type roomPwd:roomPwd roomDesc:roomDesc backPic:backPic uid:uid ticket:ticket mgId:mgId]; }] title:title type:type roomPwd:roomPwd roomDesc:roomDesc backPic:backPic uid:uid ticket:ticket mgId:mgId];
} }
@@ -166,14 +166,14 @@
// //
NSString *roomSendType = @"3"; NSString *roomSendType = @"3";
[Api Mew_RequestSendGift:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api Mew_RequestSendGift:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
MewGiftReceiveInfoModel *receive = [MewGiftReceiveInfoModel mewModelWithJSON:data.data]; MewGiftReceiveInfoModel *receive = [MewGiftReceiveInfoModel mewModelWithJSON:data.data];
receive.sourceType = giftSource; receive.sourceType = giftSource;
receive.roomSendGiftType = roomSendType; receive.roomSendGiftType = roomSendType;
[[self getView] mew_sendRoomGiftSuccess:receive originDic:data.data uidCount:1]; [[self mew_getView] mew_sendRoomGiftSuccess:receive originDic:data.data uidCount:1];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] mew_sendRoomGiftFailWithCode:code msg:msg]; [[self mew_getView] mew_sendRoomGiftFailWithCode:code msg:msg];
}] targetUids:targetUids giftNum:giftNum sendType:sendType giftId:giftId giftSource:giftSource giftType:giftType roomUid:roomUid msg:@"" uid:uid]; }] targetUids:targetUids giftNum:giftNum sendType:sendType giftId:giftId giftSource:giftSource giftType:giftType roomUid:roomUid msg:@"" uid:uid];
} }