123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- //
- // 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<outCount; i++)
- {
- objc_property_t property = properties[i];
- const char* char_f =property_getName(property);
- NSString *propertyName = [NSString stringWithUTF8String:char_f];
- id propertyValue = [self valueForKey:(NSString *)propertyName];
- if (propertyValue) [props setObject:propertyValue forKey:propertyName];
-
- }
-
- free(properties);
- return props;
- }
- - (void)setValue:(id)value forUndefinedKey:(NSString *)key {
-
- }
- @end
|