修改接口

This commit is contained in:
2025-12-23 14:07:53 +08:00
parent 2e1c261775
commit 262eb57b36
5 changed files with 75 additions and 70 deletions

View File

@@ -375,7 +375,7 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
- (void)fetchRecommendedThemes {
__weak typeof(self) weakSelf = self;
[self.shopVM fetchRecommendedThemesWithCompletion:^(NSArray<KBShopThemeModel *> * _Nullable themes, NSError * _Nullable error) {
[self.shopVM fetchRecommendedThemesWithThemeId:self.themeId completion:^(NSArray<KBShopThemeModel *> * _Nullable themes, NSError * _Nullable error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
NSLog(@"[KBSkinDetailVC] fetch recommended failed: %@", error);

View File

@@ -56,7 +56,8 @@ typedef void(^KBShopRestoreCompletion)(BOOL success,
completion:(KBShopDownloadInfoCompletion)completion;
/// 推荐主题列表(用于皮肤详情页底部网格)
- (void)fetchRecommendedThemesWithCompletion:(KBShopThemesCompletion)completion;
- (void)fetchRecommendedThemesWithThemeId:(nullable NSString *)themeId
completion:(KBShopThemesCompletion)completion;
/// 恢复已删除的主题(/themes/restore
- (void)restoreThemeWithId:(nullable NSString *)themeId

View File

@@ -179,9 +179,14 @@
}];
}
- (void)fetchRecommendedThemesWithCompletion:(KBShopThemesCompletion)completion {
- (void)fetchRecommendedThemesWithThemeId:(nullable NSString *)themeId
completion:(KBShopThemesCompletion)completion {
NSMutableDictionary *params = [NSMutableDictionary dictionary];
if (themeId.length > 0) {
params[@"themeId"] = [self kb_themeIdParamFromString:themeId];
}
[[KBNetworkManager shared] GET:API_THEME_RECOMMENDED
parameters:nil
parameters:(params.count > 0 ? params : nil)
headers:nil
autoShowBusinessError:NO
completion:^(NSDictionary * _Nullable json,