Files
keyboard/keyBoard/Class/Shop/VM/KBShopVM.h
2025-12-23 14:07:53 +08:00

69 lines
2.6 KiB
Objective-C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// KBShopVM.h
// keyBoard
//
// Created by Mac on 2025/12/9.
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import "KBShopStyleModel.h"
#import "KBShopThemeModel.h"
#import "KBShopThemeDetailModel.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark - Models
typedef void(^KBShopStylesCompletion)(NSArray<KBShopStyleModel *> *_Nullable styles,
NSError *_Nullable error);
typedef void(^KBShopThemesCompletion)(NSArray<KBShopThemeModel *> *_Nullable themes,
NSError *_Nullable error);
typedef void(^KBShopBalanceCompletion)(NSString *_Nullable balance,
NSError *_Nullable error);
typedef void(^KBShopDetailCompletion)(KBShopThemeDetailModel *_Nullable detail,
NSError *_Nullable error);
typedef void(^KBShopPurchaseCompletion)(BOOL success,
NSError *_Nullable error);
typedef void(^KBShopDownloadInfoCompletion)(NSDictionary *_Nullable info,
NSError *_Nullable error);
typedef void(^KBShopRestoreCompletion)(BOOL success,
NSError *_Nullable error);
@interface KBShopVM : NSObject
@property (nonatomic, copy, readonly, nullable) NSArray<KBShopStyleModel *> *styles;
/// 查询全部主题风格
- (void)fetchAllStylesWithCompletion:(KBShopStylesCompletion)completion;
/// 按风格请求主题列表
- (void)fetchThemesForStyleId:(nullable NSString *)styleId
completion:(KBShopThemesCompletion)completion;
/// 查询钱包余额
- (void)fetchWalletBalanceWithCompletion:(KBShopBalanceCompletion)completion;
/// 查询主题详情
- (void)fetchThemeDetailWithId:(nullable NSString *)themeId
completion:(KBShopDetailCompletion)completion;
/// 购买主题
- (void)purchaseThemeWithId:(nullable NSString *)themeId
completion:(KBShopPurchaseCompletion)completion;
/// 获取主题下载信息
- (void)fetchThemeDownloadInfoWithId:(nullable NSString *)themeId
completion:(KBShopDownloadInfoCompletion)completion;
/// 推荐主题列表(用于皮肤详情页底部网格)
- (void)fetchRecommendedThemesWithThemeId:(nullable NSString *)themeId
completion:(KBShopThemesCompletion)completion;
/// 恢复已删除的主题(/themes/restore
- (void)restoreThemeWithId:(nullable NSString *)themeId
completion:(nullable KBShopRestoreCompletion)completion;
@end
NS_ASSUME_NONNULL_END