|
20 | 20 | import apijson.NotNull; |
21 | 21 |
|
22 | 22 |
|
23 | | -/**SpringBootApplication |
| 23 | +/**启动入口 Application |
24 | 24 | * 右键这个类 > Run As > Java Application |
25 | 25 | * @author Lemon |
26 | 26 | */ |
@@ -73,77 +73,80 @@ public static void init(boolean shutdownWhenServerError, @NotNull APIJSONCreator |
73 | 73 | APIJSONController.APIJSON_CREATOR = creator; |
74 | 74 |
|
75 | 75 |
|
76 | | - System.out.println("\n\n\n开始初始化: 权限校验配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
| 76 | + System.out.println("\n\n\n开始初始化: Access 权限校验配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
77 | 77 | try { |
78 | 78 | APIJSONVerifier.initAccess(shutdownWhenServerError, creator); |
79 | 79 | } |
80 | 80 | catch (Throwable e) { |
81 | 81 | e.printStackTrace(); |
82 | 82 | if (shutdownWhenServerError) { |
83 | | - onServerError("权限校验配置 初始化失败!", shutdownWhenServerError); |
| 83 | + onServerError("权Access 限校验配置 初始化失败!", shutdownWhenServerError); |
84 | 84 | } |
85 | 85 | } |
86 | | - System.out.println("\n完成初始化: 权限校验配置 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
| 86 | + System.out.println("\n完成初始化: Access 权限校验配置 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
87 | 87 |
|
88 | 88 |
|
89 | 89 |
|
90 | | - System.out.println("\n\n\n开始初始化: 远程函数配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
| 90 | + System.out.println("\n\n\n开始初始化: Function 远程函数配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
91 | 91 | try { |
92 | 92 | APIJSONFunctionParser.init(shutdownWhenServerError, creator); |
93 | 93 | } |
94 | 94 | catch (Throwable e) { |
95 | 95 | e.printStackTrace(); |
96 | 96 | if (shutdownWhenServerError) { |
97 | | - onServerError("远程函数配置 初始化失败!", shutdownWhenServerError); |
| 97 | + onServerError("Function 远程函数配置 初始化失败!", shutdownWhenServerError); |
98 | 98 | } |
99 | 99 | } |
100 | | - System.out.println("\n完成初始化: 远程函数配置 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
| 100 | + System.out.println("\n完成初始化: Function 远程函数配置 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
101 | 101 |
|
102 | | - System.out.println("开始测试: 远程函数 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
| 102 | + System.out.println("开始测试: Function 远程函数 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
103 | 103 | try { |
104 | 104 | APIJSONFunctionParser.test(); |
105 | 105 | } |
106 | 106 | catch (Throwable e) { |
107 | 107 | e.printStackTrace(); |
108 | 108 | if (shutdownWhenServerError) { |
109 | | - onServerError("远程函数配置 测试失败!", shutdownWhenServerError); |
| 109 | + onServerError("Function 远程函数配置 测试失败!", shutdownWhenServerError); |
110 | 110 | } |
111 | 111 | } |
112 | | - System.out.println("\n完成测试: 远程函数 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
| 112 | + System.out.println("\n完成测试: Function 远程函数 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
113 | 113 |
|
114 | 114 |
|
115 | 115 |
|
116 | | - System.out.println("\n\n\n开始初始化: 请求结构校验配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
| 116 | + System.out.println("\n\n\n开始初始化: Request 请求参数校验配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
117 | 117 | try { |
118 | 118 | APIJSONVerifier.initRequest(shutdownWhenServerError, creator); |
119 | 119 | } |
120 | 120 | catch (Throwable e) { |
121 | 121 | e.printStackTrace(); |
122 | 122 | if (shutdownWhenServerError) { |
123 | | - onServerError("请求结构校验配置 初始化失败!", shutdownWhenServerError); |
| 123 | + onServerError("Request 请求参数校验配置 初始化失败!", shutdownWhenServerError); |
124 | 124 | } |
125 | 125 | } |
126 | | - System.out.println("\n完成初始化: 请求结构校验配置 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
| 126 | + System.out.println("\n完成初始化: Request 请求参数校验校验配置 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
127 | 127 |
|
128 | | - System.out.println("\n\n\n开始测试: Request 和 Response 的数据结构校验 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
| 128 | + System.out.println("\n\n\n开始测试: Request 请求参数校验 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); |
129 | 129 | try { |
130 | 130 | APIJSONVerifier.testStructure(); |
131 | 131 | } |
132 | 132 | catch (Throwable e) { |
133 | 133 | e.printStackTrace(); |
134 | 134 | if (shutdownWhenServerError) { |
135 | | - onServerError("Request 和 Response 的数据结构校验 测试失败!", shutdownWhenServerError); |
| 135 | + onServerError("Request 请求参数校验 测试失败!", shutdownWhenServerError); |
136 | 136 | } |
137 | 137 | } |
138 | | - System.out.println("\n完成测试: Request 和 Response 的数据结构校验 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
| 138 | + System.out.println("\n完成测试: Request 请求参数校验 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
139 | 139 |
|
140 | 140 |
|
141 | 141 |
|
142 | 142 |
|
143 | | - System.out.println("\n\n<<<<<<<<<<<<<<<<<<<<<<<<< APIJSON 启动完成,试试调用自动化 API 吧 ^_^ >>>>>>>>>>>>>>>>>>>>>>>>\n"); |
| 143 | + System.out.println("官方网站: http://apijson.cn"); |
| 144 | + System.out.println("设计规范: https://github.com/Tencent/APIJSON/blob/master/Document.md#3"); |
| 145 | + System.out.println("测试链接: http://apijson.cn/api?type=JSON&url=http://localhos:8080/get"); |
| 146 | + System.out.println("\n\n<<<<<<<<<<<<<<<<<<<<<<<<< APIJSON 启动完成,试试调用零代码万能通用 API 吧 ^_^ >>>>>>>>>>>>>>>>>>>>>>>>\n"); |
144 | 147 | } |
145 | 148 |
|
146 | | - private static void onServerError(String msg, boolean shutdown) throws ServerException { |
| 149 | + protected static void onServerError(String msg, boolean shutdown) throws ServerException { |
147 | 150 | Log.e(TAG, "\n启动时自检测试未通过!原因:\n" + msg); |
148 | 151 |
|
149 | 152 | if (shutdown) { |
|
0 commit comments