1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // KBNineNineRequestViewModel.m
- // YouHuiProject
- //
- // Created by xiaoxi on 2018/1/22.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "KBNineNineRequestViewModel.h"
- @implementation KBNineNineRequestViewModel
- + (void)requestNineNineGoodListParamGid:(NSInteger)gid success:(void (^)(KBNineNineModel *))success failure:(void (^)(NSError *))failure {
- NSString *urlString = [NSString stringWithFormat:@"%@/api/goods/getGoodlistByGid", BaseURL];
- [KBHttp post:urlString params:@{@"tab":@"NO_POSTAGE"} success:^(id json) {
- KBNineNineModel *model = [KBNineNineModel yy_modelWithJSON:json[@"data"]];
- success(model);
- } failure:^(NSError *error) {
- failure(error);
- }];
- }
- + (void)requestNineNineSublistParamType:(NSString *)type success:(void (^)(NSArray *))success failure:(void (^)(NSError *))failure {
- NSString *urlString = [NSString stringWithFormat:@"%@/api/channel/sublist", BaseURL];
- [KBHttp get:urlString params:@{@"type":type} success:^(id json) {
- NSArray *arr = [NSArray yy_modelArrayWithClass:[KBNineNineScrollChannelModel class] json:json[@"data"]];
- success(arr);
- } failure:^(NSError *error) {
- failure(error);
- }];
- }
- + (void)requestNineNineCategoryGoodsParamPage:(NSInteger)page scid:(NSNumber *)scid type:(NSString *)type stype:(NSString *)stype success:(void (^)(NSArray *))success failure:(void (^)(NSError *))failure {
- NSString *urlString = [NSString stringWithFormat:@"%@/api/category/categoryGoods", BaseURL];
- [KBHttp post:urlString params:@{@"page":@(page),@"scid":scid,@"type":type,@"stype":stype} success:^(id json) {
- NSArray *arr = [NSArray yy_modelArrayWithClass:[KBChildGoodModel class] json:json[@"data"]];
- success(arr);
- } failure:^(NSError *error) {
- failure(error);
- }];
- }
- @end
|