修改邀请
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#define API_UPDATA_INFO @"/user/updateInfo" // 更新用户
|
#define API_UPDATA_INFO @"/user/updateInfo" // 更新用户
|
||||||
|
|
||||||
#define KB_API_USER_DETAIL @"/user/detail" // 用户详情
|
#define KB_API_USER_DETAIL @"/user/detail" // 用户详情
|
||||||
|
#define API_USER_INVITE_CODE @"/user/inviteCode" // 查询邀请码
|
||||||
#define API_CHARACTER_LIST @"/character/list" // 排行榜角色列表(综合)
|
#define API_CHARACTER_LIST @"/character/list" // 排行榜角色列表(综合)
|
||||||
#define API_NOT_LOGIN_CHARACTER_LIST @"/character/listWithNotLogin" //未登录用户人设列表
|
#define API_NOT_LOGIN_CHARACTER_LIST @"/character/listWithNotLogin" //未登录用户人设列表
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
"Personal" = "Personal";
|
"Personal" = "Personal";
|
||||||
"My Keyboard" = "My Keyboard";
|
"My Keyboard" = "My Keyboard";
|
||||||
"Notice" = "Notice";
|
"Notice" = "Notice";
|
||||||
"Share App" = "Share App";
|
"invite" = "invite";
|
||||||
"Feedback" = "Feedback";
|
"Feedback" = "Feedback";
|
||||||
"E-mail" = "E-mail";
|
"E-mail" = "E-mail";
|
||||||
"Agreement" = "Agreement";
|
"Agreement" = "Agreement";
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
"Personal" = "个人";
|
"Personal" = "个人";
|
||||||
"My Keyboard" = "我的键盘";
|
"My Keyboard" = "我的键盘";
|
||||||
"Notice" = "通知";
|
"Notice" = "通知";
|
||||||
"Share App" = "分享app";
|
"invite" = "邀请";
|
||||||
"Feedback" = "反馈";
|
"Feedback" = "反馈";
|
||||||
"E-mail" = "联系我们";
|
"E-mail" = "联系我们";
|
||||||
"Agreement" = "协议";
|
"Agreement" = "协议";
|
||||||
|
|||||||
@@ -129,6 +129,8 @@
|
|||||||
0498BD8C2EE69E15006CC1D5 /* KBTagItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD8A2EE69E15006CC1D5 /* KBTagItemModel.m */; };
|
0498BD8C2EE69E15006CC1D5 /* KBTagItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD8A2EE69E15006CC1D5 /* KBTagItemModel.m */; };
|
||||||
0498BD8F2EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */; };
|
0498BD8F2EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */; };
|
||||||
0498BD902EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */; };
|
0498BD902EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */; };
|
||||||
|
A1F0C1C22FABCDEF12345678 /* KBInviteCodeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F0C1C12FABCDEF12345678 /* KBInviteCodeModel.m */; };
|
||||||
|
A1F0C1C32FABCDEF12345678 /* KBInviteCodeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F0C1C12FABCDEF12345678 /* KBInviteCodeModel.m */; };
|
||||||
0498BDDA2EE7ECEA006CC1D5 /* WJXEventSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BDD82EE7ECEA006CC1D5 /* WJXEventSource.m */; };
|
0498BDDA2EE7ECEA006CC1D5 /* WJXEventSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BDD82EE7ECEA006CC1D5 /* WJXEventSource.m */; };
|
||||||
0498BDDE2EE81508006CC1D5 /* KBShopVM.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BDDD2EE81508006CC1D5 /* KBShopVM.m */; };
|
0498BDDE2EE81508006CC1D5 /* KBShopVM.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BDDD2EE81508006CC1D5 /* KBShopVM.m */; };
|
||||||
0498BDE12EEA87C9006CC1D5 /* KBShopStyleModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BDE02EEA87C8006CC1D5 /* KBShopStyleModel.m */; };
|
0498BDE12EEA87C9006CC1D5 /* KBShopStyleModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BDE02EEA87C8006CC1D5 /* KBShopStyleModel.m */; };
|
||||||
@@ -455,6 +457,8 @@
|
|||||||
0498BD8A2EE69E15006CC1D5 /* KBTagItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBTagItemModel.m; sourceTree = "<group>"; };
|
0498BD8A2EE69E15006CC1D5 /* KBTagItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBTagItemModel.m; sourceTree = "<group>"; };
|
||||||
0498BD8D2EE6A3BD006CC1D5 /* KBMyMainModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBMyMainModel.h; sourceTree = "<group>"; };
|
0498BD8D2EE6A3BD006CC1D5 /* KBMyMainModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBMyMainModel.h; sourceTree = "<group>"; };
|
||||||
0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBMyMainModel.m; sourceTree = "<group>"; };
|
0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBMyMainModel.m; sourceTree = "<group>"; };
|
||||||
|
A1F0C1C02FABCDEF12345678 /* KBInviteCodeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBInviteCodeModel.h; sourceTree = "<group>"; };
|
||||||
|
A1F0C1C12FABCDEF12345678 /* KBInviteCodeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBInviteCodeModel.m; sourceTree = "<group>"; };
|
||||||
0498BDD72EE7ECEA006CC1D5 /* WJXEventSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WJXEventSource.h; sourceTree = "<group>"; };
|
0498BDD72EE7ECEA006CC1D5 /* WJXEventSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WJXEventSource.h; sourceTree = "<group>"; };
|
||||||
0498BDD82EE7ECEA006CC1D5 /* WJXEventSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WJXEventSource.m; sourceTree = "<group>"; };
|
0498BDD82EE7ECEA006CC1D5 /* WJXEventSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WJXEventSource.m; sourceTree = "<group>"; };
|
||||||
0498BDDC2EE81508006CC1D5 /* KBShopVM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBShopVM.h; sourceTree = "<group>"; };
|
0498BDDC2EE81508006CC1D5 /* KBShopVM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBShopVM.h; sourceTree = "<group>"; };
|
||||||
@@ -1342,6 +1346,8 @@
|
|||||||
0498BD8A2EE69E15006CC1D5 /* KBTagItemModel.m */,
|
0498BD8A2EE69E15006CC1D5 /* KBTagItemModel.m */,
|
||||||
0498BD8D2EE6A3BD006CC1D5 /* KBMyMainModel.h */,
|
0498BD8D2EE6A3BD006CC1D5 /* KBMyMainModel.h */,
|
||||||
0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */,
|
0498BD8E2EE6A3BD006CC1D5 /* KBMyMainModel.m */,
|
||||||
|
A1F0C1C02FABCDEF12345678 /* KBInviteCodeModel.h */,
|
||||||
|
A1F0C1C12FABCDEF12345678 /* KBInviteCodeModel.m */,
|
||||||
7ECBD0E320F971D0FBEDD7BC /* KBMyTheme.h */,
|
7ECBD0E320F971D0FBEDD7BC /* KBMyTheme.h */,
|
||||||
180D662EC4DB3A7FFF83FF18 /* KBMyTheme.m */,
|
180D662EC4DB3A7FFF83FF18 /* KBMyTheme.m */,
|
||||||
A1F0C1A02F1234567890ABCD /* KBConsumptionRecord.h */,
|
A1F0C1A02F1234567890ABCD /* KBConsumptionRecord.h */,
|
||||||
@@ -1941,6 +1947,7 @@
|
|||||||
04FC95672EB0546C007BD342 /* KBKey.m in Sources */,
|
04FC95672EB0546C007BD342 /* KBKey.m in Sources */,
|
||||||
A1B2C3F42EB35A9900000001 /* KBFullAccessGuideView.m in Sources */,
|
A1B2C3F42EB35A9900000001 /* KBFullAccessGuideView.m in Sources */,
|
||||||
0498BD8F2EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */,
|
0498BD8F2EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */,
|
||||||
|
A1F0C1C22FABCDEF12345678 /* KBInviteCodeModel.m in Sources */,
|
||||||
04FEDC222F00020000999999 /* KBKeyboardSubscriptionProduct.m in Sources */,
|
04FEDC222F00020000999999 /* KBKeyboardSubscriptionProduct.m in Sources */,
|
||||||
0450AA742EF013D000B6AF06 /* KBEmojiCollectionCell.m in Sources */,
|
0450AA742EF013D000B6AF06 /* KBEmojiCollectionCell.m in Sources */,
|
||||||
550CB2630FA4A7B4B9782EFA /* KBMyTheme.m in Sources */,
|
550CB2630FA4A7B4B9782EFA /* KBMyTheme.m in Sources */,
|
||||||
@@ -2004,6 +2011,7 @@
|
|||||||
04A9FE1B2EB892460020DB6D /* KBLocalizationManager.m in Sources */,
|
04A9FE1B2EB892460020DB6D /* KBLocalizationManager.m in Sources */,
|
||||||
048908BC2EBE1FCB00FABA60 /* BaseViewController.m in Sources */,
|
048908BC2EBE1FCB00FABA60 /* BaseViewController.m in Sources */,
|
||||||
0498BD902EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */,
|
0498BD902EE6A3BD006CC1D5 /* KBMyMainModel.m in Sources */,
|
||||||
|
A1F0C1C32FABCDEF12345678 /* KBInviteCodeModel.m in Sources */,
|
||||||
471CAD3574798685B72ADD55 /* KBMyTheme.m in Sources */,
|
471CAD3574798685B72ADD55 /* KBMyTheme.m in Sources */,
|
||||||
A1F0C1B12F1234567890ABCD /* KBConsumptionRecord.m in Sources */,
|
A1F0C1B12F1234567890ABCD /* KBConsumptionRecord.m in Sources */,
|
||||||
A1F0C1B22F1234567890ABCD /* KBConsumptionRecordCell.m in Sources */,
|
A1F0C1B22F1234567890ABCD /* KBConsumptionRecordCell.m in Sources */,
|
||||||
|
|||||||
20
keyBoard/Class/Me/M/KBInviteCodeModel.h
Normal file
20
keyBoard/Class/Me/M/KBInviteCodeModel.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// KBInviteCodeModel.h
|
||||||
|
// keyBoard
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/// 邀请码信息
|
||||||
|
@interface KBInviteCodeModel : NSObject
|
||||||
|
@property (nonatomic, copy, nullable) NSString *inviteCode;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *h5Link;
|
||||||
|
@property (nonatomic, assign) NSInteger status;
|
||||||
|
@property (nonatomic, assign) NSInteger usedCount;
|
||||||
|
@property (nonatomic, strong, nullable) NSNumber *maxUses;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *expiresAt;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
17
keyBoard/Class/Me/M/KBInviteCodeModel.m
Normal file
17
keyBoard/Class/Me/M/KBInviteCodeModel.m
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// KBInviteCodeModel.m
|
||||||
|
// keyBoard
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "KBInviteCodeModel.h"
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
|
||||||
|
@implementation KBInviteCodeModel
|
||||||
|
|
||||||
|
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
|
||||||
|
return @{
|
||||||
|
@"inviteCode": @"code"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
self.data = @[
|
self.data = @[
|
||||||
@[@{ @"title": KBLocalized(@"Consumption record"), @"icon": @"my_record_icon", @"color": @(0x60A3FF),@"id":@"8" }],
|
@[@{ @"title": KBLocalized(@"Consumption record"), @"icon": @"my_record_icon", @"color": @(0x60A3FF),@"id":@"8" }],
|
||||||
@[@{ @"title": KBLocalized(@"Notice"), @"icon": @"my_notice_icon", @"color": @(0x60A3FF),@"id":@"1" }],
|
@[@{ @"title": KBLocalized(@"Notice"), @"icon": @"my_notice_icon", @"color": @(0x60A3FF),@"id":@"1" }],
|
||||||
@[@{ @"title": KBLocalized(@"Share App"), @"icon": @"my_share_icon", @"color": @(0xF5A623),@"id":@"2" }],
|
@[@{ @"title": KBLocalized(@"invite"), @"icon": @"my_share_icon", @"color": @(0xF5A623),@"id":@"2" }],
|
||||||
@[@{ @"title": KBLocalized(@"Feedback"), @"icon": @"my_feedback_icon", @"color": @(0xB06AFD),@"id":@"3" },
|
@[@{ @"title": KBLocalized(@"Feedback"), @"icon": @"my_feedback_icon", @"color": @(0xB06AFD),@"id":@"3" },
|
||||||
@{ @"title": KBLocalized(@"E-mail"), @"icon": @"my_email_icon", @"color": @(0xFF8A65),@"id":@"4" },
|
@{ @"title": KBLocalized(@"E-mail"), @"icon": @"my_email_icon", @"color": @(0xFF8A65),@"id":@"4" },
|
||||||
@{ @"title": KBLocalized(@"Agreement"), @"icon": @"my_agreement_icon", @"color": @(0x4CD964),@"id":@"5" },
|
@{ @"title": KBLocalized(@"Agreement"), @"icon": @"my_agreement_icon", @"color": @(0x4CD964),@"id":@"5" },
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#import "KBCharacter.h"
|
#import "KBCharacter.h"
|
||||||
#import "KBMyTheme.h"
|
#import "KBMyTheme.h"
|
||||||
#import "KBConsumptionRecord.h"
|
#import "KBConsumptionRecord.h"
|
||||||
|
#import "KBInviteCodeModel.h"
|
||||||
@class KBUser;
|
@class KBUser;
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
@@ -28,11 +29,14 @@ typedef void(^KBMyPurchasedThemesCompletion)(NSArray<KBMyTheme *> *_Nullable the
|
|||||||
typedef void(^KBDeleteThemesCompletion)(BOOL success, NSError *_Nullable error);
|
typedef void(^KBDeleteThemesCompletion)(BOOL success, NSError *_Nullable error);
|
||||||
typedef void(^KBSubmitFeedbackCompletion)(BOOL success, NSError *_Nullable error);
|
typedef void(^KBSubmitFeedbackCompletion)(BOOL success, NSError *_Nullable error);
|
||||||
typedef void(^KBMyPurchaseRecordCompletion)(NSArray<KBConsumptionRecord *> *_Nullable records, NSError *_Nullable error);
|
typedef void(^KBMyPurchaseRecordCompletion)(NSArray<KBConsumptionRecord *> *_Nullable records, NSError *_Nullable error);
|
||||||
|
typedef void(^KBMyInviteCodeCompletion)(KBInviteCodeModel *_Nullable inviteCode, NSError *_Nullable error);
|
||||||
|
|
||||||
@interface KBMyVM : NSObject
|
@interface KBMyVM : NSObject
|
||||||
|
|
||||||
/// 获取当前用户详情(/user/detail)
|
/// 获取当前用户详情(/user/detail)
|
||||||
- (void)fetchUserDetailWithCompletion:(KBMyUserDetailCompletion)completion;
|
- (void)fetchUserDetailWithCompletion:(KBMyUserDetailCompletion)completion;
|
||||||
|
/// 查询邀请码(/user/inviteCode)
|
||||||
|
- (void)fetchInviteCodeWithCompletion:(KBMyInviteCodeCompletion)completion;
|
||||||
|
|
||||||
/// 用户人设列表(/character/listByUser)
|
/// 用户人设列表(/character/listByUser)
|
||||||
- (void)fetchCharacterListByUserWithCompletion:(KBCharacterListCompletion)completion;
|
- (void)fetchCharacterListByUserWithCompletion:(KBCharacterListCompletion)completion;
|
||||||
|
|||||||
@@ -51,6 +51,31 @@ NSString * const KBUserCharacterDeletedNotification = @"KBUserCharacterDeletedNo
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)fetchInviteCodeWithCompletion:(KBMyInviteCodeCompletion)completion {
|
||||||
|
[[KBNetworkManager shared] GET:API_USER_INVITE_CODE
|
||||||
|
parameters:nil
|
||||||
|
headers:nil
|
||||||
|
autoShowBusinessError:NO
|
||||||
|
completion:^(NSDictionary *jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||||
|
if (error) {
|
||||||
|
if (completion) completion(nil, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
id dataObj = jsonOrData[KBData] ?: jsonOrData[@"data"];
|
||||||
|
if (![dataObj isKindOfClass:[NSDictionary class]]) {
|
||||||
|
NSError *e = [NSError errorWithDomain:KBNetworkErrorDomain
|
||||||
|
code:KBNetworkErrorInvalidResponse
|
||||||
|
userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"Invalid response")}];
|
||||||
|
if (completion) completion(nil, e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
KBInviteCodeModel *model = [KBInviteCodeModel mj_objectWithKeyValues:(NSDictionary *)dataObj];
|
||||||
|
if (completion) completion(model, nil);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)fetchCharacterListByUserWithCompletion:(KBCharacterListCompletion)completion{
|
- (void)fetchCharacterListByUserWithCompletion:(KBCharacterListCompletion)completion{
|
||||||
[[KBNetworkManager shared] GET:KB_API_CHARACTER_LISTBYUSER
|
[[KBNetworkManager shared] GET:KB_API_CHARACTER_LISTBYUSER
|
||||||
parameters:nil
|
parameters:nil
|
||||||
|
|||||||
Reference in New Issue
Block a user