iOS 工具 json 模型类生成
2018-01-21 13:07
127 查看
iOS 工具 json 模型类生成
在开发过程中免不了要和后台交互,常用的数据格式是json,例如: 家谱图{ "grandfather1": { "father1": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0 }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ] }, "father2": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0 }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ] }, "name": "ton", "retired": 1 }, "grandfather2": { "father1": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0 }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ] }, "father2": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0 }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ] }, "name": "ton", "retired": 1 } }
这样的格式是很常见的,一般的都是一个字典对应一个模型,字典中的key,少一点还好,如果比较多的话,写起来可能就比较累了(毕竟这是一个体力活),所以我就偷懒,试着写了这么一个工具,帮助自己,节省体力(喝杯Java☕️的时间,就生成好模型),
具体用法是:
{ "grandfather1": { "father1": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0, "class": "Grandchild" }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei", "class": "Son" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ], "field": "value", "class": "Father" }, "father2": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0 }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ] }, "name": "ton", "retired": 1, "class": "Grandfather" }, "grandfather2": { "father1": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0 }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ] }, "father2": { "son": { "grandchild": { "name": "tom", "age": 18, "smart": 1, "have_girlfriend": 0 }, "name": "Jim", "age": 40, "haveBoy": 1, "wife": "mei" }, "name": "Dave", "wife": "yun", "have_son": 1, "house": [ "house", "house1", "house2" ] }, "name": "ton", "retired": 1 } }
在字典中添加了一个key:class(生成模型的文件名和类型名)
数字(0,1)表示bool类型,
这里有json文件(?)和model文件夹(生成类地址),
将json文件路径和model路径填写好(可以直接拖进去,一般人我都不告诉他),点击done,(喝杯Java☕️)然后,
就没有然后了,
GitHub : 点击打开链接
相关文章推荐
- [置顶] iOS 懒加载一键生成工具(MacOS 应用)
- [注释代码块] iOS生成标准的注释工具——VVDocumenter
- 【IOS游戏开发】之 生成短网址的工具收集
- Web 开发人员必备的随机 JSON 数据生成工具
- IOS工具, 解码,charles,json校验等工具使用地址
- PETSHOP模式IDAL,SQLSERVERDAL,存储过程以及模型类代码的生成工具
- iOS json解析 和生成json串
- js 实现微信可视化菜单json生成工具
- 生成 JSON 字符串的工具
- 利用在线工具根据JSon数据自动生成对应的Java实体类
- ios的对象数组生成jsonarray
- Android开发常用-Json(GSON)自动生成实体类工具 2.0
- ios的对象数组生成jsonarray
- JSON生成c#类代码小工具(转)
- iOS 使用工具生成类图
- JSON C# Class Generator ---由json字符串生成C#实体类的工具
- JSON C# Class Generator ---由json字符串生成C#实体类的工具
- iOS 移动端生成工具开发
- Json生成Lua Table工具
- iOS开发第三方工具——JSONKit