Commit 6cf9cecc authored by Sandy's avatar Sandy

首页collectionView的调整等

parent 0fed7605
......@@ -17,7 +17,28 @@
1913833B1CAB96D4005F6440 /* OrderTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 191383391CAB96D4005F6440 /* OrderTableViewCell.xib */; };
1913833D1CAB9DC2005F6440 /* OrderCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1913833C1CAB9DC2005F6440 /* OrderCellView.xib */; };
191383401CAB9DD4005F6440 /* OrderCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1913833F1CAB9DD4005F6440 /* OrderCellView.m */; };
191AEDE21CBB561700F5E535 /* RequstBodyCommodityListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEDE11CBB561700F5E535 /* RequstBodyCommodityListModel.m */; };
191AEE0F1CBB818600F5E535 /* UserInfoBaseClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE001CBB818600F5E535 /* UserInfoBaseClass.m */; };
191AEE101CBB818600F5E535 /* UserInfoCertificate.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE021CBB818600F5E535 /* UserInfoCertificate.m */; };
191AEE111CBB818600F5E535 /* UserInfoCreateInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE041CBB818600F5E535 /* UserInfoCreateInfo.m */; };
191AEE121CBB818600F5E535 /* UserInfoLastModifyInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE061CBB818600F5E535 /* UserInfoLastModifyInfo.m */; };
191AEE131CBB818600F5E535 /* UserInfoLoginControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE081CBB818600F5E535 /* UserInfoLoginControl.m */; };
191AEE141CBB818600F5E535 /* UserInfoOwnerOrg.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE0A1CBB818600F5E535 /* UserInfoOwnerOrg.m */; };
191AEE151CBB818600F5E535 /* UserInfoPasswordControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE0C1CBB818600F5E535 /* UserInfoPasswordControl.m */; };
191AEE161CBB818600F5E535 /* UserInfoShop.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE0E1CBB818600F5E535 /* UserInfoShop.m */; };
191AEE191CBB83EF00F5E535 /* UserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE181CBB83EF00F5E535 /* UserInfo.m */; };
191AEE2A1CBB86C600F5E535 /* CommotityListBrand.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE1C1CBB86C600F5E535 /* CommotityListBrand.m */; };
191AEE2B1CBB86C600F5E535 /* CommotityListCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE1E1CBB86C600F5E535 /* CommotityListCategory.m */; };
191AEE2C1CBB86C600F5E535 /* CommotityListCreateInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE201CBB86C600F5E535 /* CommotityListCreateInfo.m */; };
191AEE2D1CBB86C600F5E535 /* CommotityListLastModifyInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE221CBB86C600F5E535 /* CommotityListLastModifyInfo.m */; };
191AEE2E1CBB86C600F5E535 /* CommotityListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE241CBB86C600F5E535 /* CommotityListModel.m */; };
191AEE2F1CBB86C600F5E535 /* CommotityListOperator.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE261CBB86C600F5E535 /* CommotityListOperator.m */; };
191AEE301CBB86C600F5E535 /* CommotityListUpper.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE281CBB86C600F5E535 /* CommotityListUpper.m */; };
191AEE3D1CBB937200F5E535 /* Conditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE331CBB937200F5E535 /* Conditions.m */; };
191AEE3E1CBB937200F5E535 /* Defintion.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE361CBB937200F5E535 /* Defintion.m */; };
191AEE3F1CBB937200F5E535 /* Orders.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE381CBB937200F5E535 /* Orders.m */; };
191AEE401CBB937200F5E535 /* Parameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE3A1CBB937200F5E535 /* Parameter.m */; };
191AEE411CBB937200F5E535 /* Parameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE3C1CBB937200F5E535 /* Parameters.m */; };
191AEE471CBB9E5A00F5E535 /* CommotityRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE461CBB9E5A00F5E535 /* CommotityRequestModel.m */; };
1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */; };
1929F16F1C9FCFA6000E9B26 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1929F16E1C9FCFA6000E9B26 /* Assets.xcassets */; };
1929F17C1CA0DD77000E9B26 /* HomeTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F17B1CA0DD77000E9B26 /* HomeTopView.m */; };
......@@ -88,7 +109,6 @@
199BC7D31C9BBE0100E4E0B8 /* StoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 199BC7D21C9BBE0100E4E0B8 /* StoreViewController.m */; };
199BC7D61C9BBE0D00E4E0B8 /* MineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 199BC7D51C9BBE0D00E4E0B8 /* MineViewController.m */; };
199BC7D91C9BBE1A00E4E0B8 /* MassageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 199BC7D81C9BBE1A00E4E0B8 /* MassageViewController.m */; };
19A1C8411CA27564003E5DD9 /* UserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 19A1C8401CA27564003E5DD9 /* UserInfo.m */; };
19ADD3671CA3A16C00EE6E5A /* CoverShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 19ADD3661CA3A16C00EE6E5A /* CoverShadowView.m */; };
19ADD36A1CA3AC9D00EE6E5A /* UIButton+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 19ADD3691CA3AC9D00EE6E5A /* UIButton+Category.m */; };
19ADD36E1CA3B88A00EE6E5A /* CommodityListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 19ADD36D1CA3B88A00EE6E5A /* CommodityListViewController.m */; };
......@@ -212,8 +232,52 @@
1913833C1CAB9DC2005F6440 /* OrderCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OrderCellView.xib; sourceTree = "<group>"; };
1913833E1CAB9DD4005F6440 /* OrderCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderCellView.h; sourceTree = "<group>"; };
1913833F1CAB9DD4005F6440 /* OrderCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OrderCellView.m; sourceTree = "<group>"; };
191AEDE01CBB561700F5E535 /* RequstBodyCommodityListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequstBodyCommodityListModel.h; sourceTree = "<group>"; };
191AEDE11CBB561700F5E535 /* RequstBodyCommodityListModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RequstBodyCommodityListModel.m; sourceTree = "<group>"; };
191AEDFE1CBB818600F5E535 /* DataModels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataModels.h; sourceTree = "<group>"; };
191AEDFF1CBB818600F5E535 /* UserInfoBaseClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoBaseClass.h; sourceTree = "<group>"; };
191AEE001CBB818600F5E535 /* UserInfoBaseClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoBaseClass.m; sourceTree = "<group>"; };
191AEE011CBB818600F5E535 /* UserInfoCertificate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoCertificate.h; sourceTree = "<group>"; };
191AEE021CBB818600F5E535 /* UserInfoCertificate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoCertificate.m; sourceTree = "<group>"; };
191AEE031CBB818600F5E535 /* UserInfoCreateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoCreateInfo.h; sourceTree = "<group>"; };
191AEE041CBB818600F5E535 /* UserInfoCreateInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoCreateInfo.m; sourceTree = "<group>"; };
191AEE051CBB818600F5E535 /* UserInfoLastModifyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoLastModifyInfo.h; sourceTree = "<group>"; };
191AEE061CBB818600F5E535 /* UserInfoLastModifyInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoLastModifyInfo.m; sourceTree = "<group>"; };
191AEE071CBB818600F5E535 /* UserInfoLoginControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoLoginControl.h; sourceTree = "<group>"; };
191AEE081CBB818600F5E535 /* UserInfoLoginControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoLoginControl.m; sourceTree = "<group>"; };
191AEE091CBB818600F5E535 /* UserInfoOwnerOrg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoOwnerOrg.h; sourceTree = "<group>"; };
191AEE0A1CBB818600F5E535 /* UserInfoOwnerOrg.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoOwnerOrg.m; sourceTree = "<group>"; };
191AEE0B1CBB818600F5E535 /* UserInfoPasswordControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoPasswordControl.h; sourceTree = "<group>"; };
191AEE0C1CBB818600F5E535 /* UserInfoPasswordControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoPasswordControl.m; sourceTree = "<group>"; };
191AEE0D1CBB818600F5E535 /* UserInfoShop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfoShop.h; sourceTree = "<group>"; };
191AEE0E1CBB818600F5E535 /* UserInfoShop.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfoShop.m; sourceTree = "<group>"; };
191AEE171CBB83EF00F5E535 /* UserInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfo.h; sourceTree = "<group>"; };
191AEE181CBB83EF00F5E535 /* UserInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfo.m; sourceTree = "<group>"; };
191AEE1B1CBB86C600F5E535 /* CommotityListBrand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListBrand.h; sourceTree = "<group>"; };
191AEE1C1CBB86C600F5E535 /* CommotityListBrand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListBrand.m; sourceTree = "<group>"; };
191AEE1D1CBB86C600F5E535 /* CommotityListCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListCategory.h; sourceTree = "<group>"; };
191AEE1E1CBB86C600F5E535 /* CommotityListCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListCategory.m; sourceTree = "<group>"; };
191AEE1F1CBB86C600F5E535 /* CommotityListCreateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListCreateInfo.h; sourceTree = "<group>"; };
191AEE201CBB86C600F5E535 /* CommotityListCreateInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListCreateInfo.m; sourceTree = "<group>"; };
191AEE211CBB86C600F5E535 /* CommotityListLastModifyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListLastModifyInfo.h; sourceTree = "<group>"; };
191AEE221CBB86C600F5E535 /* CommotityListLastModifyInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListLastModifyInfo.m; sourceTree = "<group>"; };
191AEE231CBB86C600F5E535 /* CommotityListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListModel.h; sourceTree = "<group>"; };
191AEE241CBB86C600F5E535 /* CommotityListModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListModel.m; sourceTree = "<group>"; };
191AEE251CBB86C600F5E535 /* CommotityListOperator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListOperator.h; sourceTree = "<group>"; };
191AEE261CBB86C600F5E535 /* CommotityListOperator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListOperator.m; sourceTree = "<group>"; };
191AEE271CBB86C600F5E535 /* CommotityListUpper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListUpper.h; sourceTree = "<group>"; };
191AEE281CBB86C600F5E535 /* CommotityListUpper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListUpper.m; sourceTree = "<group>"; };
191AEE321CBB937200F5E535 /* Conditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Conditions.h; sourceTree = "<group>"; };
191AEE331CBB937200F5E535 /* Conditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Conditions.m; sourceTree = "<group>"; };
191AEE341CBB937200F5E535 /* DataModels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataModels.h; sourceTree = "<group>"; };
191AEE351CBB937200F5E535 /* Defintion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Defintion.h; sourceTree = "<group>"; };
191AEE361CBB937200F5E535 /* Defintion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Defintion.m; sourceTree = "<group>"; };
191AEE371CBB937200F5E535 /* Orders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Orders.h; sourceTree = "<group>"; };
191AEE381CBB937200F5E535 /* Orders.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Orders.m; sourceTree = "<group>"; };
191AEE391CBB937200F5E535 /* Parameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parameter.h; sourceTree = "<group>"; };
191AEE3A1CBB937200F5E535 /* Parameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Parameter.m; sourceTree = "<group>"; };
191AEE3B1CBB937200F5E535 /* Parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parameters.h; sourceTree = "<group>"; };
191AEE3C1CBB937200F5E535 /* Parameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Parameters.m; sourceTree = "<group>"; };
191AEE451CBB9E5A00F5E535 /* CommotityRequestModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityRequestModel.h; sourceTree = "<group>"; };
191AEE461CBB9E5A00F5E535 /* CommotityRequestModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityRequestModel.m; sourceTree = "<group>"; };
1929F16B1C9FCB62000E9B26 /* NSDictionary+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Category.h"; sourceTree = "<group>"; };
1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Category.m"; sourceTree = "<group>"; };
1929F16E1C9FCFA6000E9B26 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
......@@ -334,8 +398,6 @@
199BC7D51C9BBE0D00E4E0B8 /* MineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineViewController.m; sourceTree = "<group>"; };
199BC7D71C9BBE1A00E4E0B8 /* MassageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MassageViewController.h; sourceTree = "<group>"; };
199BC7D81C9BBE1A00E4E0B8 /* MassageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MassageViewController.m; sourceTree = "<group>"; };
19A1C83F1CA27564003E5DD9 /* UserInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfo.h; sourceTree = "<group>"; };
19A1C8401CA27564003E5DD9 /* UserInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInfo.m; sourceTree = "<group>"; };
19ADD3651CA3A16C00EE6E5A /* CoverShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoverShadowView.h; sourceTree = "<group>"; };
19ADD3661CA3A16C00EE6E5A /* CoverShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoverShadowView.m; sourceTree = "<group>"; };
19ADD3681CA3AC9D00EE6E5A /* UIButton+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Category.h"; sourceTree = "<group>"; };
......@@ -567,12 +629,11 @@
1900A3441CB6305100B2B7C4 /* Commodity */ = {
isa = PBXGroup;
children = (
191AEE1A1CBB86C600F5E535 /* CommodityListModel */,
1900A3481CB6306600B2B7C4 /* HotBrandModel.h */,
1900A3491CB6306600B2B7C4 /* HotBrandModel.m */,
1946DC981CB7542D00AC6557 /* CatgoryModel.h */,
1946DC991CB7542D00AC6557 /* CatgoryModel.m */,
191AEDE01CBB561700F5E535 /* RequstBodyCommodityListModel.h */,
191AEDE11CBB561700F5E535 /* RequstBodyCommodityListModel.m */,
);
path = Commodity;
sourceTree = "<group>";
......@@ -620,6 +681,71 @@
path = Order;
sourceTree = "<group>";
};
191AEDFD1CBB818600F5E535 /* UserInfoModel */ = {
isa = PBXGroup;
children = (
191AEDFE1CBB818600F5E535 /* DataModels.h */,
191AEDFF1CBB818600F5E535 /* UserInfoBaseClass.h */,
191AEE001CBB818600F5E535 /* UserInfoBaseClass.m */,
191AEE011CBB818600F5E535 /* UserInfoCertificate.h */,
191AEE021CBB818600F5E535 /* UserInfoCertificate.m */,
191AEE031CBB818600F5E535 /* UserInfoCreateInfo.h */,
191AEE041CBB818600F5E535 /* UserInfoCreateInfo.m */,
191AEE051CBB818600F5E535 /* UserInfoLastModifyInfo.h */,
191AEE061CBB818600F5E535 /* UserInfoLastModifyInfo.m */,
191AEE071CBB818600F5E535 /* UserInfoLoginControl.h */,
191AEE081CBB818600F5E535 /* UserInfoLoginControl.m */,
191AEE091CBB818600F5E535 /* UserInfoOwnerOrg.h */,
191AEE0A1CBB818600F5E535 /* UserInfoOwnerOrg.m */,
191AEE0B1CBB818600F5E535 /* UserInfoPasswordControl.h */,
191AEE0C1CBB818600F5E535 /* UserInfoPasswordControl.m */,
191AEE0D1CBB818600F5E535 /* UserInfoShop.h */,
191AEE0E1CBB818600F5E535 /* UserInfoShop.m */,
);
path = UserInfoModel;
sourceTree = "<group>";
};
191AEE1A1CBB86C600F5E535 /* CommodityListModel */ = {
isa = PBXGroup;
children = (
191AEE1B1CBB86C600F5E535 /* CommotityListBrand.h */,
191AEE1C1CBB86C600F5E535 /* CommotityListBrand.m */,
191AEE1D1CBB86C600F5E535 /* CommotityListCategory.h */,
191AEE1E1CBB86C600F5E535 /* CommotityListCategory.m */,
191AEE1F1CBB86C600F5E535 /* CommotityListCreateInfo.h */,
191AEE201CBB86C600F5E535 /* CommotityListCreateInfo.m */,
191AEE211CBB86C600F5E535 /* CommotityListLastModifyInfo.h */,
191AEE221CBB86C600F5E535 /* CommotityListLastModifyInfo.m */,
191AEE231CBB86C600F5E535 /* CommotityListModel.h */,
191AEE241CBB86C600F5E535 /* CommotityListModel.m */,
191AEE251CBB86C600F5E535 /* CommotityListOperator.h */,
191AEE261CBB86C600F5E535 /* CommotityListOperator.m */,
191AEE271CBB86C600F5E535 /* CommotityListUpper.h */,
191AEE281CBB86C600F5E535 /* CommotityListUpper.m */,
);
path = CommodityListModel;
sourceTree = "<group>";
};
191AEE311CBB936A00F5E535 /* RequestModels */ = {
isa = PBXGroup;
children = (
191AEE451CBB9E5A00F5E535 /* CommotityRequestModel.h */,
191AEE461CBB9E5A00F5E535 /* CommotityRequestModel.m */,
191AEE321CBB937200F5E535 /* Conditions.h */,
191AEE331CBB937200F5E535 /* Conditions.m */,
191AEE341CBB937200F5E535 /* DataModels.h */,
191AEE351CBB937200F5E535 /* Defintion.h */,
191AEE361CBB937200F5E535 /* Defintion.m */,
191AEE371CBB937200F5E535 /* Orders.h */,
191AEE381CBB937200F5E535 /* Orders.m */,
191AEE391CBB937200F5E535 /* Parameter.h */,
191AEE3A1CBB937200F5E535 /* Parameter.m */,
191AEE3B1CBB937200F5E535 /* Parameters.h */,
191AEE3C1CBB937200F5E535 /* Parameters.m */,
);
path = RequestModels;
sourceTree = "<group>";
};
1940D2DE1C9A56730080678C = {
isa = PBXGroup;
children = (
......@@ -932,12 +1058,14 @@
19A1C83E1CA27403003E5DD9 /* Global */ = {
isa = PBXGroup;
children = (
19A1C83F1CA27564003E5DD9 /* UserInfo.h */,
19A1C8401CA27564003E5DD9 /* UserInfo.m */,
191AEE311CBB936A00F5E535 /* RequestModels */,
191AEDFD1CBB818600F5E535 /* UserInfoModel */,
19ADD3651CA3A16C00EE6E5A /* CoverShadowView.h */,
19ADD3661CA3A16C00EE6E5A /* CoverShadowView.m */,
19632DAC1CB38FFC0024A8A1 /* HTTPCilent.h */,
19632DAD1CB38FFC0024A8A1 /* HTTPCilent.m */,
191AEE171CBB83EF00F5E535 /* UserInfo.h */,
191AEE181CBB83EF00F5E535 /* UserInfo.m */,
);
path = Global;
sourceTree = "<group>";
......@@ -1578,9 +1706,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
191AEE101CBB818600F5E535 /* UserInfoCertificate.m in Sources */,
19DCCBC91C9AA0450072C3BF /* NSNull+OVNatural.m in Sources */,
191AEE141CBB818600F5E535 /* UserInfoOwnerOrg.m in Sources */,
195EB1E01CA5292600E298BB /* AddCommodityFooterCollectionReusableView.m in Sources */,
191AEDE21CBB561700F5E535 /* RequstBodyCommodityListModel.m in Sources */,
19DCCB791C9A9EB30072C3BF /* IBTWebViewController.m in Sources */,
19ADD3671CA3A16C00EE6E5A /* CoverShadowView.m in Sources */,
199BC7BE1C9B045B00E4E0B8 /* RigistViewController.m in Sources */,
......@@ -1591,10 +1720,13 @@
1979752E1CA90D6C00407E3F /* CommodityManagementViewController.m in Sources */,
19DCCBE21C9AA0450072C3BF /* JTOptionsViewController.m in Sources */,
1940D31D1C9A57640080678C /* AppDelegate.m in Sources */,
191AEE411CBB937200F5E535 /* Parameters.m in Sources */,
191AEE131CBB818600F5E535 /* UserInfoLoginControl.m in Sources */,
1929F17C1CA0DD77000E9B26 /* HomeTopView.m in Sources */,
19DCCBD21C9AA0450072C3BF /* UIResponder+FirstResponder.m in Sources */,
19DCCB5A1C9A9EB30072C3BF /* IBTAudioRecorder.m in Sources */,
19DCCBD11C9AA0450072C3BF /* UILabel+SizeCalculate.m in Sources */,
191AEE301CBB86C600F5E535 /* CommotityListUpper.m in Sources */,
19DCCB751C9A9EB30072C3BF /* IBTUITextField.m in Sources */,
197975481CAA4DAD00407E3F /* CommodityMutipleSelectBottomView.m in Sources */,
199B4D741CABE4B300451E0E /* NSString+Category.m in Sources */,
......@@ -1607,25 +1739,31 @@
19DCCBFB1C9AA2180072C3BF /* UIAlertView+Blocks.m in Sources */,
19DCCBDE1C9AA0450072C3BF /* ICRBaseViewController.m in Sources */,
19DCCBDA1C9AA0450072C3BF /* GXFBottomView.m in Sources */,
191AEE471CBB9E5A00F5E535 /* CommotityRequestModel.m in Sources */,
191AEE2B1CBB86C600F5E535 /* CommotityListCategory.m in Sources */,
19DCCBCF1C9AA0450072C3BF /* UIImage+Helper.m in Sources */,
19DCCB721C9A9EB30072C3BF /* IBTUINavigationController.m in Sources */,
19DCCB641C9A9EB30072C3BF /* IBTTableViewUserInfo.m in Sources */,
19DCCBD91C9AA0450072C3BF /* IBTTextFieldCell.m in Sources */,
191AEE3E1CBB937200F5E535 /* Defintion.m in Sources */,
19DCCB741C9A9EB30072C3BF /* IBTUISearchBar.m in Sources */,
19DCCBDB1C9AA0450072C3BF /* GXFButtonAndLineView.m in Sources */,
1929F1841CA0EA64000E9B26 /* MoneyView.m in Sources */,
19A1C8411CA27564003E5DD9 /* UserInfo.m in Sources */,
191AEE111CBB818600F5E535 /* UserInfoCreateInfo.m in Sources */,
19ADD3801CA4D38B00EE6E5A /* SortView.m in Sources */,
19DCCBC81C9AA0450072C3BF /* NSMutableArray+SafeInsert.m in Sources */,
19DCCBFA1C9AA2180072C3BF /* UIActionSheet+Blocks.m in Sources */,
19DCCBCA1C9AA0450072C3BF /* NSString+TrimmingAdditions.m in Sources */,
197975341CA90DB300407E3F /* CommodityManagementTopView.m in Sources */,
191AEE0F1CBB818600F5E535 /* UserInfoBaseClass.m in Sources */,
1929F1811CA0E597000E9B26 /* UIView+Category.m in Sources */,
19DCCB631C9A9EB30072C3BF /* IBTTableViewSectionInfo.m in Sources */,
19DCCB5D1C9A9EB30072C3BF /* IBTImagePicker.m in Sources */,
19DCCBCB1C9AA0450072C3BF /* UIApplication+CheckFirstRun.m in Sources */,
19DCCBD01C9AA0450072C3BF /* UIImage+WaterMark.m in Sources */,
19DCCB761C9A9EB30072C3BF /* IBTUIView.m in Sources */,
191AEE191CBB83EF00F5E535 /* UserInfo.m in Sources */,
191AEE161CBB818600F5E535 /* UserInfoShop.m in Sources */,
19DCCB691C9A9EB30072C3BF /* IBTObject.m in Sources */,
19DCCBDD1C9AA0450072C3BF /* IBTFileManager.m in Sources */,
1900A3411CB6059000B2B7C4 /* introductionViewController.m in Sources */,
......@@ -1636,6 +1774,7 @@
199B4D971CAE701F00451E0E /* StoreManagermentViewController.m in Sources */,
1913833A1CAB96D4005F6440 /* OrderTableViewCell.m in Sources */,
191383401CAB9DD4005F6440 /* OrderCellView.m in Sources */,
191AEE3F1CBB937200F5E535 /* Orders.m in Sources */,
199BC7C71C9BA2A300E4E0B8 /* ResetPasswordViewController.m in Sources */,
19DCCB5B1C9A9EB30072C3BF /* IBTAudioServicesManager.m in Sources */,
199BC7C31C9B9B7700E4E0B8 /* UIButton+countDown.m in Sources */,
......@@ -1643,6 +1782,7 @@
19DCCBE61C9AA0450072C3BF /* ICRCheckBox.m in Sources */,
1929F1921CA11472000E9B26 /* HomeCollectionViewCell.m in Sources */,
19ADD38A1CA4E4BD00EE6E5A /* AddCommodityHeaderView.m in Sources */,
191AEE2A1CBB86C600F5E535 /* CommotityListBrand.m in Sources */,
199BC7CC1C9BA5BA00E4E0B8 /* NextResetPasswordViewController.m in Sources */,
19DCCB591C9A9EB30072C3BF /* IBTAudioController.m in Sources */,
199BC7B61C9AD52200E4E0B8 /* ToLoginViewController.m in Sources */,
......@@ -1650,6 +1790,7 @@
19DCCB661C9A9EB30072C3BF /* IBTCommon.m in Sources */,
197975421CAA23BC00407E3F /* UITableView+Category.m in Sources */,
19DCCB611C9A9EB30072C3BF /* IBTTableViewCellInfo.m in Sources */,
191AEE121CBB818600F5E535 /* UserInfoLastModifyInfo.m in Sources */,
1979753A1CA9260C00407E3F /* CommodityManagementSortView.m in Sources */,
19DCCB701C9A9EB30072C3BF /* IBTUIControl.m in Sources */,
199B4D8C1CAE688400451E0E /* SeeLogistics.m in Sources */,
......@@ -1660,6 +1801,8 @@
19DCCB771C9A9EB30072C3BF /* IBTUIViewController.m in Sources */,
19632DAE1CB38FFC0024A8A1 /* HTTPCilent.m in Sources */,
19DCCB6D1C9A9EB30072C3BF /* IBTTableView.m in Sources */,
191AEE2D1CBB86C600F5E535 /* CommotityListLastModifyInfo.m in Sources */,
191AEE3D1CBB937200F5E535 /* Conditions.m in Sources */,
19DCCB731C9A9EB30072C3BF /* IBTUIScrollView.m in Sources */,
199BC7D91C9BBE1A00E4E0B8 /* MassageViewController.m in Sources */,
1979754D1CAB6E1300407E3F /* JavenMultipleViewWithHeader.m in Sources */,
......@@ -1676,18 +1819,22 @@
19DCCBEF1C9AA1D50072C3BF /* QueryOrder.m in Sources */,
19DCCB5E1C9A9EB30072C3BF /* IBTModel.m in Sources */,
19DCCBD51C9AA0450072C3BF /* UITableViewCell+Helper.m in Sources */,
191AEE2C1CBB86C600F5E535 /* CommotityListCreateInfo.m in Sources */,
19DCCBE01C9AA0450072C3BF /* JTOptionCell.m in Sources */,
19DCCBE11C9AA0450072C3BF /* JTOptionsEntity.m in Sources */,
19ADD36A1CA3AC9D00EE6E5A /* UIButton+Category.m in Sources */,
1940D2EC1C9A56730080678C /* main.m in Sources */,
19DCCBF91C9AA2180072C3BF /* RIButtonItem.m in Sources */,
191AEE151CBB818600F5E535 /* UserInfoPasswordControl.m in Sources */,
19DCCBD61C9AA0450072C3BF /* UIView+FindUIViewController.m in Sources */,
199BC7A11C9AA7DF00E4E0B8 /* HomeViewController.m in Sources */,
19632DA41CB350F80024A8A1 /* StoreQRCodeViewController.m in Sources */,
197975451CAA2FAB00407E3F /* ManagementViewController.m in Sources */,
19DCCBF01C9AA1D50072C3BF /* GTOCommonTools.m in Sources */,
19DCCBF11C9AA1D50072C3BF /* ICRUserUtil.m in Sources */,
191AEE2E1CBB86C600F5E535 /* CommotityListModel.m in Sources */,
19DCCB6C1C9A9EB30072C3BF /* IBTTabBarController.m in Sources */,
191AEE401CBB937200F5E535 /* Parameter.m in Sources */,
19632DB11CB39B190024A8A1 /* SelectPhotoView.m in Sources */,
19DCCB621C9A9EB30072C3BF /* IBTTableViewInfo.m in Sources */,
19ADD38E1CA4EC1000EE6E5A /* AddCommodityHeaderCollectionReusableView.m in Sources */,
......@@ -1709,6 +1856,7 @@
19DCCBDC1C9AA0450072C3BF /* IBTDatePickerViewController.m in Sources */,
19DCCB781C9A9EB30072C3BF /* IBTWebProgressBar.m in Sources */,
19DCCBFE1C9AA2A90072C3BF /* ICRDataBaseController.m in Sources */,
191AEE2F1CBB86C600F5E535 /* CommotityListOperator.m in Sources */,
19ADD36E1CA3B88A00EE6E5A /* CommodityListViewController.m in Sources */,
19DCCBD41C9AA0450072C3BF /* UITabBarItem+Universal.m in Sources */,
19DCCBE51C9AA0450072C3BF /* ICRFunctionItemControl.m in Sources */,
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection0.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection0@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection1@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection2@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection3.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection3@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection4.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection4@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection5.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection5@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection6.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection6@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection7.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection7@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "homeCollection8.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "homeCollection8@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
//
// CommotityListBrand.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class CommotityListLastModifyInfo, CommotityListCreateInfo;
@interface CommotityListBrand : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *brandDescription;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) CommotityListLastModifyInfo *lastModifyInfo;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, strong) NSString *location;
@property (nonatomic, assign) double order;
@property (nonatomic, strong) NSString *logo;
@property (nonatomic, strong) CommotityListCreateInfo *createInfo;
@property (nonatomic, strong) NSString *website;
@property (nonatomic, strong) NSString *name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityListBrand.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityListBrand.h"
#import "CommotityListLastModifyInfo.h"
#import "CommotityListCreateInfo.h"
NSString *const kCommotityListBrandUuid = @"uuid";
NSString *const kCommotityListBrandDescription = @"description";
NSString *const kCommotityListBrandState = @"state";
NSString *const kCommotityListBrandVersion = @"version";
NSString *const kCommotityListBrandDomain = @"domain";
NSString *const kCommotityListBrandLastModifyInfo = @"lastModifyInfo";
NSString *const kCommotityListBrandCode = @"code";
NSString *const kCommotityListBrandLocation = @"location";
NSString *const kCommotityListBrandOrder = @"order";
NSString *const kCommotityListBrandLogo = @"logo";
NSString *const kCommotityListBrandCreateInfo = @"createInfo";
NSString *const kCommotityListBrandWebsite = @"website";
NSString *const kCommotityListBrandName = @"name";
@interface CommotityListBrand ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityListBrand
@synthesize uuid = _uuid;
@synthesize brandDescription = _brandDescription;
@synthesize state = _state;
@synthesize version = _version;
@synthesize domain = _domain;
@synthesize lastModifyInfo = _lastModifyInfo;
@synthesize code = _code;
@synthesize location = _location;
@synthesize order = _order;
@synthesize logo = _logo;
@synthesize createInfo = _createInfo;
@synthesize website = _website;
@synthesize name = _name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.uuid = [self objectOrNilForKey:kCommotityListBrandUuid fromDictionary:dict];
self.brandDescription = [self objectOrNilForKey:kCommotityListBrandDescription fromDictionary:dict];
self.state = [self objectOrNilForKey:kCommotityListBrandState fromDictionary:dict];
self.version = [[self objectOrNilForKey:kCommotityListBrandVersion fromDictionary:dict] doubleValue];
self.domain = [self objectOrNilForKey:kCommotityListBrandDomain fromDictionary:dict];
self.lastModifyInfo = [CommotityListLastModifyInfo modelObjectWithDictionary:[dict objectForKey:kCommotityListBrandLastModifyInfo]];
self.code = [self objectOrNilForKey:kCommotityListBrandCode fromDictionary:dict];
self.location = [self objectOrNilForKey:kCommotityListBrandLocation fromDictionary:dict];
self.order = [[self objectOrNilForKey:kCommotityListBrandOrder fromDictionary:dict] doubleValue];
self.logo = [self objectOrNilForKey:kCommotityListBrandLogo fromDictionary:dict];
self.createInfo = [CommotityListCreateInfo modelObjectWithDictionary:[dict objectForKey:kCommotityListBrandCreateInfo]];
self.website = [self objectOrNilForKey:kCommotityListBrandWebsite fromDictionary:dict];
self.name = [self objectOrNilForKey:kCommotityListBrandName fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.uuid forKey:kCommotityListBrandUuid];
[mutableDict setValue:self.brandDescription forKey:kCommotityListBrandDescription];
[mutableDict setValue:self.state forKey:kCommotityListBrandState];
[mutableDict setValue:[NSNumber numberWithDouble:self.version] forKey:kCommotityListBrandVersion];
[mutableDict setValue:self.domain forKey:kCommotityListBrandDomain];
[mutableDict setValue:[self.lastModifyInfo dictionaryRepresentation] forKey:kCommotityListBrandLastModifyInfo];
[mutableDict setValue:self.code forKey:kCommotityListBrandCode];
[mutableDict setValue:self.location forKey:kCommotityListBrandLocation];
[mutableDict setValue:[NSNumber numberWithDouble:self.order] forKey:kCommotityListBrandOrder];
[mutableDict setValue:self.logo forKey:kCommotityListBrandLogo];
[mutableDict setValue:[self.createInfo dictionaryRepresentation] forKey:kCommotityListBrandCreateInfo];
[mutableDict setValue:self.website forKey:kCommotityListBrandWebsite];
[mutableDict setValue:self.name forKey:kCommotityListBrandName];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.uuid = [aDecoder decodeObjectForKey:kCommotityListBrandUuid];
self.brandDescription = [aDecoder decodeObjectForKey:kCommotityListBrandDescription];
self.state = [aDecoder decodeObjectForKey:kCommotityListBrandState];
self.version = [aDecoder decodeDoubleForKey:kCommotityListBrandVersion];
self.domain = [aDecoder decodeObjectForKey:kCommotityListBrandDomain];
self.lastModifyInfo = [aDecoder decodeObjectForKey:kCommotityListBrandLastModifyInfo];
self.code = [aDecoder decodeObjectForKey:kCommotityListBrandCode];
self.location = [aDecoder decodeObjectForKey:kCommotityListBrandLocation];
self.order = [aDecoder decodeDoubleForKey:kCommotityListBrandOrder];
self.logo = [aDecoder decodeObjectForKey:kCommotityListBrandLogo];
self.createInfo = [aDecoder decodeObjectForKey:kCommotityListBrandCreateInfo];
self.website = [aDecoder decodeObjectForKey:kCommotityListBrandWebsite];
self.name = [aDecoder decodeObjectForKey:kCommotityListBrandName];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_uuid forKey:kCommotityListBrandUuid];
[aCoder encodeObject:_brandDescription forKey:kCommotityListBrandDescription];
[aCoder encodeObject:_state forKey:kCommotityListBrandState];
[aCoder encodeDouble:_version forKey:kCommotityListBrandVersion];
[aCoder encodeObject:_domain forKey:kCommotityListBrandDomain];
[aCoder encodeObject:_lastModifyInfo forKey:kCommotityListBrandLastModifyInfo];
[aCoder encodeObject:_code forKey:kCommotityListBrandCode];
[aCoder encodeObject:_location forKey:kCommotityListBrandLocation];
[aCoder encodeDouble:_order forKey:kCommotityListBrandOrder];
[aCoder encodeObject:_logo forKey:kCommotityListBrandLogo];
[aCoder encodeObject:_createInfo forKey:kCommotityListBrandCreateInfo];
[aCoder encodeObject:_website forKey:kCommotityListBrandWebsite];
[aCoder encodeObject:_name forKey:kCommotityListBrandName];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityListBrand *copy = [[CommotityListBrand alloc] init];
if (copy) {
copy.uuid = [self.uuid copyWithZone:zone];
copy.brandDescription = [self.brandDescription copyWithZone:zone];
copy.state = [self.state copyWithZone:zone];
copy.version = self.version;
copy.domain = [self.domain copyWithZone:zone];
copy.lastModifyInfo = [self.lastModifyInfo copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
copy.location = [self.location copyWithZone:zone];
copy.order = self.order;
copy.logo = [self.logo copyWithZone:zone];
copy.createInfo = [self.createInfo copyWithZone:zone];
copy.website = [self.website copyWithZone:zone];
copy.name = [self.name copyWithZone:zone];
}
return copy;
}
@end
//
// CommotityListCategory.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class CommotityListUpper, CommotityListLastModifyInfo, CommotityListCreateInfo;
@interface CommotityListCategory : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *categoryDescription;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) CommotityListUpper *upper;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) NSString *path;
@property (nonatomic, strong) CommotityListLastModifyInfo *lastModifyInfo;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, assign) double order;
@property (nonatomic, assign) double level;
@property (nonatomic, strong) NSString *pictures;
@property (nonatomic, strong) CommotityListCreateInfo *createInfo;
@property (nonatomic, strong) NSString *name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityListCategory.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityListCategory.h"
#import "CommotityListUpper.h"
#import "CommotityListLastModifyInfo.h"
#import "CommotityListCreateInfo.h"
NSString *const kCommotityListCategoryUuid = @"uuid";
NSString *const kCommotityListCategoryDescription = @"description";
NSString *const kCommotityListCategoryState = @"state";
NSString *const kCommotityListCategoryVersion = @"version";
NSString *const kCommotityListCategoryUpper = @"upper";
NSString *const kCommotityListCategoryDomain = @"domain";
NSString *const kCommotityListCategoryPath = @"path";
NSString *const kCommotityListCategoryLastModifyInfo = @"lastModifyInfo";
NSString *const kCommotityListCategoryCode = @"code";
NSString *const kCommotityListCategoryOrder = @"order";
NSString *const kCommotityListCategoryLevel = @"level";
NSString *const kCommotityListCategoryPictures = @"pictures";
NSString *const kCommotityListCategoryCreateInfo = @"createInfo";
NSString *const kCommotityListCategoryName = @"name";
@interface CommotityListCategory ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityListCategory
@synthesize uuid = _uuid;
@synthesize categoryDescription = _categoryDescription;
@synthesize state = _state;
@synthesize version = _version;
@synthesize upper = _upper;
@synthesize domain = _domain;
@synthesize path = _path;
@synthesize lastModifyInfo = _lastModifyInfo;
@synthesize code = _code;
@synthesize order = _order;
@synthesize level = _level;
@synthesize pictures = _pictures;
@synthesize createInfo = _createInfo;
@synthesize name = _name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.uuid = [self objectOrNilForKey:kCommotityListCategoryUuid fromDictionary:dict];
self.categoryDescription = [self objectOrNilForKey:kCommotityListCategoryDescription fromDictionary:dict];
self.state = [self objectOrNilForKey:kCommotityListCategoryState fromDictionary:dict];
self.version = [[self objectOrNilForKey:kCommotityListCategoryVersion fromDictionary:dict] doubleValue];
self.upper = [CommotityListUpper modelObjectWithDictionary:[dict objectForKey:kCommotityListCategoryUpper]];
self.domain = [self objectOrNilForKey:kCommotityListCategoryDomain fromDictionary:dict];
self.path = [self objectOrNilForKey:kCommotityListCategoryPath fromDictionary:dict];
self.lastModifyInfo = [CommotityListLastModifyInfo modelObjectWithDictionary:[dict objectForKey:kCommotityListCategoryLastModifyInfo]];
self.code = [self objectOrNilForKey:kCommotityListCategoryCode fromDictionary:dict];
self.order = [[self objectOrNilForKey:kCommotityListCategoryOrder fromDictionary:dict] doubleValue];
self.level = [[self objectOrNilForKey:kCommotityListCategoryLevel fromDictionary:dict] doubleValue];
self.pictures = [self objectOrNilForKey:kCommotityListCategoryPictures fromDictionary:dict];
self.createInfo = [CommotityListCreateInfo modelObjectWithDictionary:[dict objectForKey:kCommotityListCategoryCreateInfo]];
self.name = [self objectOrNilForKey:kCommotityListCategoryName fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.uuid forKey:kCommotityListCategoryUuid];
[mutableDict setValue:self.categoryDescription forKey:kCommotityListCategoryDescription];
[mutableDict setValue:self.state forKey:kCommotityListCategoryState];
[mutableDict setValue:[NSNumber numberWithDouble:self.version] forKey:kCommotityListCategoryVersion];
[mutableDict setValue:[self.upper dictionaryRepresentation] forKey:kCommotityListCategoryUpper];
[mutableDict setValue:self.domain forKey:kCommotityListCategoryDomain];
[mutableDict setValue:self.path forKey:kCommotityListCategoryPath];
[mutableDict setValue:[self.lastModifyInfo dictionaryRepresentation] forKey:kCommotityListCategoryLastModifyInfo];
[mutableDict setValue:self.code forKey:kCommotityListCategoryCode];
[mutableDict setValue:[NSNumber numberWithDouble:self.order] forKey:kCommotityListCategoryOrder];
[mutableDict setValue:[NSNumber numberWithDouble:self.level] forKey:kCommotityListCategoryLevel];
[mutableDict setValue:self.pictures forKey:kCommotityListCategoryPictures];
[mutableDict setValue:[self.createInfo dictionaryRepresentation] forKey:kCommotityListCategoryCreateInfo];
[mutableDict setValue:self.name forKey:kCommotityListCategoryName];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.uuid = [aDecoder decodeObjectForKey:kCommotityListCategoryUuid];
self.categoryDescription = [aDecoder decodeObjectForKey:kCommotityListCategoryDescription];
self.state = [aDecoder decodeObjectForKey:kCommotityListCategoryState];
self.version = [aDecoder decodeDoubleForKey:kCommotityListCategoryVersion];
self.upper = [aDecoder decodeObjectForKey:kCommotityListCategoryUpper];
self.domain = [aDecoder decodeObjectForKey:kCommotityListCategoryDomain];
self.path = [aDecoder decodeObjectForKey:kCommotityListCategoryPath];
self.lastModifyInfo = [aDecoder decodeObjectForKey:kCommotityListCategoryLastModifyInfo];
self.code = [aDecoder decodeObjectForKey:kCommotityListCategoryCode];
self.order = [aDecoder decodeDoubleForKey:kCommotityListCategoryOrder];
self.level = [aDecoder decodeDoubleForKey:kCommotityListCategoryLevel];
self.pictures = [aDecoder decodeObjectForKey:kCommotityListCategoryPictures];
self.createInfo = [aDecoder decodeObjectForKey:kCommotityListCategoryCreateInfo];
self.name = [aDecoder decodeObjectForKey:kCommotityListCategoryName];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_uuid forKey:kCommotityListCategoryUuid];
[aCoder encodeObject:_categoryDescription forKey:kCommotityListCategoryDescription];
[aCoder encodeObject:_state forKey:kCommotityListCategoryState];
[aCoder encodeDouble:_version forKey:kCommotityListCategoryVersion];
[aCoder encodeObject:_upper forKey:kCommotityListCategoryUpper];
[aCoder encodeObject:_domain forKey:kCommotityListCategoryDomain];
[aCoder encodeObject:_path forKey:kCommotityListCategoryPath];
[aCoder encodeObject:_lastModifyInfo forKey:kCommotityListCategoryLastModifyInfo];
[aCoder encodeObject:_code forKey:kCommotityListCategoryCode];
[aCoder encodeDouble:_order forKey:kCommotityListCategoryOrder];
[aCoder encodeDouble:_level forKey:kCommotityListCategoryLevel];
[aCoder encodeObject:_pictures forKey:kCommotityListCategoryPictures];
[aCoder encodeObject:_createInfo forKey:kCommotityListCategoryCreateInfo];
[aCoder encodeObject:_name forKey:kCommotityListCategoryName];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityListCategory *copy = [[CommotityListCategory alloc] init];
if (copy) {
copy.uuid = [self.uuid copyWithZone:zone];
copy.categoryDescription = [self.categoryDescription copyWithZone:zone];
copy.state = [self.state copyWithZone:zone];
copy.version = self.version;
copy.upper = [self.upper copyWithZone:zone];
copy.domain = [self.domain copyWithZone:zone];
copy.path = [self.path copyWithZone:zone];
copy.lastModifyInfo = [self.lastModifyInfo copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
copy.order = self.order;
copy.level = self.level;
copy.pictures = [self.pictures copyWithZone:zone];
copy.createInfo = [self.createInfo copyWithZone:zone];
copy.name = [self.name copyWithZone:zone];
}
return copy;
}
@end
//
// CommotityListCreateInfo.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class CommotityListOperator;
@interface CommotityListCreateInfo : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) CommotityListOperator *operator;
@property (nonatomic, assign) double time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityListCreateInfo.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityListCreateInfo.h"
#import "CommotityListOperator.h"
NSString *const kCommotityListCreateInfoOperator = @"operator";
NSString *const kCommotityListCreateInfoTime = @"time";
@interface CommotityListCreateInfo ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityListCreateInfo
@synthesize operator = _operator;
@synthesize time = _time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operator = [CommotityListOperator modelObjectWithDictionary:[dict objectForKey:kCommotityListCreateInfoOperator]];
self.time = [[self objectOrNilForKey:kCommotityListCreateInfoTime fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.operator dictionaryRepresentation] forKey:kCommotityListCreateInfoOperator];
[mutableDict setValue:[NSNumber numberWithDouble:self.time] forKey:kCommotityListCreateInfoTime];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operator = [aDecoder decodeObjectForKey:kCommotityListCreateInfoOperator];
self.time = [aDecoder decodeDoubleForKey:kCommotityListCreateInfoTime];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operator forKey:kCommotityListCreateInfoOperator];
[aCoder encodeDouble:_time forKey:kCommotityListCreateInfoTime];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityListCreateInfo *copy = [[CommotityListCreateInfo alloc] init];
if (copy) {
copy.operator = [self.operator copyWithZone:zone];
copy.time = self.time;
}
return copy;
}
@end
//
// CommotityListLastModifyInfo.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class CommotityListOperator;
@interface CommotityListLastModifyInfo : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) CommotityListOperator *operator;
@property (nonatomic, assign) double time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityListLastModifyInfo.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityListLastModifyInfo.h"
#import "CommotityListOperator.h"
NSString *const kCommotityListLastModifyInfoOperator = @"operator";
NSString *const kCommotityListLastModifyInfoTime = @"time";
@interface CommotityListLastModifyInfo ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityListLastModifyInfo
@synthesize operator = _operator;
@synthesize time = _time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operator = [CommotityListOperator modelObjectWithDictionary:[dict objectForKey:kCommotityListLastModifyInfoOperator]];
self.time = [[self objectOrNilForKey:kCommotityListLastModifyInfoTime fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.operator dictionaryRepresentation] forKey:kCommotityListLastModifyInfoOperator];
[mutableDict setValue:[NSNumber numberWithDouble:self.time] forKey:kCommotityListLastModifyInfoTime];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operator = [aDecoder decodeObjectForKey:kCommotityListLastModifyInfoOperator];
self.time = [aDecoder decodeDoubleForKey:kCommotityListLastModifyInfoTime];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operator forKey:kCommotityListLastModifyInfoOperator];
[aCoder encodeDouble:_time forKey:kCommotityListLastModifyInfoTime];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityListLastModifyInfo *copy = [[CommotityListLastModifyInfo alloc] init];
if (copy) {
copy.operator = [self.operator copyWithZone:zone];
copy.time = self.time;
}
return copy;
}
@end
//
// CommotityListModel.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class CommotityListCategory, CommotityListBrand;
@interface CommotityListModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) CommotityListCategory *category;
@property (nonatomic, assign) double brokerageRate;
@property (nonatomic, assign) double originalPrice;
@property (nonatomic, assign) double inv;
@property (nonatomic, assign) double price;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *engName;
@property (nonatomic, strong) CommotityListBrand *brand;
@property (nonatomic, strong) NSString *pictures;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *tranferType;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityListModel.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityListModel.h"
#import "CommotityListCategory.h"
#import "CommotityListBrand.h"
NSString *const kCommotityListModelCategory = @"category";
NSString *const kCommotityListModelBrokerageRate = @"brokerageRate";
NSString *const kCommotityListModelOriginalPrice = @"originalPrice";
NSString *const kCommotityListModelInv = @"inv";
NSString *const kCommotityListModelPrice = @"price";
NSString *const kCommotityListModelUuid = @"uuid";
NSString *const kCommotityListModelEngName = @"engName";
NSString *const kCommotityListModelBrand = @"brand";
NSString *const kCommotityListModelPictures = @"pictures";
NSString *const kCommotityListModelName = @"name";
NSString *const kCommotityListModelTranferType = @"tranferType";
@interface CommotityListModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityListModel
@synthesize category = _category;
@synthesize brokerageRate = _brokerageRate;
@synthesize originalPrice = _originalPrice;
@synthesize inv = _inv;
@synthesize price = _price;
@synthesize uuid = _uuid;
@synthesize engName = _engName;
@synthesize brand = _brand;
@synthesize pictures = _pictures;
@synthesize name = _name;
@synthesize tranferType = _tranferType;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.category = [CommotityListCategory modelObjectWithDictionary:[dict objectForKey:kCommotityListModelCategory]];
self.brokerageRate = [[self objectOrNilForKey:kCommotityListModelBrokerageRate fromDictionary:dict] doubleValue];
self.originalPrice = [[self objectOrNilForKey:kCommotityListModelOriginalPrice fromDictionary:dict] doubleValue];
self.inv = [[self objectOrNilForKey:kCommotityListModelInv fromDictionary:dict] doubleValue];
self.price = [[self objectOrNilForKey:kCommotityListModelPrice fromDictionary:dict] doubleValue];
self.uuid = [self objectOrNilForKey:kCommotityListModelUuid fromDictionary:dict];
self.engName = [self objectOrNilForKey:kCommotityListModelEngName fromDictionary:dict];
self.brand = [CommotityListBrand modelObjectWithDictionary:[dict objectForKey:kCommotityListModelBrand]];
self.pictures = [self objectOrNilForKey:kCommotityListModelPictures fromDictionary:dict];
self.name = [self objectOrNilForKey:kCommotityListModelName fromDictionary:dict];
self.tranferType = [self objectOrNilForKey:kCommotityListModelTranferType fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.category dictionaryRepresentation] forKey:kCommotityListModelCategory];
[mutableDict setValue:[NSNumber numberWithDouble:self.brokerageRate] forKey:kCommotityListModelBrokerageRate];
[mutableDict setValue:[NSNumber numberWithDouble:self.originalPrice] forKey:kCommotityListModelOriginalPrice];
[mutableDict setValue:[NSNumber numberWithDouble:self.inv] forKey:kCommotityListModelInv];
[mutableDict setValue:[NSNumber numberWithDouble:self.price] forKey:kCommotityListModelPrice];
[mutableDict setValue:self.uuid forKey:kCommotityListModelUuid];
[mutableDict setValue:self.engName forKey:kCommotityListModelEngName];
[mutableDict setValue:[self.brand dictionaryRepresentation] forKey:kCommotityListModelBrand];
[mutableDict setValue:self.pictures forKey:kCommotityListModelPictures];
[mutableDict setValue:self.name forKey:kCommotityListModelName];
[mutableDict setValue:self.tranferType forKey:kCommotityListModelTranferType];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.category = [aDecoder decodeObjectForKey:kCommotityListModelCategory];
self.brokerageRate = [aDecoder decodeDoubleForKey:kCommotityListModelBrokerageRate];
self.originalPrice = [aDecoder decodeDoubleForKey:kCommotityListModelOriginalPrice];
self.inv = [aDecoder decodeDoubleForKey:kCommotityListModelInv];
self.price = [aDecoder decodeDoubleForKey:kCommotityListModelPrice];
self.uuid = [aDecoder decodeObjectForKey:kCommotityListModelUuid];
self.engName = [aDecoder decodeObjectForKey:kCommotityListModelEngName];
self.brand = [aDecoder decodeObjectForKey:kCommotityListModelBrand];
self.pictures = [aDecoder decodeObjectForKey:kCommotityListModelPictures];
self.name = [aDecoder decodeObjectForKey:kCommotityListModelName];
self.tranferType = [aDecoder decodeObjectForKey:kCommotityListModelTranferType];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_category forKey:kCommotityListModelCategory];
[aCoder encodeDouble:_brokerageRate forKey:kCommotityListModelBrokerageRate];
[aCoder encodeDouble:_originalPrice forKey:kCommotityListModelOriginalPrice];
[aCoder encodeDouble:_inv forKey:kCommotityListModelInv];
[aCoder encodeDouble:_price forKey:kCommotityListModelPrice];
[aCoder encodeObject:_uuid forKey:kCommotityListModelUuid];
[aCoder encodeObject:_engName forKey:kCommotityListModelEngName];
[aCoder encodeObject:_brand forKey:kCommotityListModelBrand];
[aCoder encodeObject:_pictures forKey:kCommotityListModelPictures];
[aCoder encodeObject:_name forKey:kCommotityListModelName];
[aCoder encodeObject:_tranferType forKey:kCommotityListModelTranferType];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityListModel *copy = [[CommotityListModel alloc] init];
if (copy) {
copy.category = [self.category copyWithZone:zone];
copy.brokerageRate = self.brokerageRate;
copy.originalPrice = self.originalPrice;
copy.inv = self.inv;
copy.price = self.price;
copy.uuid = [self.uuid copyWithZone:zone];
copy.engName = [self.engName copyWithZone:zone];
copy.brand = [self.brand copyWithZone:zone];
copy.pictures = [self.pictures copyWithZone:zone];
copy.name = [self.name copyWithZone:zone];
copy.tranferType = [self.tranferType copyWithZone:zone];
}
return copy;
}
@end
//
// CommotityListOperator.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CommotityListOperator : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *operatorIdentifier;
@property (nonatomic, strong) NSString *fullName;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityListOperator.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityListOperator.h"
NSString *const kCommotityListOperatorId = @"id";
NSString *const kCommotityListOperatorFullName = @"fullName";
@interface CommotityListOperator ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityListOperator
@synthesize operatorIdentifier = _operatorIdentifier;
@synthesize fullName = _fullName;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operatorIdentifier = [self objectOrNilForKey:kCommotityListOperatorId fromDictionary:dict];
self.fullName = [self objectOrNilForKey:kCommotityListOperatorFullName fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.operatorIdentifier forKey:kCommotityListOperatorId];
[mutableDict setValue:self.fullName forKey:kCommotityListOperatorFullName];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operatorIdentifier = [aDecoder decodeObjectForKey:kCommotityListOperatorId];
self.fullName = [aDecoder decodeObjectForKey:kCommotityListOperatorFullName];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operatorIdentifier forKey:kCommotityListOperatorId];
[aCoder encodeObject:_fullName forKey:kCommotityListOperatorFullName];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityListOperator *copy = [[CommotityListOperator alloc] init];
if (copy) {
copy.operatorIdentifier = [self.operatorIdentifier copyWithZone:zone];
copy.fullName = [self.fullName copyWithZone:zone];
}
return copy;
}
@end
//
// CommotityListUpper.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CommotityListUpper : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, strong) NSString *uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityListUpper.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityListUpper.h"
NSString *const kCommotityListUpperName = @"name";
NSString *const kCommotityListUpperCode = @"code";
NSString *const kCommotityListUpperUuid = @"uuid";
@interface CommotityListUpper ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityListUpper
@synthesize name = _name;
@synthesize code = _code;
@synthesize uuid = _uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.name = [self objectOrNilForKey:kCommotityListUpperName fromDictionary:dict];
self.code = [self objectOrNilForKey:kCommotityListUpperCode fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kCommotityListUpperUuid fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.name forKey:kCommotityListUpperName];
[mutableDict setValue:self.code forKey:kCommotityListUpperCode];
[mutableDict setValue:self.uuid forKey:kCommotityListUpperUuid];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.name = [aDecoder decodeObjectForKey:kCommotityListUpperName];
self.code = [aDecoder decodeObjectForKey:kCommotityListUpperCode];
self.uuid = [aDecoder decodeObjectForKey:kCommotityListUpperUuid];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_name forKey:kCommotityListUpperName];
[aCoder encodeObject:_code forKey:kCommotityListUpperCode];
[aCoder encodeObject:_uuid forKey:kCommotityListUpperUuid];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityListUpper *copy = [[CommotityListUpper alloc] init];
if (copy) {
copy.name = [self.name copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
}
return copy;
}
@end
//
// RequstBodyCommodityListModel.h
// ALand
//
// Created by Z on 16/4/11.
// Copyright © 2016年 Z. All rights reserved.
//
#import <Foundation/Foundation.h>
@class Defintion,Orders,Conditions,Parameter,Parameters;
@interface RequstBodyCommodityListModel : NSObject
@property (nonatomic, strong) Defintion *defintion;
@property (nonatomic, strong) NSArray<NSString *> *fetchParts;
@end
@interface Defintion : NSObject
@property (nonatomic, assign) NSInteger probePages;
@property (nonatomic, strong) NSArray<Orders *> *orders;
@property (nonatomic, strong) NSArray<Conditions *> *conditions;
@property (nonatomic, assign) NSInteger pageSize;
@property (nonatomic, assign) NSInteger page;
@end
@interface Orders : NSObject
@property (nonatomic, copy) NSString *field;
@property (nonatomic, copy) NSString *direction;
@end
@interface Conditions : NSObject
@property (nonatomic, strong) NSArray<Parameters *> *parameters;
@property (nonatomic, copy) NSString *operation;
@property (nonatomic, strong) Parameter *parameter;
@end
@interface Parameter : NSObject
@end
@interface Parameters : NSObject
@end
//
// RequstBodyCommodityListModel.m
// ALand
//
// Created by Z on 16/4/11.
// Copyright © 2016年 Z. All rights reserved.
//
#import "RequstBodyCommodityListModel.h"
@implementation RequstBodyCommodityListModel
- (Defintion *)defintion {
if (!_defintion) {
_defintion = [[Defintion alloc] init];
}
return _defintion;
}
@end
@implementation Defintion
+ (NSDictionary *)objectClassInArray{
return @{@"orders" : [Orders class], @"conditions" : [Conditions class]};
}
- (NSArray<Conditions *> *)conditions {
if (!_conditions) {
Conditions *condition = [[Conditions alloc] init];
_conditions = @[condition];
}
return _conditions;
}
@end
@implementation Orders
@end
@implementation Conditions
+ (NSDictionary *)objectClassInArray{
return @{@"parameters" : [Parameters class]};
}
@end
@implementation Parameter
@end
@implementation Parameters
@end
......@@ -7,8 +7,10 @@
//
#import <UIKit/UIKit.h>
#import "CommodityListModel/CommotityListModel.h"
@interface CommodityListCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *labelRealPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelSalePrice;
- (void)cellWithModel:(CommotityListModel *)model;
@end
......@@ -13,11 +13,23 @@
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
@property (weak, nonatomic) IBOutlet UILabel *labelCommission;
@property (weak, nonatomic) IBOutlet UILabel *labelPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelOriginalPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelBrokerageRate;
@end
@implementation CommodityListCollectionViewCell
- (void)cellWithModel:(CommotityListModel *)model {
self.labelPrice.text = [NSString stringWithFormat:@"%.0f",model.price];
[self.imageViewTop sd_setImageWithURL:[NSURL URLWithString:model.pictures] placeholderImage:nil];
self.labelOriginalPrice.text = [NSString stringWithFormat:@"%.0f", model.originalPrice];
self.labelBrokerageRate.text = [NSString stringWithFormat:@"%.2f", model.brokerageRate];
self.labelTitle.text = model.name;
}
- (void)awakeFromNib {
// Initialization code
}
......
......@@ -148,7 +148,10 @@
</variation>
<connections>
<outlet property="imageViewTop" destination="cBw-zL-p9z" id="zPI-ay-h1c"/>
<outlet property="labelBrokerageRate" destination="LFM-Hc-7OR" id="65C-IR-cp1"/>
<outlet property="labelCommission" destination="LFM-Hc-7OR" id="DT7-sD-Mww"/>
<outlet property="labelOriginalPrice" destination="JDW-37-wfV" id="FFB-9Z-rJw"/>
<outlet property="labelPrice" destination="ig6-43-sUi" id="d63-fZ-UmH"/>
<outlet property="labelRealPrice" destination="JDW-37-wfV" id="eBM-3D-ezH"/>
<outlet property="labelSalePrice" destination="ig6-43-sUi" id="NaO-uj-sLU"/>
<outlet property="labelTitle" destination="vlk-5l-QDd" id="FAQ-2a-zdq"/>
......
......@@ -9,6 +9,6 @@
#import <UIKit/UIKit.h>
@interface HomeCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *labelCellTitle;
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@end
......@@ -8,32 +8,32 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="HomeCollectionViewCell">
<rect key="frame" x="0.0" y="0.0" width="162" height="88"/>
<rect key="frame" x="0.0" y="0.0" width="133" height="175"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="162" height="88"/>
<rect key="frame" x="0.0" y="0.0" width="133" height="175"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="cell描述" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WbW-XT-8QE">
<rect key="frame" x="0.0" y="35" width="162" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" image="homeCollection0" translatesAutoresizingMaskIntoConstraints="NO" id="D99-gm-QhP">
<rect key="frame" x="0.0" y="10" width="133" height="155"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="WbW-XT-8QE" secondAttribute="trailing" id="FfO-6c-pc1"/>
<constraint firstItem="WbW-XT-8QE" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="GtD-Lt-4bT"/>
<constraint firstItem="WbW-XT-8QE" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="f7s-un-iVP"/>
<constraint firstItem="WbW-XT-8QE" firstAttribute="centerY" secondItem="gTV-IL-0wX" secondAttribute="centerY" id="zQY-2i-NVV"/>
<constraint firstItem="D99-gm-QhP" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="aZq-nH-q2d"/>
<constraint firstItem="D99-gm-QhP" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="jXj-Lf-0f1"/>
<constraint firstAttribute="bottom" secondItem="D99-gm-QhP" secondAttribute="bottom" constant="10" id="qTX-cx-Pfg"/>
<constraint firstAttribute="trailing" secondItem="D99-gm-QhP" secondAttribute="trailing" id="zAQ-0v-9If"/>
</constraints>
<size key="customSize" width="162" height="88"/>
<size key="customSize" width="133" height="175"/>
<connections>
<outlet property="labelCellTitle" destination="WbW-XT-8QE" id="EsH-6m-9Dd"/>
<outlet property="imgView" destination="D99-gm-QhP" id="33R-h5-L3T"/>
</connections>
<point key="canvasLocation" x="430" y="379"/>
<point key="canvasLocation" x="156.5" y="357.5"/>
</collectionViewCell>
</objects>
<resources>
<image name="homeCollection0" width="80" height="116"/>
</resources>
</document>
......@@ -10,4 +10,5 @@
@interface CommodityListViewController : IBTUIViewController
@property (nonatomic, strong) id model;
@property (nonatomic, copy) NSString *type;
@end
......@@ -10,13 +10,19 @@
#import "CommodityListCollectionViewCell.h"
#import "SortView.h"
#import "CommodityDetailViewController.h"
#import "RequstBodyCommodityListModel.h"
#import "CommotityRequestModel.h"
#import "HotBrandModel.h"
#import "CatgoryModel.h"
#import "CommodityListModel/CommotityListModel.h"
#define kCellID @"commodityCell"
@interface CommodityListViewController ()<UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) SortView *sortView;
@property (nonatomic, strong) NSMutableArray *arrItemDatas;
@property (nonatomic, assign) NSInteger page;
@end
@implementation CommodityListViewController
......@@ -31,29 +37,54 @@
// Do any additional setup after loading the view.
}
- (NSMutableArray *)arrItemDatas {
if (!_arrItemDatas) {
_arrItemDatas = [NSMutableArray array];
}
return _arrItemDatas;
}
- (void)setUpData {
RequstBodyCommodityListModel *requstBody = [[RequstBodyCommodityListModel alloc] init];
if ([self.model isKindOfClass:[HotBrandModel class]]) {
NSString *jsonString = @"{\"defintion\":{\"conditions\":[{\"operation\":\"string\",\"parameter\":{},\"parameters\":[{}]}],\"orders\":[{\"field\":\"string\",\"direction\":\"asc\"}],\"pageSize\":0,\"page\":0,\"probePages\":0},\"fetchParts\":[\"string\"]}";
NSDictionary *dic = [jsonString mj_JSONObject];
CommotityRequestModel *requstBody = [CommotityRequestModel modelObjectWithDictionary:dic];
if ([self.model isKindOfClass:[HotBrandModel class]]) {//热门品牌
//设置请求模型
HotBrandModel *model = self.model;
requstBody.defintion.conditions[0].operation = [NSString stringWithFormat:@"goodsData brand %@ equals", model.uuid];
requstBody.defintion.conditions[0].parameters = @[model.uuid];
//requstBody.defintion.orders = @[@"10",@"1",@"1"];
requstBody.defintion.pageSize = 10;
requstBody.defintion.page = 0;
requstBody.defintion.probePages = 0;
}else if([self.model isKindOfClass:[CatgoryModel class]]){
CatgoryModel *model = self.model;
requstBody.defintion.conditions[0].operation = [NSString stringWithFormat:@"goodsData brand %@ equals", model.uuid];
requstBody.defintion.conditions[0].parameters = @[model.uuid];
requstBody.defintion.pageSize = 10;
requstBody.defintion.page = 0;
requstBody.defintion.probePages = 0;
}
//请求模型转化为字典
NSDictionary *params = requstBody.mj_keyValues;
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"goods/query2" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
for (NSDictionary *dic in responseObject[@"queryResult"]) {
CommotityListModel *model = [CommotityListModel modelObjectWithDictionary:dic];
[weakSelf.arrItemDatas addObject:model];
}
CLog(@"d");
[weakSelf.collectionView reloadData];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
}
......@@ -103,7 +134,7 @@
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return 20;
return self.arrItemDatas.count;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
......@@ -114,9 +145,8 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath];
//假数据
NSArray *arr = @[@"234",@"23",@"234234",@"2344",@"33",@"2",@"234",@"23",@"234234",@"2344",@"33",@"2",@"234",@"23",@"234234",@"2344",@"33",@"2",@"234",@"23",@"234234",@"2344",@"33",@"2"];
cell.labelSalePrice.text = arr[indexPath.row];
[cell cellWithModel:self.arrItemDatas[indexPath.row]];
return cell;
}
......
......@@ -20,7 +20,7 @@
#define kCollectionViewHeadHeight 350
@interface HomeCollectionViewController ()<UICollectionViewDataSource, UICollectionViewDelegate,SDCycleScrollViewDelegate>
@property (nonatomic, strong) NSArray *cellTitle;
@property (nonatomic, strong) NSMutableArray *arrImages;
@property (nonatomic, strong) UICollectionView *collectionView;
@end
......@@ -30,7 +30,11 @@
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO;
_cellTitle = @[@"商品管理",@"订单管理",@"分销管理",@"客户管理",@"店铺管理",@"邀请合伙人",@"aland商城",@""];
_arrImages = [NSMutableArray array];
for (int i = 0; i < 8; i++) {
NSString *imageName = [NSString stringWithFormat:@"homeCollection%d",i];
[_arrImages addObject:imageName];
}
......@@ -38,7 +42,7 @@
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 1;
layout.minimumInteritemSpacing = 1;
layout.itemSize = CGSizeMake((ScreenSize.width - 3) / 4, (ScreenSize.width - 3) / 4 - 10);
layout.itemSize = CGSizeMake((ScreenSize.width - 3) / 4, (ScreenSize.width - 3) / 4 + 20);
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) collectionViewLayout:layout];
_collectionView.backgroundColor = kBacroundColor;
......@@ -105,13 +109,12 @@
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.cellTitle.count;
return self.arrImages.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
HomeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kHomeCollectionViewID forIndexPath:indexPath];
//cell.backgroundColor = kRandomColor;
cell.labelCellTitle.text = self.cellTitle[indexPath.row];
cell.imgView.image = [UIImage imageNamed:self.arrImages[indexPath.row]];
return cell;
}
......
......@@ -9,6 +9,7 @@
#import "ToLoginViewController.h"
#import "ResetPasswordViewController.h"
#import "BaseViewController.h"
#import "UserInfoBaseClass.h"
@interface ToLoginViewController ()
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextFiled;
@property (weak, nonatomic) IBOutlet UITextField *passwordTextFiled;
......@@ -33,11 +34,12 @@
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[[HTTPCilent shareCilent] POST:@"app/resellerLogin" parameters:paramers success:^(NSURLSessionDataTask *task, id responseObject) {
UserInfo *info = [UserInfo shareInstance];
[UserInfo mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
return @{@"description":@"adescription"};
}];
info = [UserInfo mj_objectWithKeyValues:responseObject[@"reseller"]];
// [UserInfo mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
// return @{@"description":@"adescription"};
// }];
// info = [UserInfo mj_objectWithKeyValues:responseObject[@"reseller"]];
info = [UserInfo modelObjectWithDictionary:responseObject[@"reseller"]];
[MBProgressHUD hideHUDForView:self.view animated:YES];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
......
//
// CommotityRequestModel.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Defintion.h"
@interface CommotityRequestModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) Defintion *defintion;
@property (nonatomic, strong) NSArray *fetchParts;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// CommotityRequestModel.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "CommotityRequestModel.h"
#import "Defintion.h"
NSString *const kCommotityRequestModelDefintion = @"defintion";
NSString *const kCommotityRequestModelFetchParts = @"fetchParts";
@interface CommotityRequestModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation CommotityRequestModel
@synthesize defintion = _defintion;
@synthesize fetchParts = _fetchParts;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.defintion = [Defintion modelObjectWithDictionary:[dict objectForKey:kCommotityRequestModelDefintion]];
self.fetchParts = [self objectOrNilForKey:kCommotityRequestModelFetchParts fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.defintion dictionaryRepresentation] forKey:kCommotityRequestModelDefintion];
NSMutableArray *tempArrayForFetchParts = [NSMutableArray array];
for (NSObject *subArrayObject in self.fetchParts) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForFetchParts addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForFetchParts addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForFetchParts] forKey:kCommotityRequestModelFetchParts];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.defintion = [aDecoder decodeObjectForKey:kCommotityRequestModelDefintion];
self.fetchParts = [aDecoder decodeObjectForKey:kCommotityRequestModelFetchParts];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_defintion forKey:kCommotityRequestModelDefintion];
[aCoder encodeObject:_fetchParts forKey:kCommotityRequestModelFetchParts];
}
- (id)copyWithZone:(NSZone *)zone
{
CommotityRequestModel *copy = [[CommotityRequestModel alloc] init];
if (copy) {
copy.defintion = [self.defintion copyWithZone:zone];
copy.fetchParts = [self.fetchParts copyWithZone:zone];
}
return copy;
}
@end
//
// Conditions.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class Parameter;
@interface Conditions : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSArray *parameters;
@property (nonatomic, strong) NSString *operation;
@property (nonatomic, strong) Parameter *parameter;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// Conditions.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "Conditions.h"
#import "Parameters.h"
#import "Parameter.h"
NSString *const kConditionsParameters = @"parameters";
NSString *const kConditionsOperation = @"operation";
NSString *const kConditionsParameter = @"parameter";
@interface Conditions ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation Conditions
@synthesize parameters = _parameters;
@synthesize operation = _operation;
@synthesize parameter = _parameter;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
NSObject *receivedParameters = [dict objectForKey:kConditionsParameters];
NSMutableArray *parsedParameters = [NSMutableArray array];
if ([receivedParameters isKindOfClass:[NSArray class]]) {
for (NSDictionary *item in (NSArray *)receivedParameters) {
if ([item isKindOfClass:[NSDictionary class]]) {
[parsedParameters addObject:[Parameters modelObjectWithDictionary:item]];
}
}
} else if ([receivedParameters isKindOfClass:[NSDictionary class]]) {
[parsedParameters addObject:[Parameters modelObjectWithDictionary:(NSDictionary *)receivedParameters]];
}
self.parameters = [NSArray arrayWithArray:parsedParameters];
self.operation = [self objectOrNilForKey:kConditionsOperation fromDictionary:dict];
self.parameter = [Parameter modelObjectWithDictionary:[dict objectForKey:kConditionsParameter]];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
NSMutableArray *tempArrayForParameters = [NSMutableArray array];
for (NSObject *subArrayObject in self.parameters) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForParameters addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForParameters addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForParameters] forKey:kConditionsParameters];
[mutableDict setValue:self.operation forKey:kConditionsOperation];
[mutableDict setValue:[self.parameter dictionaryRepresentation] forKey:kConditionsParameter];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.parameters = [aDecoder decodeObjectForKey:kConditionsParameters];
self.operation = [aDecoder decodeObjectForKey:kConditionsOperation];
self.parameter = [aDecoder decodeObjectForKey:kConditionsParameter];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_parameters forKey:kConditionsParameters];
[aCoder encodeObject:_operation forKey:kConditionsOperation];
[aCoder encodeObject:_parameter forKey:kConditionsParameter];
}
- (id)copyWithZone:(NSZone *)zone
{
Conditions *copy = [[Conditions alloc] init];
if (copy) {
copy.parameters = [self.parameters copyWithZone:zone];
copy.operation = [self.operation copyWithZone:zone];
copy.parameter = [self.parameter copyWithZone:zone];
}
return copy;
}
@end
//
// DataModels.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "Defintion.h" #import "Orders.h" #import "Parameter.h" #import "Conditions.h" #import "CommotityRequestModel.h" #import "Parameters.h"
\ No newline at end of file
//
// Defintion.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Conditions.h"
@interface Defintion : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double pageSize;
@property (nonatomic, strong) NSArray *orders;
@property (nonatomic, strong) NSArray<Conditions *> *conditions;
@property (nonatomic, assign) double probePages;
@property (nonatomic, assign) double page;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// Defintion.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "Defintion.h"
#import "Orders.h"
#import "Conditions.h"
NSString *const kDefintionPageSize = @"pageSize";
NSString *const kDefintionOrders = @"orders";
NSString *const kDefintionConditions = @"conditions";
NSString *const kDefintionProbePages = @"probePages";
NSString *const kDefintionPage = @"page";
@interface Defintion ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation Defintion
@synthesize pageSize = _pageSize;
@synthesize orders = _orders;
@synthesize conditions = _conditions;
@synthesize probePages = _probePages;
@synthesize page = _page;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.pageSize = [[self objectOrNilForKey:kDefintionPageSize fromDictionary:dict] doubleValue];
NSObject *receivedOrders = [dict objectForKey:kDefintionOrders];
NSMutableArray *parsedOrders = [NSMutableArray array];
if ([receivedOrders isKindOfClass:[NSArray class]]) {
for (NSDictionary *item in (NSArray *)receivedOrders) {
if ([item isKindOfClass:[NSDictionary class]]) {
[parsedOrders addObject:[Orders modelObjectWithDictionary:item]];
}
}
} else if ([receivedOrders isKindOfClass:[NSDictionary class]]) {
[parsedOrders addObject:[Orders modelObjectWithDictionary:(NSDictionary *)receivedOrders]];
}
self.orders = [NSArray arrayWithArray:parsedOrders];
NSObject *receivedConditions = [dict objectForKey:kDefintionConditions];
NSMutableArray *parsedConditions = [NSMutableArray array];
if ([receivedConditions isKindOfClass:[NSArray class]]) {
for (NSDictionary *item in (NSArray *)receivedConditions) {
if ([item isKindOfClass:[NSDictionary class]]) {
[parsedConditions addObject:[Conditions modelObjectWithDictionary:item]];
}
}
} else if ([receivedConditions isKindOfClass:[NSDictionary class]]) {
[parsedConditions addObject:[Conditions modelObjectWithDictionary:(NSDictionary *)receivedConditions]];
}
self.conditions = [NSArray arrayWithArray:parsedConditions];
self.probePages = [[self objectOrNilForKey:kDefintionProbePages fromDictionary:dict] doubleValue];
self.page = [[self objectOrNilForKey:kDefintionPage fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[NSNumber numberWithDouble:self.pageSize] forKey:kDefintionPageSize];
NSMutableArray *tempArrayForOrders = [NSMutableArray array];
for (NSObject *subArrayObject in self.orders) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForOrders addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForOrders addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForOrders] forKey:kDefintionOrders];
NSMutableArray *tempArrayForConditions = [NSMutableArray array];
for (NSObject *subArrayObject in self.conditions) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForConditions addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForConditions addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForConditions] forKey:kDefintionConditions];
[mutableDict setValue:[NSNumber numberWithDouble:self.probePages] forKey:kDefintionProbePages];
[mutableDict setValue:[NSNumber numberWithDouble:self.page] forKey:kDefintionPage];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.pageSize = [aDecoder decodeDoubleForKey:kDefintionPageSize];
self.orders = [aDecoder decodeObjectForKey:kDefintionOrders];
self.conditions = [aDecoder decodeObjectForKey:kDefintionConditions];
self.probePages = [aDecoder decodeDoubleForKey:kDefintionProbePages];
self.page = [aDecoder decodeDoubleForKey:kDefintionPage];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeDouble:_pageSize forKey:kDefintionPageSize];
[aCoder encodeObject:_orders forKey:kDefintionOrders];
[aCoder encodeObject:_conditions forKey:kDefintionConditions];
[aCoder encodeDouble:_probePages forKey:kDefintionProbePages];
[aCoder encodeDouble:_page forKey:kDefintionPage];
}
- (id)copyWithZone:(NSZone *)zone
{
Defintion *copy = [[Defintion alloc] init];
if (copy) {
copy.pageSize = self.pageSize;
copy.orders = [self.orders copyWithZone:zone];
copy.conditions = [self.conditions copyWithZone:zone];
copy.probePages = self.probePages;
copy.page = self.page;
}
return copy;
}
@end
//
// Orders.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Orders : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *field;
@property (nonatomic, strong) NSString *direction;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// Orders.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "Orders.h"
NSString *const kOrdersField = @"field";
NSString *const kOrdersDirection = @"direction";
@interface Orders ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation Orders
@synthesize field = _field;
@synthesize direction = _direction;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.field = [self objectOrNilForKey:kOrdersField fromDictionary:dict];
self.direction = [self objectOrNilForKey:kOrdersDirection fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.field forKey:kOrdersField];
[mutableDict setValue:self.direction forKey:kOrdersDirection];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.field = [aDecoder decodeObjectForKey:kOrdersField];
self.direction = [aDecoder decodeObjectForKey:kOrdersDirection];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_field forKey:kOrdersField];
[aCoder encodeObject:_direction forKey:kOrdersDirection];
}
- (id)copyWithZone:(NSZone *)zone
{
Orders *copy = [[Orders alloc] init];
if (copy) {
copy.field = [self.field copyWithZone:zone];
copy.direction = [self.direction copyWithZone:zone];
}
return copy;
}
@end
//
// Parameter.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Parameter : NSObject <NSCoding, NSCopying>
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// Parameter.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "Parameter.h"
@interface Parameter ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation Parameter
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
}
- (id)copyWithZone:(NSZone *)zone
{
Parameter *copy = [[Parameter alloc] init];
if (copy) {
}
return copy;
}
@end
//
// Parameters.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Parameters : NSObject <NSCoding, NSCopying>
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// Parameters.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "Parameters.h"
@interface Parameters ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation Parameters
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
}
- (id)copyWithZone:(NSZone *)zone
{
Parameters *copy = [[Parameters alloc] init];
if (copy) {
}
return copy;
}
@end
......@@ -2,148 +2,12 @@
// UserInfo.h
// ALand
//
// Created by Z on 16/3/23.
// Created by Z on 16/4/11.
// Copyright © 2016年 Z. All rights reserved.
//
#import <Foundation/Foundation.h>
@class Certificate,Lastmodifyinfo,Passwordcontrol,Shop,Createinfo,Ownerorg,Logincontrol,Operator;
@interface UserInfo : NSObject
@property (nonatomic, copy) NSString *birthday;
@property (nonatomic, copy) NSString *portrait;
@property (nonatomic, strong) Ownerorg *ownerOrg;
@property (nonatomic, copy) NSString *code;
@property (nonatomic, copy) NSString *telephone;
@property (nonatomic, copy) NSString *mobilephone;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, strong) Lastmodifyinfo *lastModifyInfo;
@property (nonatomic, copy) NSString *socialContact;
@property (nonatomic, strong) Certificate *certificate;
@property (nonatomic, assign) NSInteger version;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *invitationCode;
@property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *domain;
@property (nonatomic, copy) NSString *idCard;
@property (nonatomic, copy) NSString *gender;
@property (nonatomic, strong) Passwordcontrol *passwordControl;
@property (nonatomic, copy) NSString *postalAddresses;
@property (nonatomic, strong) NSArray *roles;
@property (nonatomic, copy) NSString *referrer;
@property (nonatomic, strong) Shop *shop;
@property (nonatomic, strong) Createinfo *createInfo;
@property (nonatomic, assign) NSInteger order;
@property (nonatomic, strong) Logincontrol *loginControl;
@property (nonatomic, copy) NSString *adescription;
#import "UserInfoBaseClass.h"
@interface UserInfo : UserInfoBaseClass
+ (UserInfo *)shareInstance;
@end
@interface Certificate : NSObject
@property (nonatomic, strong) NSArray *bankCards;
@property (nonatomic, assign) BOOL idValidated;
@property (nonatomic, copy) NSString *code;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *good;
@property (nonatomic, copy) NSString *trueName;
@property (nonatomic, copy) NSString *name;
@end
@interface Lastmodifyinfo : NSObject
@property (nonatomic, assign) long long time;
@property (nonatomic, strong) Operator *aoperator;
@end
@interface Passwordcontrol : NSObject
@property (nonatomic, assign) long long created;
@property (nonatomic, copy) NSString *ainitPassword; //initPassword
@property (nonatomic, assign) long long expiry;
@end
@interface Shop : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *code;
@end
@interface Createinfo : NSObject
@property (nonatomic, strong) Operator *aoperator;
@property (nonatomic, assign) long long time;
@end
@interface Ownerorg : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *code;
@end
@interface Logincontrol : NSObject
@property (nonatomic, copy) NSString *loginIp;
@property (nonatomic, assign) long long loginTime;
@property (nonatomic, assign) NSInteger failedTimes;
@end
@interface Operator : NSObject
@property (nonatomic, copy) NSString *aid;
@property (nonatomic, copy) NSString *fullName;
@end
......@@ -2,7 +2,7 @@
// UserInfo.m
// ALand
//
// Created by Z on 16/3/23.
// Created by Z on 16/4/11.
// Copyright © 2016年 Z. All rights reserved.
//
......@@ -17,45 +17,4 @@
});
return userInfo;
}
@end
@implementation Certificate
@end
@implementation Lastmodifyinfo
@end
@implementation Passwordcontrol
@end
@implementation Shop
@end
@implementation Createinfo
@end
@implementation Ownerorg
@end
@implementation Logincontrol
@end
@implementation Operator
@end
//
// DataModels.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoCertificate.h" #import "UserInfoLastModifyInfo.h" #import "UserInfoPasswordControl.h" #import "UserInfoShop.h" #import "UserInfoCreateInfo.h" #import "UserInfoOwnerOrg.h" #import "UserInfoLoginControl.h" #import "UserInfoBaseClass.h"
\ No newline at end of file
//
// UserInfoBaseClass.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class UserInfoOwnerOrg, UserInfoLastModifyInfo, UserInfoCertificate, UserInfoPasswordControl, UserInfoShop, UserInfoCreateInfo, UserInfoLoginControl;
@interface UserInfoBaseClass : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) id birthday;
@property (nonatomic, assign) id portrait;
@property (nonatomic, strong) UserInfoOwnerOrg *ownerOrg;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, assign) id telephone;
@property (nonatomic, strong) NSString *mobilephone;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) UserInfoLastModifyInfo *lastModifyInfo;
@property (nonatomic, assign) id socialContact;
@property (nonatomic, strong) UserInfoCertificate *certificate;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *invitationCode;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) UserInfoPasswordControl *passwordControl;
@property (nonatomic, strong) NSString *gender;
@property (nonatomic, strong) NSArray *roles;
@property (nonatomic, assign) id postalAddresses;
@property (nonatomic, assign) id idCard;
@property (nonatomic, assign) id referrer;
@property (nonatomic, strong) UserInfoShop *shop;
@property (nonatomic, strong) UserInfoCreateInfo *createInfo;
@property (nonatomic, assign) double order;
@property (nonatomic, strong) UserInfoLoginControl *loginControl;
@property (nonatomic, assign) id internalBaseClassDescription;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoBaseClass.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoBaseClass.h"
#import "UserInfoOwnerOrg.h"
#import "UserInfoLastModifyInfo.h"
#import "UserInfoCertificate.h"
#import "UserInfoPasswordControl.h"
#import "UserInfoShop.h"
#import "UserInfoCreateInfo.h"
#import "UserInfoLoginControl.h"
NSString *const kUserInfoBaseClassBirthday = @"birthday";
NSString *const kUserInfoBaseClassPortrait = @"portrait";
NSString *const kUserInfoBaseClassOwnerOrg = @"ownerOrg";
NSString *const kUserInfoBaseClassCode = @"code";
NSString *const kUserInfoBaseClassTelephone = @"telephone";
NSString *const kUserInfoBaseClassMobilephone = @"mobilephone";
NSString *const kUserInfoBaseClassUuid = @"uuid";
NSString *const kUserInfoBaseClassLastModifyInfo = @"lastModifyInfo";
NSString *const kUserInfoBaseClassSocialContact = @"socialContact";
NSString *const kUserInfoBaseClassCertificate = @"certificate";
NSString *const kUserInfoBaseClassVersion = @"version";
NSString *const kUserInfoBaseClassName = @"name";
NSString *const kUserInfoBaseClassInvitationCode = @"invitationCode";
NSString *const kUserInfoBaseClassState = @"state";
NSString *const kUserInfoBaseClassDomain = @"domain";
NSString *const kUserInfoBaseClassPasswordControl = @"passwordControl";
NSString *const kUserInfoBaseClassGender = @"gender";
NSString *const kUserInfoBaseClassRoles = @"roles";
NSString *const kUserInfoBaseClassPostalAddresses = @"postalAddresses";
NSString *const kUserInfoBaseClassIdCard = @"idCard";
NSString *const kUserInfoBaseClassReferrer = @"referrer";
NSString *const kUserInfoBaseClassShop = @"shop";
NSString *const kUserInfoBaseClassCreateInfo = @"createInfo";
NSString *const kUserInfoBaseClassOrder = @"order";
NSString *const kUserInfoBaseClassLoginControl = @"loginControl";
NSString *const kUserInfoBaseClassDescription = @"description";
@interface UserInfoBaseClass ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoBaseClass
@synthesize birthday = _birthday;
@synthesize portrait = _portrait;
@synthesize ownerOrg = _ownerOrg;
@synthesize code = _code;
@synthesize telephone = _telephone;
@synthesize mobilephone = _mobilephone;
@synthesize uuid = _uuid;
@synthesize lastModifyInfo = _lastModifyInfo;
@synthesize socialContact = _socialContact;
@synthesize certificate = _certificate;
@synthesize version = _version;
@synthesize name = _name;
@synthesize invitationCode = _invitationCode;
@synthesize state = _state;
@synthesize domain = _domain;
@synthesize passwordControl = _passwordControl;
@synthesize gender = _gender;
@synthesize roles = _roles;
@synthesize postalAddresses = _postalAddresses;
@synthesize idCard = _idCard;
@synthesize referrer = _referrer;
@synthesize shop = _shop;
@synthesize createInfo = _createInfo;
@synthesize order = _order;
@synthesize loginControl = _loginControl;
@synthesize internalBaseClassDescription = _internalBaseClassDescription;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.birthday = [self objectOrNilForKey:kUserInfoBaseClassBirthday fromDictionary:dict];
self.portrait = [self objectOrNilForKey:kUserInfoBaseClassPortrait fromDictionary:dict];
self.ownerOrg = [UserInfoOwnerOrg modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassOwnerOrg]];
self.code = [self objectOrNilForKey:kUserInfoBaseClassCode fromDictionary:dict];
self.telephone = [self objectOrNilForKey:kUserInfoBaseClassTelephone fromDictionary:dict];
self.mobilephone = [self objectOrNilForKey:kUserInfoBaseClassMobilephone fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kUserInfoBaseClassUuid fromDictionary:dict];
self.lastModifyInfo = [UserInfoLastModifyInfo modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassLastModifyInfo]];
self.socialContact = [self objectOrNilForKey:kUserInfoBaseClassSocialContact fromDictionary:dict];
self.certificate = [UserInfoCertificate modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassCertificate]];
self.version = [[self objectOrNilForKey:kUserInfoBaseClassVersion fromDictionary:dict] doubleValue];
self.name = [self objectOrNilForKey:kUserInfoBaseClassName fromDictionary:dict];
self.invitationCode = [self objectOrNilForKey:kUserInfoBaseClassInvitationCode fromDictionary:dict];
self.state = [self objectOrNilForKey:kUserInfoBaseClassState fromDictionary:dict];
self.domain = [self objectOrNilForKey:kUserInfoBaseClassDomain fromDictionary:dict];
self.passwordControl = [UserInfoPasswordControl modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassPasswordControl]];
self.gender = [self objectOrNilForKey:kUserInfoBaseClassGender fromDictionary:dict];
self.roles = [self objectOrNilForKey:kUserInfoBaseClassRoles fromDictionary:dict];
self.postalAddresses = [self objectOrNilForKey:kUserInfoBaseClassPostalAddresses fromDictionary:dict];
self.idCard = [self objectOrNilForKey:kUserInfoBaseClassIdCard fromDictionary:dict];
self.referrer = [self objectOrNilForKey:kUserInfoBaseClassReferrer fromDictionary:dict];
self.shop = [UserInfoShop modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassShop]];
self.createInfo = [UserInfoCreateInfo modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassCreateInfo]];
self.order = [[self objectOrNilForKey:kUserInfoBaseClassOrder fromDictionary:dict] doubleValue];
self.loginControl = [UserInfoLoginControl modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassLoginControl]];
self.internalBaseClassDescription = [self objectOrNilForKey:kUserInfoBaseClassDescription fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.birthday forKey:kUserInfoBaseClassBirthday];
[mutableDict setValue:self.portrait forKey:kUserInfoBaseClassPortrait];
[mutableDict setValue:[self.ownerOrg dictionaryRepresentation] forKey:kUserInfoBaseClassOwnerOrg];
[mutableDict setValue:self.code forKey:kUserInfoBaseClassCode];
[mutableDict setValue:self.telephone forKey:kUserInfoBaseClassTelephone];
[mutableDict setValue:self.mobilephone forKey:kUserInfoBaseClassMobilephone];
[mutableDict setValue:self.uuid forKey:kUserInfoBaseClassUuid];
[mutableDict setValue:[self.lastModifyInfo dictionaryRepresentation] forKey:kUserInfoBaseClassLastModifyInfo];
[mutableDict setValue:self.socialContact forKey:kUserInfoBaseClassSocialContact];
[mutableDict setValue:[self.certificate dictionaryRepresentation] forKey:kUserInfoBaseClassCertificate];
[mutableDict setValue:[NSNumber numberWithDouble:self.version] forKey:kUserInfoBaseClassVersion];
[mutableDict setValue:self.name forKey:kUserInfoBaseClassName];
[mutableDict setValue:self.invitationCode forKey:kUserInfoBaseClassInvitationCode];
[mutableDict setValue:self.state forKey:kUserInfoBaseClassState];
[mutableDict setValue:self.domain forKey:kUserInfoBaseClassDomain];
[mutableDict setValue:[self.passwordControl dictionaryRepresentation] forKey:kUserInfoBaseClassPasswordControl];
[mutableDict setValue:self.gender forKey:kUserInfoBaseClassGender];
NSMutableArray *tempArrayForRoles = [NSMutableArray array];
for (NSObject *subArrayObject in self.roles) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForRoles addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForRoles addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForRoles] forKey:kUserInfoBaseClassRoles];
[mutableDict setValue:self.postalAddresses forKey:kUserInfoBaseClassPostalAddresses];
[mutableDict setValue:self.idCard forKey:kUserInfoBaseClassIdCard];
[mutableDict setValue:self.referrer forKey:kUserInfoBaseClassReferrer];
[mutableDict setValue:[self.shop dictionaryRepresentation] forKey:kUserInfoBaseClassShop];
[mutableDict setValue:[self.createInfo dictionaryRepresentation] forKey:kUserInfoBaseClassCreateInfo];
[mutableDict setValue:[NSNumber numberWithDouble:self.order] forKey:kUserInfoBaseClassOrder];
[mutableDict setValue:[self.loginControl dictionaryRepresentation] forKey:kUserInfoBaseClassLoginControl];
[mutableDict setValue:self.internalBaseClassDescription forKey:kUserInfoBaseClassDescription];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.birthday = [aDecoder decodeObjectForKey:kUserInfoBaseClassBirthday];
self.portrait = [aDecoder decodeObjectForKey:kUserInfoBaseClassPortrait];
self.ownerOrg = [aDecoder decodeObjectForKey:kUserInfoBaseClassOwnerOrg];
self.code = [aDecoder decodeObjectForKey:kUserInfoBaseClassCode];
self.telephone = [aDecoder decodeObjectForKey:kUserInfoBaseClassTelephone];
self.mobilephone = [aDecoder decodeObjectForKey:kUserInfoBaseClassMobilephone];
self.uuid = [aDecoder decodeObjectForKey:kUserInfoBaseClassUuid];
self.lastModifyInfo = [aDecoder decodeObjectForKey:kUserInfoBaseClassLastModifyInfo];
self.socialContact = [aDecoder decodeObjectForKey:kUserInfoBaseClassSocialContact];
self.certificate = [aDecoder decodeObjectForKey:kUserInfoBaseClassCertificate];
self.version = [aDecoder decodeDoubleForKey:kUserInfoBaseClassVersion];
self.name = [aDecoder decodeObjectForKey:kUserInfoBaseClassName];
self.invitationCode = [aDecoder decodeObjectForKey:kUserInfoBaseClassInvitationCode];
self.state = [aDecoder decodeObjectForKey:kUserInfoBaseClassState];
self.domain = [aDecoder decodeObjectForKey:kUserInfoBaseClassDomain];
self.passwordControl = [aDecoder decodeObjectForKey:kUserInfoBaseClassPasswordControl];
self.gender = [aDecoder decodeObjectForKey:kUserInfoBaseClassGender];
self.roles = [aDecoder decodeObjectForKey:kUserInfoBaseClassRoles];
self.postalAddresses = [aDecoder decodeObjectForKey:kUserInfoBaseClassPostalAddresses];
self.idCard = [aDecoder decodeObjectForKey:kUserInfoBaseClassIdCard];
self.referrer = [aDecoder decodeObjectForKey:kUserInfoBaseClassReferrer];
self.shop = [aDecoder decodeObjectForKey:kUserInfoBaseClassShop];
self.createInfo = [aDecoder decodeObjectForKey:kUserInfoBaseClassCreateInfo];
self.order = [aDecoder decodeDoubleForKey:kUserInfoBaseClassOrder];
self.loginControl = [aDecoder decodeObjectForKey:kUserInfoBaseClassLoginControl];
self.internalBaseClassDescription = [aDecoder decodeObjectForKey:kUserInfoBaseClassDescription];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_birthday forKey:kUserInfoBaseClassBirthday];
[aCoder encodeObject:_portrait forKey:kUserInfoBaseClassPortrait];
[aCoder encodeObject:_ownerOrg forKey:kUserInfoBaseClassOwnerOrg];
[aCoder encodeObject:_code forKey:kUserInfoBaseClassCode];
[aCoder encodeObject:_telephone forKey:kUserInfoBaseClassTelephone];
[aCoder encodeObject:_mobilephone forKey:kUserInfoBaseClassMobilephone];
[aCoder encodeObject:_uuid forKey:kUserInfoBaseClassUuid];
[aCoder encodeObject:_lastModifyInfo forKey:kUserInfoBaseClassLastModifyInfo];
[aCoder encodeObject:_socialContact forKey:kUserInfoBaseClassSocialContact];
[aCoder encodeObject:_certificate forKey:kUserInfoBaseClassCertificate];
[aCoder encodeDouble:_version forKey:kUserInfoBaseClassVersion];
[aCoder encodeObject:_name forKey:kUserInfoBaseClassName];
[aCoder encodeObject:_invitationCode forKey:kUserInfoBaseClassInvitationCode];
[aCoder encodeObject:_state forKey:kUserInfoBaseClassState];
[aCoder encodeObject:_domain forKey:kUserInfoBaseClassDomain];
[aCoder encodeObject:_passwordControl forKey:kUserInfoBaseClassPasswordControl];
[aCoder encodeObject:_gender forKey:kUserInfoBaseClassGender];
[aCoder encodeObject:_roles forKey:kUserInfoBaseClassRoles];
[aCoder encodeObject:_postalAddresses forKey:kUserInfoBaseClassPostalAddresses];
[aCoder encodeObject:_idCard forKey:kUserInfoBaseClassIdCard];
[aCoder encodeObject:_referrer forKey:kUserInfoBaseClassReferrer];
[aCoder encodeObject:_shop forKey:kUserInfoBaseClassShop];
[aCoder encodeObject:_createInfo forKey:kUserInfoBaseClassCreateInfo];
[aCoder encodeDouble:_order forKey:kUserInfoBaseClassOrder];
[aCoder encodeObject:_loginControl forKey:kUserInfoBaseClassLoginControl];
[aCoder encodeObject:_internalBaseClassDescription forKey:kUserInfoBaseClassDescription];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoBaseClass *copy = [[UserInfoBaseClass alloc] init];
if (copy) {
copy.birthday = [self.birthday copyWithZone:zone];
copy.portrait = [self.portrait copyWithZone:zone];
copy.ownerOrg = [self.ownerOrg copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
copy.telephone = [self.telephone copyWithZone:zone];
copy.mobilephone = [self.mobilephone copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
copy.lastModifyInfo = [self.lastModifyInfo copyWithZone:zone];
copy.socialContact = [self.socialContact copyWithZone:zone];
copy.certificate = [self.certificate copyWithZone:zone];
copy.version = self.version;
copy.name = [self.name copyWithZone:zone];
copy.invitationCode = [self.invitationCode copyWithZone:zone];
copy.state = [self.state copyWithZone:zone];
copy.domain = [self.domain copyWithZone:zone];
copy.passwordControl = [self.passwordControl copyWithZone:zone];
copy.gender = [self.gender copyWithZone:zone];
copy.roles = [self.roles copyWithZone:zone];
copy.postalAddresses = [self.postalAddresses copyWithZone:zone];
copy.idCard = [self.idCard copyWithZone:zone];
copy.referrer = [self.referrer copyWithZone:zone];
copy.shop = [self.shop copyWithZone:zone];
copy.createInfo = [self.createInfo copyWithZone:zone];
copy.order = self.order;
copy.loginControl = [self.loginControl copyWithZone:zone];
copy.internalBaseClassDescription = [self.internalBaseClassDescription copyWithZone:zone];
}
return copy;
}
@end
//
// UserInfoCertificate.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoCertificate : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSArray *bankCards;
@property (nonatomic, assign) BOOL idValidated;
@property (nonatomic, assign) id code;
@property (nonatomic, assign) id uuid;
@property (nonatomic, assign) id trueName;
@property (nonatomic, assign) id good;
@property (nonatomic, assign) id name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoCertificate.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoCertificate.h"
NSString *const kUserInfoCertificateBankCards = @"bankCards";
NSString *const kUserInfoCertificateIdValidated = @"idValidated";
NSString *const kUserInfoCertificateCode = @"code";
NSString *const kUserInfoCertificateUuid = @"uuid";
NSString *const kUserInfoCertificateTrueName = @"trueName";
NSString *const kUserInfoCertificateGood = @"good";
NSString *const kUserInfoCertificateName = @"name";
@interface UserInfoCertificate ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoCertificate
@synthesize bankCards = _bankCards;
@synthesize idValidated = _idValidated;
@synthesize code = _code;
@synthesize uuid = _uuid;
@synthesize trueName = _trueName;
@synthesize good = _good;
@synthesize name = _name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.bankCards = [self objectOrNilForKey:kUserInfoCertificateBankCards fromDictionary:dict];
self.idValidated = [[self objectOrNilForKey:kUserInfoCertificateIdValidated fromDictionary:dict] boolValue];
self.code = [self objectOrNilForKey:kUserInfoCertificateCode fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kUserInfoCertificateUuid fromDictionary:dict];
self.trueName = [self objectOrNilForKey:kUserInfoCertificateTrueName fromDictionary:dict];
self.good = [self objectOrNilForKey:kUserInfoCertificateGood fromDictionary:dict];
self.name = [self objectOrNilForKey:kUserInfoCertificateName fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
NSMutableArray *tempArrayForBankCards = [NSMutableArray array];
for (NSObject *subArrayObject in self.bankCards) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForBankCards addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForBankCards addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForBankCards] forKey:kUserInfoCertificateBankCards];
[mutableDict setValue:[NSNumber numberWithBool:self.idValidated] forKey:kUserInfoCertificateIdValidated];
[mutableDict setValue:self.code forKey:kUserInfoCertificateCode];
[mutableDict setValue:self.uuid forKey:kUserInfoCertificateUuid];
[mutableDict setValue:self.trueName forKey:kUserInfoCertificateTrueName];
[mutableDict setValue:self.good forKey:kUserInfoCertificateGood];
[mutableDict setValue:self.name forKey:kUserInfoCertificateName];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.bankCards = [aDecoder decodeObjectForKey:kUserInfoCertificateBankCards];
self.idValidated = [aDecoder decodeBoolForKey:kUserInfoCertificateIdValidated];
self.code = [aDecoder decodeObjectForKey:kUserInfoCertificateCode];
self.uuid = [aDecoder decodeObjectForKey:kUserInfoCertificateUuid];
self.trueName = [aDecoder decodeObjectForKey:kUserInfoCertificateTrueName];
self.good = [aDecoder decodeObjectForKey:kUserInfoCertificateGood];
self.name = [aDecoder decodeObjectForKey:kUserInfoCertificateName];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_bankCards forKey:kUserInfoCertificateBankCards];
[aCoder encodeBool:_idValidated forKey:kUserInfoCertificateIdValidated];
[aCoder encodeObject:_code forKey:kUserInfoCertificateCode];
[aCoder encodeObject:_uuid forKey:kUserInfoCertificateUuid];
[aCoder encodeObject:_trueName forKey:kUserInfoCertificateTrueName];
[aCoder encodeObject:_good forKey:kUserInfoCertificateGood];
[aCoder encodeObject:_name forKey:kUserInfoCertificateName];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoCertificate *copy = [[UserInfoCertificate alloc] init];
if (copy) {
copy.bankCards = [self.bankCards copyWithZone:zone];
copy.idValidated = self.idValidated;
copy.code = [self.code copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
copy.trueName = [self.trueName copyWithZone:zone];
copy.good = [self.good copyWithZone:zone];
copy.name = [self.name copyWithZone:zone];
}
return copy;
}
@end
//
// UserInfoCreateInfo.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoCreateInfo : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) id operator;
@property (nonatomic, assign) double time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoCreateInfo.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoCreateInfo.h"
NSString *const kUserInfoCreateInfoOperator = @"operator";
NSString *const kUserInfoCreateInfoTime = @"time";
@interface UserInfoCreateInfo ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoCreateInfo
@synthesize operator = _operator;
@synthesize time = _time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operator = [self objectOrNilForKey:kUserInfoCreateInfoOperator fromDictionary:dict];
self.time = [[self objectOrNilForKey:kUserInfoCreateInfoTime fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.operator forKey:kUserInfoCreateInfoOperator];
[mutableDict setValue:[NSNumber numberWithDouble:self.time] forKey:kUserInfoCreateInfoTime];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operator = [aDecoder decodeObjectForKey:kUserInfoCreateInfoOperator];
self.time = [aDecoder decodeDoubleForKey:kUserInfoCreateInfoTime];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operator forKey:kUserInfoCreateInfoOperator];
[aCoder encodeDouble:_time forKey:kUserInfoCreateInfoTime];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoCreateInfo *copy = [[UserInfoCreateInfo alloc] init];
if (copy) {
copy.operator = [self.operator copyWithZone:zone];
copy.time = self.time;
}
return copy;
}
@end
//
// UserInfoLastModifyInfo.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoLastModifyInfo : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) id operator;
@property (nonatomic, assign) double time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoLastModifyInfo.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoLastModifyInfo.h"
NSString *const kUserInfoLastModifyInfoOperator = @"operator";
NSString *const kUserInfoLastModifyInfoTime = @"time";
@interface UserInfoLastModifyInfo ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoLastModifyInfo
@synthesize operator = _operator;
@synthesize time = _time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operator = [self objectOrNilForKey:kUserInfoLastModifyInfoOperator fromDictionary:dict];
self.time = [[self objectOrNilForKey:kUserInfoLastModifyInfoTime fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.operator forKey:kUserInfoLastModifyInfoOperator];
[mutableDict setValue:[NSNumber numberWithDouble:self.time] forKey:kUserInfoLastModifyInfoTime];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operator = [aDecoder decodeObjectForKey:kUserInfoLastModifyInfoOperator];
self.time = [aDecoder decodeDoubleForKey:kUserInfoLastModifyInfoTime];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operator forKey:kUserInfoLastModifyInfoOperator];
[aCoder encodeDouble:_time forKey:kUserInfoLastModifyInfoTime];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoLastModifyInfo *copy = [[UserInfoLastModifyInfo alloc] init];
if (copy) {
copy.operator = [self.operator copyWithZone:zone];
copy.time = self.time;
}
return copy;
}
@end
//
// UserInfoLoginControl.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoLoginControl : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *loginIp;
@property (nonatomic, assign) double loginTime;
@property (nonatomic, assign) double failedTimes;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoLoginControl.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoLoginControl.h"
NSString *const kUserInfoLoginControlLoginIp = @"loginIp";
NSString *const kUserInfoLoginControlLoginTime = @"loginTime";
NSString *const kUserInfoLoginControlFailedTimes = @"failedTimes";
@interface UserInfoLoginControl ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoLoginControl
@synthesize loginIp = _loginIp;
@synthesize loginTime = _loginTime;
@synthesize failedTimes = _failedTimes;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.loginIp = [self objectOrNilForKey:kUserInfoLoginControlLoginIp fromDictionary:dict];
self.loginTime = [[self objectOrNilForKey:kUserInfoLoginControlLoginTime fromDictionary:dict] doubleValue];
self.failedTimes = [[self objectOrNilForKey:kUserInfoLoginControlFailedTimes fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.loginIp forKey:kUserInfoLoginControlLoginIp];
[mutableDict setValue:[NSNumber numberWithDouble:self.loginTime] forKey:kUserInfoLoginControlLoginTime];
[mutableDict setValue:[NSNumber numberWithDouble:self.failedTimes] forKey:kUserInfoLoginControlFailedTimes];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.loginIp = [aDecoder decodeObjectForKey:kUserInfoLoginControlLoginIp];
self.loginTime = [aDecoder decodeDoubleForKey:kUserInfoLoginControlLoginTime];
self.failedTimes = [aDecoder decodeDoubleForKey:kUserInfoLoginControlFailedTimes];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_loginIp forKey:kUserInfoLoginControlLoginIp];
[aCoder encodeDouble:_loginTime forKey:kUserInfoLoginControlLoginTime];
[aCoder encodeDouble:_failedTimes forKey:kUserInfoLoginControlFailedTimes];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoLoginControl *copy = [[UserInfoLoginControl alloc] init];
if (copy) {
copy.loginIp = [self.loginIp copyWithZone:zone];
copy.loginTime = self.loginTime;
copy.failedTimes = self.failedTimes;
}
return copy;
}
@end
//
// UserInfoOwnerOrg.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoOwnerOrg : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *code;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoOwnerOrg.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoOwnerOrg.h"
NSString *const kUserInfoOwnerOrgName = @"name";
NSString *const kUserInfoOwnerOrgUuid = @"uuid";
NSString *const kUserInfoOwnerOrgCode = @"code";
@interface UserInfoOwnerOrg ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoOwnerOrg
@synthesize name = _name;
@synthesize uuid = _uuid;
@synthesize code = _code;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.name = [self objectOrNilForKey:kUserInfoOwnerOrgName fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kUserInfoOwnerOrgUuid fromDictionary:dict];
self.code = [self objectOrNilForKey:kUserInfoOwnerOrgCode fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.name forKey:kUserInfoOwnerOrgName];
[mutableDict setValue:self.uuid forKey:kUserInfoOwnerOrgUuid];
[mutableDict setValue:self.code forKey:kUserInfoOwnerOrgCode];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.name = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgName];
self.uuid = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgUuid];
self.code = [aDecoder decodeObjectForKey:kUserInfoOwnerOrgCode];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_name forKey:kUserInfoOwnerOrgName];
[aCoder encodeObject:_uuid forKey:kUserInfoOwnerOrgUuid];
[aCoder encodeObject:_code forKey:kUserInfoOwnerOrgCode];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoOwnerOrg *copy = [[UserInfoOwnerOrg alloc] init];
if (copy) {
copy.name = [self.name copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
}
return copy;
}
@end
//
// UserInfoPasswordControl.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoPasswordControl : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double created;
@property (nonatomic, assign) id initPassword;
@property (nonatomic, assign) double expiry;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoPasswordControl.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoPasswordControl.h"
NSString *const kUserInfoPasswordControlCreated = @"created";
NSString *const kUserInfoPasswordControlInitPassword = @"initPassword";
NSString *const kUserInfoPasswordControlExpiry = @"expiry";
@interface UserInfoPasswordControl ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoPasswordControl
@synthesize created = _created;
@synthesize initPassword = _initPassword;
@synthesize expiry = _expiry;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.created = [[self objectOrNilForKey:kUserInfoPasswordControlCreated fromDictionary:dict] doubleValue];
self.initPassword = [self objectOrNilForKey:kUserInfoPasswordControlInitPassword fromDictionary:dict];
self.expiry = [[self objectOrNilForKey:kUserInfoPasswordControlExpiry fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[NSNumber numberWithDouble:self.created] forKey:kUserInfoPasswordControlCreated];
[mutableDict setValue:self.initPassword forKey:kUserInfoPasswordControlInitPassword];
[mutableDict setValue:[NSNumber numberWithDouble:self.expiry] forKey:kUserInfoPasswordControlExpiry];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.created = [aDecoder decodeDoubleForKey:kUserInfoPasswordControlCreated];
self.initPassword = [aDecoder decodeObjectForKey:kUserInfoPasswordControlInitPassword];
self.expiry = [aDecoder decodeDoubleForKey:kUserInfoPasswordControlExpiry];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeDouble:_created forKey:kUserInfoPasswordControlCreated];
[aCoder encodeObject:_initPassword forKey:kUserInfoPasswordControlInitPassword];
[aCoder encodeDouble:_expiry forKey:kUserInfoPasswordControlExpiry];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoPasswordControl *copy = [[UserInfoPasswordControl alloc] init];
if (copy) {
copy.created = self.created;
copy.initPassword = [self.initPassword copyWithZone:zone];
copy.expiry = self.expiry;
}
return copy;
}
@end
//
// UserInfoShop.h
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoShop : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *code;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// UserInfoShop.m
//
// Created by Z on 16/4/11
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "UserInfoShop.h"
NSString *const kUserInfoShopName = @"name";
NSString *const kUserInfoShopUuid = @"uuid";
NSString *const kUserInfoShopCode = @"code";
@interface UserInfoShop ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation UserInfoShop
@synthesize name = _name;
@synthesize uuid = _uuid;
@synthesize code = _code;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.name = [self objectOrNilForKey:kUserInfoShopName fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kUserInfoShopUuid fromDictionary:dict];
self.code = [self objectOrNilForKey:kUserInfoShopCode fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.name forKey:kUserInfoShopName];
[mutableDict setValue:self.uuid forKey:kUserInfoShopUuid];
[mutableDict setValue:self.code forKey:kUserInfoShopCode];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.name = [aDecoder decodeObjectForKey:kUserInfoShopName];
self.uuid = [aDecoder decodeObjectForKey:kUserInfoShopUuid];
self.code = [aDecoder decodeObjectForKey:kUserInfoShopCode];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_name forKey:kUserInfoShopName];
[aCoder encodeObject:_uuid forKey:kUserInfoShopUuid];
[aCoder encodeObject:_code forKey:kUserInfoShopCode];
}
- (id)copyWithZone:(NSZone *)zone
{
UserInfoShop *copy = [[UserInfoShop alloc] init];
if (copy) {
copy.name = [self.name copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
}
return copy;
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment