1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // YZMANineNineRequestViewModel.m
- // YouHuiProject
- //
- // Created by xiaoxi on 2018/1/22.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "YZMANineNineRequestViewModel.h"
- @implementation YZMANineNineRequestViewModel
- + (void)requestNineNineGoodListParamGid:(NSInteger)gid success:(void (^)(YZMANineNineModel *))success failure:(void (^)(NSError *))failure {
- NSString *urlString = [NSString stringWithFormat:@"%@/api/goods/getGoodlistByGid", BaseURL];
- [YZMAHttp post:urlString params:@{@"tab":@"NO_POSTAGE"} success:^(id json) {
- YZMANineNineModel *model = [YZMANineNineModel 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];
- [YZMAHttp get:urlString params:@{@"type":type} success:^(id json) {
- NSArray *arr = [NSArray yy_modelArrayWithClass:[YZMANineNineScrollChannelModel 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];
- [YZMAHttp post:urlString params:@{@"page":@(page),@"scid":scid,@"type":type,@"stype":stype} success:^(id json) {
- NSArray *arr = [NSArray yy_modelArrayWithClass:[YZMAChildGoodModel class] json:json[@"data"]];
- success(arr);
- } failure:^(NSError *error) {
- failure(error);
- }];
- }
- @end
|