一折买app------返利---------返利宝

YZMANineNineRequestViewModel.m 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // YZMANineNineRequestViewModel.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/22.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "YZMANineNineRequestViewModel.h"
  9. @implementation YZMANineNineRequestViewModel
  10. + (void)requestNineNineGoodListParamGid:(NSInteger)gid success:(void (^)(YZMANineNineModel *))success failure:(void (^)(NSError *))failure {
  11. NSString *urlString = [NSString stringWithFormat:@"%@/api/goods/getGoodlistByGid", BaseURL];
  12. [YZMAHttp post:urlString params:@{@"tab":@"NO_POSTAGE"} success:^(id json) {
  13. YZMANineNineModel *model = [YZMANineNineModel yy_modelWithJSON:json[@"data"]];
  14. success(model);
  15. } failure:^(NSError *error) {
  16. failure(error);
  17. }];
  18. }
  19. + (void)requestNineNineSublistParamType:(NSString *)type success:(void (^)(NSArray *))success failure:(void (^)(NSError *))failure {
  20. NSString *urlString = [NSString stringWithFormat:@"%@/api/channel/sublist", BaseURL];
  21. [YZMAHttp get:urlString params:@{@"type":type} success:^(id json) {
  22. NSArray *arr = [NSArray yy_modelArrayWithClass:[YZMANineNineScrollChannelModel class] json:json[@"data"]];
  23. success(arr);
  24. } failure:^(NSError *error) {
  25. failure(error);
  26. }];
  27. }
  28. + (void)requestNineNineCategoryGoodsParamPage:(NSInteger)page scid:(NSNumber *)scid type:(NSString *)type stype:(NSString *)stype success:(void (^)(NSArray *))success failure:(void (^)(NSError *))failure {
  29. NSString *urlString = [NSString stringWithFormat:@"%@/api/category/categoryGoods", BaseURL];
  30. [YZMAHttp post:urlString params:@{@"page":@(page),@"scid":scid,@"type":type,@"stype":stype} success:^(id json) {
  31. NSArray *arr = [NSArray yy_modelArrayWithClass:[YZMAChildGoodModel class] json:json[@"data"]];
  32. success(arr);
  33. } failure:^(NSError *error) {
  34. failure(error);
  35. }];
  36. }
  37. @end