// // DetailRequestModel.m // YouHuiProject // // Created by 小花 on 2018/5/22. // Copyright © 2018年 kuxuan. All rights reserved. // #import "DetailRequestModel.h" @implementation DetailRequestModel - (instancetype)initWithId:(NSString *)good_id is_coupon:(NSString *)is_coupon coupon_price:(NSString *)coupon_price price:(NSString *)price discount_price:(NSString *)discount_price commission_rate:(NSString *)commission_rate coupon_start_time:(NSString *)coupon_start_time coupon_end_time:(NSString *)coupon_end_time { self = [super init]; if (self) { self.goods_id = good_id; self.is_coupon = is_coupon; self.coupon_price = coupon_price; self.price = price; self.discount_price = discount_price; self.commission_rate = commission_rate; self.coupon_start_time = coupon_start_time; self.coupon_end_time = coupon_end_time; } return self; } - (instancetype)initWithChildModel:(DRChildGoodModel *)model { self = [super init]; if (self) { self.goods_id = model.goods_id; self.is_coupon = model.is_coupon; self.coupon_price = model.coupon_price; self.price = model.price; self.discount_price = model.discount_price; self.commission_rate = model.commission_rate; self.coupon_start_time = model.coupon_start_time; self.coupon_end_time = model.coupon_end_time; } return self; } - (instancetype)initWithBuyLimitModel:(DRBuyLimitGoodModel *)model { self = [super init]; if (self) { self.goods_id = model.goods_id; self.is_coupon = model.is_coupon; self.coupon_price = model.coupon_price; self.price = model.price; self.discount_price = model.discount_price; self.commission_rate = model.commission_rate; self.coupon_start_time = model.coupon_start_time; self.coupon_end_time = model.coupon_end_time; } return self; } - (instancetype)initWithCommunityDetailModel:(DRCommunityDetailModel *)model{ self = [super init]; if (self) { self.goods_id = model.goods_id; self.is_coupon = model.is_coupon; self.coupon_price = model.coupon_price; self.price = model.price; self.discount_price = model.discount_price; self.commission_rate = model.commission_rate; self.coupon_start_time = model.coupon_start_time; self.coupon_end_time = model.coupon_end_time; } return self; } //Model 到字典 - (NSDictionary *)modelToDictionary { NSMutableDictionary *props = [NSMutableDictionary dictionary]; unsigned int outCount, i; objc_property_t *properties = class_copyPropertyList([self class], &outCount); for (i = 0; i