2025-12-03 13:31:02 +08:00
|
|
|
|
//
|
|
|
|
|
|
// KBMyVM.h
|
|
|
|
|
|
// keyBoard
|
|
|
|
|
|
//
|
|
|
|
|
|
// Created by Mac on 2025/12/3.
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2025-12-04 13:37:11 +08:00
|
|
|
|
#import "KBCharacter.h"
|
2025-12-11 13:40:32 +08:00
|
|
|
|
#import "KBMyTheme.h"
|
2025-12-03 20:14:14 +08:00
|
|
|
|
@class KBUser;
|
|
|
|
|
|
|
2025-12-03 13:31:02 +08:00
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
2025-12-04 16:59:59 +08:00
|
|
|
|
/// 用户人设发生变更(例如从“我的键盘”中删除)时的进程内通知。
|
|
|
|
|
|
/// userInfo:
|
|
|
|
|
|
/// @"characterId" : NSNumber(NSInteger) 被删除或变更的人设 id
|
|
|
|
|
|
extern NSString * const KBUserCharacterDeletedNotification;
|
|
|
|
|
|
|
2025-12-03 20:14:14 +08:00
|
|
|
|
typedef void(^KBMyUserDetailCompletion)(KBUser *_Nullable user, NSError *_Nullable error);
|
2025-12-04 13:37:11 +08:00
|
|
|
|
typedef void(^KBCharacterListCompletion)(NSArray<KBCharacter *> *characterArray, NSError *_Nullable error);
|
|
|
|
|
|
typedef void(^KBUpLoadAvatarCompletion)(BOOL success, NSError * _Nullable error);
|
|
|
|
|
|
typedef void(^KBUpdateUserInfoCompletion)(BOOL success, NSError * _Nullable error);
|
2025-12-04 16:18:43 +08:00
|
|
|
|
typedef void(^KBUpdateCharacterSortCompletion)(BOOL success, NSError * _Nullable error);
|
2025-12-04 16:41:33 +08:00
|
|
|
|
typedef void(^KBDeleteUserCharacterCompletion)(BOOL success, NSError * _Nullable error);
|
2025-12-11 13:40:32 +08:00
|
|
|
|
typedef void(^KBMyPurchasedThemesCompletion)(NSArray<KBMyTheme *> *_Nullable themes, NSError *_Nullable error);
|
2025-12-11 18:36:14 +08:00
|
|
|
|
typedef void(^KBDeleteThemesCompletion)(BOOL success, NSError *_Nullable error);
|
2025-12-03 20:14:14 +08:00
|
|
|
|
|
2025-12-03 13:31:02 +08:00
|
|
|
|
@interface KBMyVM : NSObject
|
2025-12-03 20:14:14 +08:00
|
|
|
|
|
|
|
|
|
|
/// 获取当前用户详情(/user/detail)
|
|
|
|
|
|
- (void)fetchUserDetailWithCompletion:(KBMyUserDetailCompletion)completion;
|
|
|
|
|
|
|
2025-12-04 13:37:11 +08:00
|
|
|
|
/// 用户人设列表(/character/listByUser)
|
|
|
|
|
|
- (void)fetchCharacterListByUserWithCompletion:(KBCharacterListCompletion)completion;
|
2025-12-11 13:40:32 +08:00
|
|
|
|
/// 已购买主题列表(/themes/purchased)
|
|
|
|
|
|
- (void)fetchPurchasedThemesWithCompletion:(KBMyPurchasedThemesCompletion)completion;
|
2025-12-11 18:36:14 +08:00
|
|
|
|
/// 批量删除主题(/user-themes/batch-delete)
|
|
|
|
|
|
- (void)deletePurchasedThemesWithThemeIds:(NSArray<NSNumber *> *)themeIds
|
|
|
|
|
|
completion:(KBDeleteThemesCompletion)completion;
|
2025-12-04 15:44:43 +08:00
|
|
|
|
/// 更新用户人设排序
|
2025-12-04 16:18:43 +08:00
|
|
|
|
- (void)updateUserCharacterSortWithSortArray:(NSArray<NSNumber *> *)sortArray
|
|
|
|
|
|
completion:(KBUpdateCharacterSortCompletion)completion;
|
2025-12-04 16:41:33 +08:00
|
|
|
|
/// 删除用户人设(/character/delUserCharacter)
|
|
|
|
|
|
- (void)deleteUserCharacterWithId:(NSNumber *)characterId
|
|
|
|
|
|
completion:(KBDeleteUserCharacterCompletion)completion;
|
2025-12-04 15:44:43 +08:00
|
|
|
|
|
2025-12-04 13:37:11 +08:00
|
|
|
|
|
|
|
|
|
|
/// 上传头像
|
|
|
|
|
|
- (void)upLoadAvatarWithData:(NSData *)avatarData completion:(KBUpLoadAvatarCompletion)completion;
|
|
|
|
|
|
|
2025-12-04 14:07:12 +08:00
|
|
|
|
/// 更新用户信息 -(头像、用户名、性别)
|
2025-12-04 13:37:11 +08:00
|
|
|
|
- (void)updateUserInfo:(KBUser *)user completion:(KBUpdateUserInfoCompletion)completion;
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-03 20:14:14 +08:00
|
|
|
|
/// 退出登录
|
2025-12-03 13:31:02 +08:00
|
|
|
|
- (void)logout;
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|