1
1
# SKGenerateModelTool
2
2
3
- [ ![ ] ( https://img.shields.io/badge/.dmg-4.2MB-brightgreen )] ( https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg ) ![ ] ( https://img.shields.io/badge/Dart-flutter-blue )
4
- ![ ] ( https://img.shields.io/badge/TypeScript-interface-brightgreen )
5
- ![ ] ( https://img.shields.io/badge/Swift-91.7%25-brightgreen )
6
- ![ ] ( https://img.shields.io/badge/license-MIT-green )
7
-
3
+ [ ![ ] ( https://img.shields.io/badge/.dmg-4.2MB-brightgreen )] ( https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg ) ![ ] ( https://img.shields.io/badge/Dart-flutter-blue )
4
+ ![ ] ( https://img.shields.io/badge/TypeScript-interface-brightgreen )
5
+ ![ ] ( https://img.shields.io/badge/Swift-91.7%25-brightgreen )
6
+ ![ ] ( https://img.shields.io/badge/license-MIT-green )
8
7
9
8
- 支持` Objective-C ` / ` Swift ` / ` Dart ` / ` TypeScript `
10
- - 支持通过` URL ` 链接或` json ` 字符串一键生成model文件
9
+ - 支持通过` URL ` 链接或` json ` 字符串一键生成 model 文件
11
10
- 兼容` YYModel ` / ` MJExtension ` / ` HandyJSON ` 解析
12
- - 支持字符串加密(可设置不同的密钥,开发者可自行修改加密算法)
13
- - 支持自定义model父类名、自定义model前缀、自定义作者名、添加注释
11
+ - Swift 模型默认使用` Codable ` 协议
12
+ - 支持字符串加密及可扩展的自定义加密算法实现
13
+ - 支持自定义模型基类、命名前缀、作者信息及注释
14
14
- 支持代码高亮(使用[ highlight.js] ( https://highlightjs.org/ ) )
15
15
- 支持导出` TypeScript Interfaces `
16
16
- 支持自定义导出文件路径
17
17
- ` Flutter Model ` 解析兼容了服务端返回` string/int/double ` 时数据类型混用的情况
18
- - 兼容服务端返回“id”字段
19
- - 支持类驼峰命名
20
-
18
+ - 兼容服务端字段类型混用场景
19
+ - 支持驼峰命名
21
20
22
21
- Support ` Objective-C ` / ` Swift ` / ` Dart ` / ` TypeScript `
23
22
- Supports one-click generation of model files through ` URL ` links or ` json ` strings
24
23
- Compatible with ` YYModel ` / ` MJExtension ` / ` HandyJSON ` analysis
24
+ - Swift models use the Codable protocol by default
25
25
- Support string encryption (different keys can be set, developers can modify the encryption algorithm)
26
26
- Support custom model superclass name, custom model prefix, custom author name, add comments
27
27
- Support code highlighting(It uses [ highlight.js] ( https://highlightjs.org/ ) as it core)
33
33
34
34
### Usage
35
35
36
- > * 方式一:直接下载软件安装 [ 点击下载] ( https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg )
37
- > * 方式二:下载代码运行
38
-
36
+ > - 方式一:直接下载软件安装 [ 点击下载] ( https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg )
37
+ > - 方式二:下载代码运行
39
38
40
39
### Objective-C
41
40
57
56
58
57
![ 字符串加密示例] ( ../master/images/encrypt.png )
59
58
60
- 加密后的内容添加到项目中(声明和定义可以分别放.h和 .m),因为代码依赖SKEncryptString结构体 ,所以需要导入头文件** SKEncryptHeader.h** 引用。
59
+ 加密后的内容添加到项目中(声明和定义可以分别放.h 和 .m),因为代码依赖 SKEncryptString 结构体 ,所以需要导入头文件** SKEncryptHeader.h** 引用。
61
60
62
- > 只需把此头文件(SKEncryptHeader.h)加入到项目,并在pch文件中导入该头文件即可使用 ;
63
- Just add this header file (SKEncryptHeader.h) to the project and import the header file in the pch file to use;
61
+ > 只需把此头文件(SKEncryptHeader.h)加入到项目,并在 pch 文件中导入该头文件即可使用 ;
62
+ > Just add this header file (SKEncryptHeader.h) to the project and import the header file in the pch file to use;
64
63
65
64
![ SKEncryptHeader.h] ( ../master/images/SKEncryptHeader.png )
66
65
@@ -78,6 +77,7 @@ extern const SKEncryptString * const _3908173925;
78
77
```
79
78
80
79
定义:
80
+
81
81
```
82
82
/** 需要加密的重要字符,比如AppKey、AppSecret、AppID、数据库密码等 */
83
83
const SKEncryptString * const _3596508958 = &(SKEncryptString){
@@ -118,6 +118,4 @@ const SKEncryptString * const _3908173925 = &(SKEncryptString){
118
118
119
119
![ encrypt_result] ( ../master/images/encrypt_result.png )
120
120
121
- Tip:本工具仅用到简单的XOR加密算法,开发者可自行下载项目进行加密算法修改,另外也可直接下载项目里的dmg文件进行安装使用。
122
-
123
- - 简书地址:[ https://www.jianshu.com/p/a2ee31a04252 ] ( https://www.jianshu.com/p/a2ee31a04252 )
121
+ Tip:本工具仅用到简单的 XOR 加密算法,开发者可自行下载项目进行加密算法修改,另外也可直接下载项目里的 dmg 文件进行安装使用。
0 commit comments