{"id":22042779,"url":"https://github.com/silence0201/simodel","last_synced_at":"2025-05-08T01:22:31.812Z","repository":{"id":56921888,"uuid":"79113340","full_name":"silence0201/SIModel","owner":"silence0201","description":"将JSON快速转换模型","archived":false,"fork":false,"pushed_at":"2017-03-17T15:19:18.000Z","size":246,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-04T10:04:43.092Z","etag":null,"topics":["json"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silence0201.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-16T11:48:48.000Z","updated_at":"2020-03-24T06:15:54.000Z","dependencies_parsed_at":"2022-08-21T04:50:07.860Z","dependency_job_id":null,"html_url":"https://github.com/silence0201/SIModel","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silence0201%2FSIModel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silence0201%2FSIModel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silence0201%2FSIModel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silence0201%2FSIModel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silence0201","download_url":"https://codeload.github.com/silence0201/SIModel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252979611,"owners_count":21835091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json"],"created_at":"2024-11-30T12:13:28.730Z","updated_at":"2025-05-08T01:22:31.780Z","avatar_url":"https://github.com/silence0201.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SIModel\n![Language](https://img.shields.io/badge/language-objc-orange.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)  \n将JSON快速转换模型\n\n使用说明\n====\n### 安装\n##### 手工导入\n将项目目录下的`SIModel`导入项目中\n\n### 使用\n1. 导入头文件\n\n\t```objective-c\n\t#import \"NSObject+SIModel.h\"\n\t```\n\t\n2. 建立模型对象,进行属性定义`(仅支持默认get和set方法)`\n3. 如果`Array`中包含自定义`Class`,需要实现:\n\n\t```objective-c\n\t+ (NSDictionary \u003cNSString *,Class\u003e *)si_clazzInArray{\n    \treturn @{@\"users\":[User class]} ;\n\t}\n\t```\n\t\n4. 如何属性名和JSON或字典中的key不相同,需要实现:\n\n\t```objective-c\n\t+ (NSDictionary \u003cNSString *,NSString *\u003e *)si_replaceKeyFromPropertyName{\n    \treturn @{\n          \t@\"ID\" : @\"id\" ,\n             \t@\"desc\" : @\"desciption\"\n             \t} ;\n\t}\n\t```\n\t\t\n5. 过程处理\n\n\t```objective-c\n\t+ (void)si_beginObjectToModel:(id)obj{\n    \tNSLog(@\"开始转换:%@\",obj) ;\n\t}\n\t+ (void)si_endObjectToModel:(id)model{\n   \t \tNSLog(@\"结束转换:%@\",model) ;\n\t}\n\t```\n\t\n6. 快速归档\n\n\t```objective-c\n\t@interface Members : NSObject\u003cNSCoding\u003e\n\t\n\t// 实现中添加\n\tSIModelCodingImplementation\n\t```\n\t\t\n7. 更多请查看`NSObject+SIModel.h`说明\n\n## SIModel\nSIModel is available under the MIT license. See the LICENSE file for more info.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilence0201%2Fsimodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilence0201%2Fsimodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilence0201%2Fsimodel/lists"}