// // WeatherModel.m // Temperature // // Created by RD on 2023/4/26. // #import "WeatherModel.h" @implementation WeatherModel + (void)rds_getWeatherFinished:(void (^)(WeatherModel * _Nonnull, NSError * _Nonnull))finished{ [RDSDemoApiHelper rds_getWeatherSuccess:^(id responseObject) { if ([responseObject[@"code"] intValue] == 0) { NSDictionary *data = responseObject[@"data"]; WeatherModel *weather = [WeatherModel mj_objectWithKeyValues:data]; BLOCK_SAFE_RUN(finished,weather, nil) } else{ NSError *error = [NSError errorWithDomain:responseObject[@"message"] code:[responseObject[@"code"] intValue] userInfo:nil]; BLOCK_SAFE_RUN(finished,nil, error) } } failure:^(NSError *error) { }]; } @end @implementation Location @end @implementation Now @end