更换类名和方法
This commit is contained in:
@@ -156,4 +156,4 @@ SPEC CHECKSUMS:
|
||||
|
||||
PODFILE CHECKSUM: cc88fa05da662ee682fc0eeb502faab221faa032
|
||||
|
||||
COCOAPODS: 1.14.2
|
||||
COCOAPODS: 1.12.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -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
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// MewAccountInfoStorage.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/6.
|
||||
//
|
||||
|
||||
#import "MewAccountInfoStorage.h"
|
||||
|
||||
@implementation MewAccountInfoStorage
|
||||
|
||||
@end
|
@@ -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
|
@@ -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
|
@@ -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
|
112
yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/MewBaseMvpPresenter.m
Normal file
112
yinmeng-ios/yinmeng-ios/Base/MVP/Presenter/MewBaseMvpPresenter.m
Normal 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
|
@@ -1,26 +1,22 @@
|
||||
//
|
||||
// BaseMvpProtocol.h
|
||||
// mew-ios
|
||||
// MewMewBaseMvpProtocol.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MewBaseViewController.h"
|
||||
@class BaseModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol BaseMvpProtocol <NSObject, MewBaseViewControllerProtocol>
|
||||
|
||||
@protocol MewBaseMvpProtocol <NSObject,MewBaseViewControllerProtocol>
|
||||
/// 登录失效
|
||||
- (void)mew_getTokenId;
|
||||
/// 跳转到填写用户资料
|
||||
- (void)mew_completeUserInfo;
|
||||
/// 账号已注销
|
||||
- (void)accountCanceled:(NSDictionary *)data;
|
||||
|
||||
|
||||
- (void)mew_accountCanceled:(NSDictionary *)data;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import "MewBaseViewController.h"
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@@ -26,16 +26,16 @@
|
||||
- (__kindof id)presenter {
|
||||
if (_presenter == nil) {
|
||||
_presenter = [self createPresenter];
|
||||
[_presenter attatchView:self];
|
||||
[_presenter mew_attatchView:self];
|
||||
}
|
||||
return _presenter;
|
||||
}
|
||||
|
||||
- (__kindof id)createPresenter {
|
||||
return [[BaseMvpPresenter alloc] init];
|
||||
return [[MewBaseMvpPresenter alloc] init];
|
||||
}
|
||||
|
||||
#pragma mark - BaseMvpProtocol
|
||||
#pragma mark - MewBaseMvpProtocol
|
||||
- (void)mew_getTokenId {
|
||||
MewLoginViewController *loginVC = [[MewLoginViewController alloc] init];
|
||||
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 *dateDes = [NSString stringWithFormat:@"注销时间:%@", [PLTimeUtil getDateWithYYMMDD:date]];
|
||||
// NSString *msg = [NSString stringWithFormat:@"%@\n\n请联系客服(微信:yinmeng-kefu)咨询哦!", dateDes];
|
||||
|
@@ -21,7 +21,7 @@ typedef void(^MewHttpRequestHelperCompletion)(BaseModel* data, NSInteger code, N
|
||||
@interface MewHttpRequestHelper : NSObject
|
||||
|
||||
/// 配置公参
|
||||
+ (NSDictionary*)configBaseParmars:(NSDictionary *)parmars;
|
||||
+ (NSDictionary*)mew_configBaseParmars:(NSDictionary *)parmars;
|
||||
|
||||
+ (void)GET:(NSString *)method
|
||||
params:(NSDictionary *)params
|
||||
|
@@ -76,7 +76,7 @@ static const char *titleFrameStr = "titleFrame";
|
||||
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);
|
||||
}
|
||||
-(NSTimeInterval)mew_acceptEventInterval{
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/15.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewHomePresenter : BaseMvpPresenter
|
||||
@interface MewHomePresenter : MewBaseMvpPresenter
|
||||
|
||||
- (void)mew_getNewFriendListWithGender:(NSString *)gender;
|
||||
|
||||
|
@@ -21,10 +21,10 @@
|
||||
|
||||
/// Mew 获取好友列表
|
||||
- (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"]];
|
||||
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) {
|
||||
|
||||
}] gender:gender];
|
||||
@@ -32,11 +32,11 @@
|
||||
|
||||
/// 获取新朋友
|
||||
- (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];
|
||||
[[self getView] mew_getNewFriendListSuccess:array];
|
||||
[[self mew_getView] mew_getNewFriendListSuccess:array];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] mew_getNewFriendListFail];
|
||||
[[self mew_getView] mew_getNewFriendListFail];
|
||||
}] gender:gender];
|
||||
|
||||
}
|
||||
@@ -44,14 +44,14 @@
|
||||
|
||||
/// 上传声音
|
||||
- (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 *token = data.data[@"token"];
|
||||
[MEWUploadFile mewUploadFile:filePath named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull res) {
|
||||
NSString *url = res[@"path"];
|
||||
[[self getView] mew_uploadVoiceFileToThirdSuccess:url];
|
||||
[[self mew_getView] mew_uploadVoiceFileToThirdSuccess:url];
|
||||
} 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 {
|
||||
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;
|
||||
[[self getView] mew_getUserAttentionSuccess:isLike];
|
||||
[[self mew_getView] mew_getUserAttentionSuccess:isLike];
|
||||
}] uid:uid isLikeUid:targetUid];
|
||||
|
||||
}
|
||||
@@ -99,9 +99,9 @@
|
||||
|
||||
/// 获取用户信息
|
||||
- (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];
|
||||
[[self getView] mew_getUserInfoSuccess:userInfo];
|
||||
[[self mew_getView] mew_getUserInfoSuccess:userInfo];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}] uid:uid];
|
||||
@@ -109,9 +109,9 @@
|
||||
|
||||
/// 获取用户详细信息
|
||||
- (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];
|
||||
[[self getView] mew_getUserDetailInfoSuccess:infoModel];
|
||||
[[self mew_getView] mew_getUserDetailInfoSuccess:infoModel];
|
||||
|
||||
}] uid:uid page:@"1" pageSize:@"20"];
|
||||
}
|
||||
@@ -123,11 +123,11 @@
|
||||
NSString * uid= [AccountInfoStorage instance].getUid;
|
||||
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
|
||||
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];
|
||||
[[self getView] mew_getUserAttentionListSuccess:array state:state];
|
||||
[[self mew_getView] mew_getUserAttentionListSuccess:array state:state];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
// [[self getView] mew_getUserAttentionListFail:state];
|
||||
// [[self mew_getView] mew_getUserAttentionListFail:state];
|
||||
}] uid:uid pageNo:pageStr pageSize:pageSizeStr];
|
||||
}
|
||||
|
||||
@@ -135,8 +135,8 @@
|
||||
/// 音萌商店包的上传声音秀
|
||||
- (void)mewPublishVoiceShowDura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url {
|
||||
|
||||
[Api mewPublishVoiceShow:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mewPublishVoiceShowSuccess];
|
||||
[Api mewPublishVoiceShow:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mewPublishVoiceShowSuccess];
|
||||
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
@@ -148,8 +148,8 @@
|
||||
NSString *uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString *ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString *type = state ? @"1" : @"2";
|
||||
[Api Mew_AttentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_attentionUserSuccess:state];
|
||||
[Api Mew_AttentionCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_attentionUserSuccess:state];
|
||||
}] uid:uid likedUid:targetUid ticket:ticket type:type];
|
||||
|
||||
}
|
||||
|
@@ -344,7 +344,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
||||
}
|
||||
|
||||
[AccountInfoStorage instance].MewThirdUserInfo = userInfo;
|
||||
[MewHUDTool showLoadingWithMessage:@"正在登录中"];
|
||||
[MewHUDTool mew_showLoadingWithMessage:@"正在登录中"];
|
||||
[self.presenter mew_thirdLoginWithApple:identityToken unionId:userID];
|
||||
|
||||
// [Api loginWithThirdPart:^(BaseModel * _Nonnull data, NSInteger code, NSString * _Nonnull msg) {
|
||||
|
@@ -206,7 +206,7 @@
|
||||
- (MewLoginPasswordPresent *)present {
|
||||
if (!_present) {
|
||||
_present = [[MewLoginPasswordPresent alloc] init];
|
||||
[_present attatchView:self];
|
||||
[_present mew_attatchView:self];
|
||||
}
|
||||
return _present;
|
||||
}
|
||||
|
@@ -326,7 +326,7 @@
|
||||
- (MewLoginVerifCodePresent *)present {
|
||||
if (!_present) {
|
||||
_present = [[MewLoginVerifCodePresent alloc] init];
|
||||
[_present attatchView:self];
|
||||
[_present mew_attatchView:self];
|
||||
}
|
||||
return _present;
|
||||
}
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/19.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewPartyPresenter : BaseMvpPresenter
|
||||
@interface MewPartyPresenter : MewBaseMvpPresenter
|
||||
|
||||
- (void)mew_partyRecommendRoomList;
|
||||
@end
|
||||
|
@@ -17,11 +17,11 @@
|
||||
/// 请求推荐房间列表
|
||||
- (void)mew_partyRecommendRoomList {
|
||||
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];
|
||||
[[self getView] mew_partyRecommendRoomListSuccess:array];
|
||||
[[self mew_getView] mew_partyRecommendRoomListSuccess:array];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
// [[self getView] getmew_partyRecommendRoomListFail:msg state:state];
|
||||
// [[self mew_getView] getmew_partyRecommendRoomListFail:msg state:state];
|
||||
}] uid:uid];
|
||||
}
|
||||
|
||||
|
@@ -133,7 +133,7 @@ NSString * const kCancelAccount = @"cancelAccount";
|
||||
NSLog(@"%@",error);
|
||||
}];
|
||||
} 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 *js = [NSString stringWithFormat:@"getMessage(\"deviceInfo\",%@)", json];
|
||||
[self.webview evaluateJavaScript:js completionHandler:^(id _Nullable ohter, NSError * _Nullable error) {
|
||||
|
@@ -5,12 +5,12 @@
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MainPresenter : BaseMvpPresenter<NIMLoginManagerDelegate>
|
||||
@interface MainPresenter : MewBaseMvpPresenter<NIMLoginManagerDelegate>
|
||||
/// 获取Ticket
|
||||
- (void)mew_autoLogin;
|
||||
/// IM登录
|
||||
|
@@ -20,7 +20,7 @@
|
||||
- (void)mew_autoLogin {
|
||||
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
|
||||
if (accountModel == nil || accountModel.uid == nil || accountModel.access_token == nil) {
|
||||
[[self getView] mew_getTokenId];
|
||||
[[self mew_getView] mew_getTokenId];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
}
|
||||
|
||||
// 获取ticket
|
||||
[Api mew_requestTicket:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api mew_requestTicket:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray *tickets = [data.data valueForKey:@"tickets"];
|
||||
NSString *ticket = [tickets[0] valueForKey:@"ticket"];
|
||||
[[AccountInfoStorage instance] saveTicket:ticket];
|
||||
[[self getView] mew_autoLoginSuccess];
|
||||
[[self mew_getView] mew_autoLoginSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[self logout];
|
||||
[self mew_logout];
|
||||
}] access_token:accountModel.access_token issue_type:@"multi"];
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
- (void)mew_loginNIM {
|
||||
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
|
||||
if (accountModel == nil) {
|
||||
[[self getView] mew_getTokenId];
|
||||
[[self mew_getView] mew_getTokenId];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,15 +64,15 @@
|
||||
|
||||
/// 获取用户信息
|
||||
- (void)mew_getUserInfo {
|
||||
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]];
|
||||
[Api getUserInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_getUserInfoSuccess:[UserInfoModel mewModelWithDictionary:data.data]];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}] uid:[[AccountInfoStorage instance] getUid]];
|
||||
}
|
||||
|
||||
/// 检查是否有未消费的内购订单
|
||||
- (void)checkTranscation {
|
||||
- (void)mew_checkTranscation {
|
||||
NSString *uid = [AccountInfoStorage instance].getUid;
|
||||
NSArray *array = [MEWRechargeStorage mewGetAllReciptsWithUid:uid];
|
||||
if (array == nil && array.count == 0) {
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
|
||||
NSString *transcationIdStr = [array mewToJSONString];
|
||||
[Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api requestCheckTranscationIds:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
|
||||
|
||||
}] transcationIdStr:transcationIdStr];
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#import "MewBaseNavigationController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
#import "MewLoginViewController.h"
|
||||
#import "LoginFullInfoViewController.h"
|
||||
#import "MewLoginFullInfoViewController.h"
|
||||
#import "MewPartyViewController.h"
|
||||
#import "MewSessionListViewController.h"
|
||||
#import "MewHomeViewController.h"
|
||||
@@ -35,7 +35,7 @@
|
||||
NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
|
||||
@interface MewTabBarController() <
|
||||
BaseMvpProtocol, MainProtocol,
|
||||
MewBaseMvpProtocol, MainProtocol,
|
||||
NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate,
|
||||
NIMChatManagerDelegate,NIMBroadcastManagerDelegate>
|
||||
|
||||
@@ -163,7 +163,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BaseMvpProtocol
|
||||
#pragma mark - MewBaseMvpProtocol
|
||||
//登录失效
|
||||
- (void)mew_getTokenId {
|
||||
MewLoginViewController *lvc = [[MewLoginViewController alloc] init];
|
||||
@@ -175,7 +175,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
|
||||
//补充用户信息
|
||||
- (void)mew_completeUserInfo {
|
||||
LoginFullInfoViewController * bindPhoneVC = [[LoginFullInfoViewController alloc] init];
|
||||
MewLoginFullInfoViewController * bindPhoneVC = [[MewLoginFullInfoViewController alloc] init];
|
||||
MewBaseNavigationController * nav = [[MewBaseNavigationController alloc] initWithRootViewController:bindPhoneVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
@@ -238,7 +238,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
- (MainPresenter *)presenter {
|
||||
if (_presenter == nil) {
|
||||
_presenter = [[MainPresenter alloc] init];
|
||||
[_presenter attatchView:self];
|
||||
[_presenter mew_attatchView:self];
|
||||
}
|
||||
return _presenter;
|
||||
}
|
||||
|
@@ -9,27 +9,27 @@
|
||||
#import "NewEncryptTool.h"
|
||||
@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
|
||||
[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 phone 手机号
|
||||
/// @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
|
||||
[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 phone 手机号
|
||||
/// @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
|
||||
[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 newPwd 新的密码
|
||||
/// @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
|
||||
[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 access_token access_token
|
||||
/// @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
|
||||
[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 完成
|
||||
+ (void)Mew_RandomNick:(HttpRequestHelperCompletion)completion {
|
||||
+ (void)Mew_RandomNick:(MewHttpRequestHelperCompletion)completion {
|
||||
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 code 验证码
|
||||
/// @param ticket ticket
|
||||
+ (void)Mew_BindMoblieCode:(HttpRequestHelperCompletion)complection
|
||||
+ (void)Mew_BindMoblieCode:(MewHttpRequestHelperCompletion)complection
|
||||
phone:(NSString *)phone
|
||||
code:(NSString *)code
|
||||
ticket:(NSString *)ticket {
|
||||
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
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/22.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginBindPhonePresent : BaseMvpPresenter
|
||||
@interface MewLoginBindPhonePresent : MewBaseMvpPresenter
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -8,8 +8,8 @@
|
||||
#import "MewLoginBindPhonePresent.h"
|
||||
|
||||
@implementation MewLoginBindPhonePresent
|
||||
- (id<BaseMvpProtocol>)getView {
|
||||
return ((id<BaseMvpProtocol>) [super getView]);
|
||||
- (id<MewBaseMvpProtocol>)mew_getView {
|
||||
return ((id<MewBaseMvpProtocol>) [super mew_getView]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -5,12 +5,12 @@
|
||||
// Created by 触海 on 2023/11/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
#import "MewEnum.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginForgetPasswordPresent : BaseMvpPresenter
|
||||
@interface MewLoginForgetPasswordPresent : MewBaseMvpPresenter
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
|
@@ -5,20 +5,20 @@
|
||||
// Created by 触海 on 2023/11/9.
|
||||
//
|
||||
|
||||
#import "LoginForgetPasswordPresent.h"
|
||||
#import "MewLoginForgetPasswordPresent.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "MewConstant.h"
|
||||
///Protocol
|
||||
#import "LoginForgetPasswordProtocol.h"
|
||||
#import "MewLoginForgetPasswordProtocol.h"
|
||||
///Api
|
||||
#import "Api+Login.h"
|
||||
|
||||
|
||||
@implementation LoginForgetPasswordPresent
|
||||
- (id<LoginForgetPasswordProtocol>)getView {
|
||||
return (id<LoginForgetPasswordProtocol>)[super getView];
|
||||
@implementation MewLoginForgetPasswordPresent
|
||||
- (id<MewLoginForgetPasswordProtocol>)mew_getView {
|
||||
return (id<MewLoginForgetPasswordProtocol>)[super mew_getView];
|
||||
}
|
||||
|
||||
/// 获取手机的验证码
|
||||
@@ -26,8 +26,8 @@
|
||||
/// @param type 类型
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
|
||||
[[self getView] mew_phoneSmsCodeSuccess];
|
||||
[Api mew_phoneSmsCode:[self mew_createHttpCompletion:^(id _Nonnull data) {
|
||||
[[self mew_getView] mew_phoneSmsCodeSuccess];
|
||||
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
- (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api resetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] resetPasswrodSuccess];
|
||||
[Api Mew_ResetPasswordWithPhone:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_resetPasswrodSuccess];
|
||||
} mew_showLoading:YES] phone:desPhone newPwd:desPassword smsCode:smsCode];
|
||||
}
|
||||
|
||||
|
@@ -5,12 +5,12 @@
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
@class MewThirdUserInfo;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginFullInfoPresenter : BaseMvpPresenter
|
||||
@interface MewLoginFullInfoPresenter : MewBaseMvpPresenter
|
||||
|
||||
/// 获取保存的第三方的数据模型
|
||||
- (MewThirdUserInfo *)mew_getMewThirdUserInfo;
|
||||
|
@@ -5,36 +5,36 @@
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "LoginFullInfoPresenter.h"
|
||||
#import "MewLoginFullInfoPresenter.h"
|
||||
#import "Api+Login.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "NSMutableDictionary+MEWSafe.h"
|
||||
///Api
|
||||
#import "LoginFullInfoProtocol.h"
|
||||
#import "MewLoginFullInfoProtocol.h"
|
||||
///Model
|
||||
#import "ThirdUserInfo.h"
|
||||
#import "MewThirdUserInfo.h"
|
||||
|
||||
@implementation LoginFullInfoPresenter
|
||||
@implementation MewLoginFullInfoPresenter
|
||||
|
||||
#pragma mark - Super
|
||||
- (id<LoginFullInfoProtocol>)getView {
|
||||
return (id<LoginFullInfoProtocol>)[super getView];
|
||||
- (id<MewLoginFullInfoProtocol>)mew_getView {
|
||||
return (id<MewLoginFullInfoProtocol>)[super mew_getView];
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
/// 获取保存的第三方的数据模型
|
||||
- (ThirdUserInfo *)getThirdUserInfo {
|
||||
if ([AccountInfoStorage instance].thirdUserInfo) {
|
||||
return [AccountInfoStorage instance].thirdUserInfo;
|
||||
- (MewThirdUserInfo *)getThirdUserInfo {
|
||||
if ([AccountInfoStorage instance].MewThirdUserInfo) {
|
||||
return [AccountInfoStorage instance].MewThirdUserInfo;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
/// 随机获取昵称
|
||||
- (void)randomRequestNick {
|
||||
[Api randomNick:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] requestRandomNickSuccess:data.data];
|
||||
[Api Mew_RandomNick:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_requestRandomNickSuccess:data.data];
|
||||
}]];
|
||||
}
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
[params mewSafeSetObject:shareChannel forKey:@"shareChannel"];
|
||||
}
|
||||
|
||||
[Api mew_completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] complementInfoSuccess];
|
||||
[Api mew_completeUserInfo:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_complementInfoSuccess];
|
||||
}] userInfo:params];
|
||||
}
|
||||
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginPasswordPresent : BaseMvpPresenter
|
||||
@interface MewLoginPasswordPresent : MewBaseMvpPresenter
|
||||
|
||||
/// 使用手机号和密码登录
|
||||
/// @param phone 手机号
|
||||
|
@@ -17,22 +17,22 @@
|
||||
#import "MewLoginPasswordProtocol.h"
|
||||
|
||||
@implementation MewLoginPasswordPresent
|
||||
- (id<MewLoginPasswordProtocol>)getView {
|
||||
return (id<MewLoginPasswordProtocol>)[super getView];
|
||||
- (id<MewLoginPasswordProtocol>)mew_getView {
|
||||
return (id<MewLoginPasswordProtocol>)[super mew_getView];
|
||||
}
|
||||
|
||||
/// 手机密码登录
|
||||
- (void)mew_loginWithPhone:(NSString *)phone password:(NSString *)password {
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:password 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];
|
||||
if (model && model.access_token.length > 0){
|
||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||
}
|
||||
[[self getView] mew_phoneAndPasswordLoginSuccess];
|
||||
[[self mew_getView] mew_phoneAndPasswordLoginSuccess];
|
||||
} 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"];
|
||||
}
|
||||
@end
|
||||
|
@@ -5,12 +5,12 @@
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "YMEnum.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
#import "MewEnum.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginPresenter : BaseMvpPresenter
|
||||
@interface MewLoginPresenter : MewBaseMvpPresenter
|
||||
|
||||
/// 一键登录
|
||||
- (void)mew_phoneQuickLogin:(NSString *)accessToken token:(NSString*) token;
|
||||
|
@@ -17,25 +17,25 @@
|
||||
@implementation MewLoginPresenter
|
||||
|
||||
#pragma mark - Super
|
||||
- (id<MewLoginProtocol>)getView {
|
||||
return (id<MewLoginProtocol>)[super getView];
|
||||
- (id<MewLoginProtocol>)mew_getView {
|
||||
return (id<MewLoginProtocol>)[super mew_getView];
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
/// 一键登录
|
||||
- (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];
|
||||
}
|
||||
|
||||
|
||||
- (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];
|
||||
if (model != nil) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||
[[self getView] mew_loginSuccess];
|
||||
[[self mew_getView] mew_loginSuccess];
|
||||
}
|
||||
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
@@ -22,9 +22,9 @@
|
||||
- (void)mew_phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
|
||||
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
|
||||
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];
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)];
|
||||
// [Api checkMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
// [[self getView] mew_checkMoblieCodeWithMoblieSuccess];
|
||||
// [Api checkMoblieCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
// [[self mew_getView] mew_checkMoblieCodeWithMoblieSuccess];
|
||||
// }] mobile:desPhone code:code uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
- (void)mew_bindkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code {
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api Mew_BindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_bindMoblieCodeWithMoblieSuccess];
|
||||
[Api Mew_BindMoblieCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_bindMoblieCodeWithMoblieSuccess];
|
||||
}] phone:desPhone code:code ticket:ticket];
|
||||
}
|
||||
@end
|
||||
|
@@ -5,12 +5,12 @@
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
#import "MewEnum.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginVerifCodePresent : BaseMvpPresenter
|
||||
@interface MewLoginVerifCodePresent : MewBaseMvpPresenter
|
||||
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
|
@@ -20,8 +20,8 @@
|
||||
@implementation MewLoginVerifCodePresent
|
||||
|
||||
#pragma mark - Super
|
||||
- (id)getView {
|
||||
return (id<MewLoginVerifCodeProtocol>)[super getView];
|
||||
- (id)mew_getView {
|
||||
return (id<MewLoginVerifCodeProtocol>)[super mew_getView];
|
||||
}
|
||||
|
||||
/// 获取手机的验证码
|
||||
@@ -30,8 +30,8 @@
|
||||
- (void)mew_phoneSmsCode:(NSString *)phone type:(GetSmsType)type {
|
||||
NSString *desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
|
||||
[Api mew_phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_phoneSmsCodeSuccess];
|
||||
[Api mew_phoneSmsCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_phoneSmsCodeSuccess];
|
||||
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@
|
||||
/// @param code 验证码
|
||||
- (void)mew_loginWithPhone:(NSString *)phone code:(NSString *)code {
|
||||
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];
|
||||
if (accountModel && accountModel.access_token.length > 0) {
|
||||
[[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"];
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
- (void)mew_bindWithPhone:(NSString *)phone code:(NSString *)code {
|
||||
NSString *ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api Mew_BindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_bindWithPhoneSuccess];
|
||||
[Api Mew_BindMoblieCode:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_bindWithPhoneSuccess];
|
||||
} mew_showLoading:YES] phone:desPhone code:code ticket:ticket];
|
||||
|
||||
}
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/22.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MineLoginPasswordPresenter : BaseMvpPresenter
|
||||
@interface MineLoginPasswordPresenter : MewBaseMvpPresenter
|
||||
/// 设置登录密码
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 密码
|
||||
|
@@ -21,8 +21,8 @@
|
||||
NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
|
||||
[Api Mew_SetLoingPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] setLoginPasswordSuccess];
|
||||
[Api Mew_SetLoingPassword:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_setLoginPasswordSuccess];
|
||||
} mew_showLoading:YES] phone:desPhone newPwd:desNewPwd];
|
||||
|
||||
}
|
||||
@@ -36,8 +36,8 @@
|
||||
NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPwd = [DESEncrypt encryptUseDES:pwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api Mew_ModifyLoingPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_modifyLoginPasswordSuccess];
|
||||
[Api Mew_ModifyLoingPassword:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_modifyLoginPasswordSuccess];
|
||||
}] phone:desPhone newPwd:desNewPwd pwd:desPwd];
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
// Created by 触海 on 2023/11/22.
|
||||
//
|
||||
|
||||
#import "LoginBindPhoneViewController.h"
|
||||
#import "MewLoginBindPhoneViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
@@ -15,11 +15,11 @@
|
||||
|
||||
//#import "NSString+Utils.h"
|
||||
///Tool
|
||||
#import "LoginBindPhonePresent.h"
|
||||
#import "MewLoginBindPhonePresent.h"
|
||||
///VC
|
||||
//#import "LoginVerifCodeViewController.h"
|
||||
|
||||
@interface LoginBindPhoneViewController ()
|
||||
@interface MewLoginBindPhoneViewController ()
|
||||
///提示Label
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
/// 手机号输入框背景
|
||||
@@ -34,13 +34,13 @@
|
||||
@property (nonatomic,strong) UIButton *backButton;
|
||||
@end
|
||||
|
||||
@implementation LoginBindPhoneViewController
|
||||
@implementation MewLoginBindPhoneViewController
|
||||
- (BOOL)mew_isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
#pragma mark - life cycle
|
||||
- (LoginBindPhonePresent *)createPresenter {
|
||||
return [[LoginBindPhonePresent alloc] init];
|
||||
- (MewLoginBindPhonePresent *)createPresenter {
|
||||
return [[MewLoginBindPhonePresent alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
@@ -148,7 +148,7 @@
|
||||
- (void)mew_backButtonAction:(UIButton *)sender {
|
||||
///退出登录状态
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
[self.presenter logout];
|
||||
[self.presenter mew_logout];
|
||||
}];
|
||||
}
|
||||
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/16.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewMessagePresenter : BaseMvpPresenter
|
||||
@interface MewMessagePresenter : MewBaseMvpPresenter
|
||||
- (void)mew_getChatLimitReceiverUid:(NSString *)receiverUid;
|
||||
|
||||
/// 获取用户信息
|
||||
|
@@ -17,29 +17,29 @@
|
||||
|
||||
@implementation MewMessagePresenter
|
||||
- (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];
|
||||
[[self getView] mew_onGetLimitChat:chatLimit];
|
||||
[[self mew_getView] mew_onGetLimitChat:chatLimit];
|
||||
} mew_showLoading:NO errorToast:NO] receiverUid:receiverUid];
|
||||
}
|
||||
|
||||
/// 获取用户信息
|
||||
/// @param uid 用户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];
|
||||
[[self getView] mew_onGetSessionUserInfoSuccess:infoModel];
|
||||
[[self mew_getView] mew_onGetSessionUserInfoSuccess:infoModel];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView]mew_onGetSessionUserInfoFail];
|
||||
[[self mew_getView]mew_onGetSessionUserInfoFail];
|
||||
}] uid:uid page:@"1" pageSize:@"20"];
|
||||
}
|
||||
|
||||
///是否关注当前用户
|
||||
- (void)mew_getFansLike:(NSString *)likeUid {
|
||||
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];
|
||||
[[self getView] mew_getFansLikeSuccess:isLike];
|
||||
[[self mew_getView] mew_getFansLikeSuccess:isLike];
|
||||
}] uid:uid isLikeUid:likeUid];
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * type = @"1";
|
||||
[Api Mew_AttentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_attentionUserSuccess:targetUid];
|
||||
[Api Mew_AttentionCompletion:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_attentionUserSuccess:targetUid];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
|
||||
} mew_showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type];
|
||||
}
|
||||
|
@@ -16,19 +16,19 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param page 当前页数
|
||||
/// @param pageSize 一页多少个
|
||||
/// @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 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 uid 发起关注的人
|
||||
/// @param page page
|
||||
/// @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 完成
|
||||
@@ -36,13 +36,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param likedUid 被关注的人
|
||||
/// @param ticket ticket
|
||||
/// @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 uid 自己的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 pageNo 当前页数
|
||||
/// @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 channelType channel
|
||||
+ (void)Mew_GetRechargeList:(HttpRequestHelperCompletion)complection
|
||||
+ (void)Mew_GetRechargeList:(MewHttpRequestHelperCompletion)complection
|
||||
channelType:(NSString *)channelType;
|
||||
|
||||
/// 苹果下单
|
||||
@@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param ticket ticket
|
||||
/// @param deviceInfo uuid
|
||||
/// @param clientIp ip地址
|
||||
+ (void)Mew_RequestIAPRecharge:(HttpRequestHelperCompletion)complection
|
||||
+ (void)Mew_RequestIAPRecharge:(MewHttpRequestHelperCompletion)complection
|
||||
chargeProdId:(NSString *)chargeProdId
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket
|
||||
@@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param transcationId 内购的唯一标识符
|
||||
/// @param uid 用户uid
|
||||
/// @param ticket ticket
|
||||
+ (void)Mew_CheckReceipt:(HttpRequestHelperCompletion)complection
|
||||
+ (void)Mew_CheckReceipt:(MewHttpRequestHelperCompletion)complection
|
||||
receipt:(NSString *)receipt
|
||||
chooseEnv:(NSString *)chooseEnv
|
||||
chargeRecordId:(NSString *)chargeRecordId
|
||||
@@ -96,21 +96,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param transcationId 内购的唯一标识符
|
||||
/// @param uid 用户uid
|
||||
/// @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 phone 手机号
|
||||
/// @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 phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @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
|
||||
|
||||
|
@@ -15,17 +15,17 @@
|
||||
/// @param page 当前页数
|
||||
/// @param pageSize 一页多少个
|
||||
/// @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
|
||||
[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 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
|
||||
[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 page page
|
||||
/// @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
|
||||
[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 ticket ticket
|
||||
/// @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
|
||||
[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 uid 自己的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
|
||||
[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 pageNo 当前页数
|
||||
/// @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
|
||||
[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 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
|
||||
[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 deviceInfo uuid
|
||||
/// @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
|
||||
[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 uid 用户uid
|
||||
/// @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
|
||||
[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 完成
|
||||
@@ -112,17 +112,17 @@
|
||||
/// @param transcationId 内购的唯一标识符
|
||||
/// @param uid 用户uid
|
||||
/// @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
|
||||
[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 phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
+ (void)Mew_SetLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd {
|
||||
[self makeRequest:@"acc/pwd/set" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, nil];
|
||||
+ (void)Mew_SetLoingPassword:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd {
|
||||
[self makeRequest:@"acc/pwd/set" method:MewHttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, nil];
|
||||
}
|
||||
|
||||
/// 修改 登录密码
|
||||
@@ -130,8 +130,8 @@
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param pwd 旧密码
|
||||
+ (void)Mew_ModifyLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd {
|
||||
[self makeRequest:@"acc/pwd/modify" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, phone, newPwd, pwd, nil];
|
||||
+ (void)Mew_ModifyLoingPassword:(MewHttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd {
|
||||
[self makeRequest:@"acc/pwd/modify" method:MewHttpRequestHelperMethodPOST completion:completion,__FUNCTION__, phone, newPwd, pwd, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewMineCollectRoomPresenter : BaseMvpPresenter
|
||||
@interface MewMineCollectRoomPresenter : MewBaseMvpPresenter
|
||||
|
||||
/// 获取收藏房间列表
|
||||
/// @param page 当前的页数
|
||||
|
@@ -20,11 +20,11 @@
|
||||
/// @param type 类型:4:个播房;其他:派对房;不传:所有房间
|
||||
- (void)mew_getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state type:(NSString *)type {
|
||||
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"]];
|
||||
[[self getView] mew_fonGetCollectRoomListSuccess:array state:state];
|
||||
[[self mew_getView] mew_fonGetCollectRoomListSuccess:array state:state];
|
||||
} 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];
|
||||
}
|
||||
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/22.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewMineRechargePresenter : BaseMvpPresenter
|
||||
@interface MewMineRechargePresenter : MewBaseMvpPresenter
|
||||
|
||||
/// 获取钱包信息
|
||||
- (void)mew_getUserWalletInfo;
|
||||
|
@@ -23,9 +23,9 @@
|
||||
- (void)mew_getUserWalletInfo {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
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];
|
||||
[[self getView] mew_getUserWalletInfo:model];
|
||||
[[self mew_getView] mew_getUserWalletInfo:model];
|
||||
}] uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
/// 请求内购列表
|
||||
/// @param channel 目前是8
|
||||
- (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];
|
||||
[[self getView] mew_requestRechargeListSucccess:array];
|
||||
[[self mew_getView] mew_requestRechargeListSucccess:array];
|
||||
}] channelType:channel];
|
||||
}
|
||||
|
||||
@@ -46,15 +46,15 @@
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
NSString * deviceInfo = [YYUtility deviceID];
|
||||
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 *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) {
|
||||
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];
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@
|
||||
- (void)mew_checkReceiptWithOrderId:(NSString *)orderId transcationId:(NSString *)transcationId errorToast:(BOOL)errorToast{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api Mew_CheckReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_checkReceiptSuccess:transcationId];
|
||||
[Api Mew_CheckReceipt:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_checkReceiptSuccess:transcationId];
|
||||
}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];
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
- (void)mew_checkReceiptWithData:(NSString *)receipt orderId:(NSString *)orderId transcationId:(NSString *)transcationId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api Mew_CheckReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_checkReceiptSuccess:transcationId];
|
||||
[Api Mew_CheckReceipt:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_checkReceiptSuccess:transcationId];
|
||||
} mew_showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@
|
||||
/// @param transcations 凭据的数组
|
||||
- (void)mew_checkTranscationIds:(NSArray *)transcations {
|
||||
NSString * transcationIdStr = [transcations mewToJSONString];
|
||||
[Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_checkTranscationIdsSuccess];
|
||||
[Api requestCheckTranscationIds:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_checkTranscationIdsSuccess];
|
||||
}] transcationIdStr:transcationIdStr];
|
||||
}
|
||||
|
||||
|
@@ -5,12 +5,12 @@
|
||||
// Created by 触海 on 2023/11/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
@class UserInfoModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewMineSettingPresenter : BaseMvpPresenter
|
||||
@interface MewMineSettingPresenter : MewBaseMvpPresenter
|
||||
/// 获取用户信息
|
||||
- (void)mew_getUserInfo;
|
||||
|
||||
|
@@ -18,8 +18,8 @@
|
||||
#import "Base.h"
|
||||
|
||||
@implementation MewMineSettingPresenter
|
||||
- (id<MewMineSettingProtocol>)getView {
|
||||
return (id<MewMineSettingProtocol>)[super getView];
|
||||
- (id<MewMineSettingProtocol>)mew_getView {
|
||||
return (id<MewMineSettingProtocol>)[super mew_getView];
|
||||
}
|
||||
|
||||
/// 审核模式下的数据源
|
||||
@@ -45,15 +45,15 @@
|
||||
cancelItem.subTitle = @"";
|
||||
cancelItem.type = MewMineSettingItemType_Cancel_Account;
|
||||
NSArray *dataModel = @[phoneItem, loginItem, aboutusItem, cancelItem];
|
||||
[[self getView] mew_getMineSettingDatasourceSuccess:dataModel];
|
||||
[[self mew_getView] mew_getMineSettingDatasourceSuccess:dataModel];
|
||||
}
|
||||
|
||||
/// 获取用户信息
|
||||
- (void)mew_getUserInfo {
|
||||
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];
|
||||
[[self getView] mew_onGetUserInfoSuccess:userInfo];
|
||||
[[self mew_getView] mew_onGetUserInfoSuccess:userInfo];
|
||||
}] uid:uid];
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
- (void)mew_logoutCurrentAccount {
|
||||
/// 判断是否最小化房间
|
||||
AccountModel *model = [[AccountInfoStorage instance] accountModel];
|
||||
[Api Mew_LogoutCurrentAccount:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] mew_logoutCurrentAccountSuccess];
|
||||
[self logout];
|
||||
[Api Mew_LogoutCurrentAccount:[self mew_createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self mew_getView] mew_logoutCurrentAccountSuccess];
|
||||
[self mew_logout];
|
||||
}] access_token:model.access_token];
|
||||
}
|
||||
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by 触海 on 2023/11/9.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "MewBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewMineAboutUsViewController : BaseViewController
|
||||
@interface MewMineAboutUsViewController : MewBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -6,11 +6,11 @@
|
||||
//
|
||||
|
||||
#import "MewMineAboutUsViewController.h"
|
||||
#import "YMWebViewController.h"
|
||||
#import "MewWebViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "YMMacro.h"
|
||||
#import "MewMacro.h"
|
||||
#import "MEWThemeColor.h"
|
||||
#import "Base.h"
|
||||
#import "YYUtility.h"
|
||||
@@ -47,7 +47,7 @@
|
||||
#pragma mark - Action Event
|
||||
/// 跳转到隐私协议
|
||||
- (void)mew_pushPrivacyView:(UITapGestureRecognizer *)tap {
|
||||
YMWebViewController *controller = [[YMWebViewController alloc] init];
|
||||
MewWebViewController *controller = [[MewWebViewController alloc] init];
|
||||
controller.url = URLWithType(kPrivacyURL);
|
||||
[self.navigationController pushViewController:controller animated:NO];
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#import "MewMineLoginPasswordViewController.h"
|
||||
|
||||
#import "MewWebViewController.h"
|
||||
#import "MineLoginPasswordViewController.h"
|
||||
#import "MewMineLoginPasswordViewController.h"
|
||||
// Presenter
|
||||
#import "MewMineSettingProtocol.h"
|
||||
#import "MewMineSettingPresenter.h"
|
||||
|
@@ -5,13 +5,13 @@
|
||||
// Created by 触海 on 2023/11/7.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MewBaseMvpPresenter.h"
|
||||
#import "MewRoomInfoModel.h"
|
||||
@class UserInfoModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewRoomPresenter : BaseMvpPresenter
|
||||
@interface MewRoomPresenter : MewBaseMvpPresenter
|
||||
|
||||
/// 进入房间
|
||||
/// - Parameters:
|
||||
|
@@ -30,15 +30,15 @@
|
||||
|
||||
/// RAC监听用户和房间值的改变
|
||||
[[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;
|
||||
}] 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];
|
||||
[user sendNext:userInfo];
|
||||
[user sendCompleted];
|
||||
@@ -47,7 +47,7 @@
|
||||
}] 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];
|
||||
[room sendNext:roomInfo];
|
||||
[room sendCompleted];
|
||||
@@ -69,9 +69,9 @@
|
||||
/// 云信进房
|
||||
[[NIMSDK sharedSDK].chatroomManager enterChatroom:request completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom, NIMChatroomMember * _Nullable me) {
|
||||
if (error) {
|
||||
[[self getView] enterCurrentRoomFail:error.code];
|
||||
[[self mew_getView] enterCurrentRoomFail:error.code];
|
||||
} else {
|
||||
[[self getView] enterCurrentRoomSuccess:chatroom];
|
||||
[[self mew_getView] enterCurrentRoomSuccess:chatroom];
|
||||
}
|
||||
}];
|
||||
}
|
||||
@@ -117,11 +117,11 @@
|
||||
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];
|
||||
[[self getView] openCurrentRoomSuccess:roomInfo];
|
||||
[[self mew_getView] openCurrentRoomSuccess:roomInfo];
|
||||
} 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];
|
||||
}
|
||||
|
||||
@@ -166,14 +166,14 @@
|
||||
// 送一个人
|
||||
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];
|
||||
receive.sourceType = giftSource;
|
||||
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) {
|
||||
[[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];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user