@@ -72,7 +72,7 @@ public Parser<Long> newParser(HttpSession session, RequestMethod method) {
72
72
public String parse (String request , HttpSession session , RequestMethod method ) {
73
73
return newParser (session , method ).parse (request );
74
74
}
75
-
75
+
76
76
//通用接口,非事务型操作 和 简单事务型操作 都可通过这些接口自动化实现<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
77
77
78
78
/**获取
@@ -231,9 +231,12 @@ public Object logout(@NotNull HttpSession session) {
231
231
232
232
233
233
public JSONObject listMethod (String request ) {
234
+ if (Log .DEBUG == false ) {
235
+ return APIJSONParser .newErrorResult (new IllegalAccessException ("非 DEBUG 模式下不允许使用 UnitAuto 单元测试!" ));
236
+ }
234
237
return MethodUtil .listMethod (request );
235
238
}
236
-
239
+
237
240
public void invokeMethod (String request , HttpServletRequest servletRequest ) {
238
241
AsyncContext asyncContext = servletRequest .startAsync ();
239
242
@@ -243,8 +246,8 @@ public void invokeMethod(String request, HttpServletRequest servletRequest) {
243
246
public void complete (JSONObject data , Method method , InterfaceProxy proxy , Object ... extras ) throws Exception {
244
247
ServletResponse servletResponse = asyncContext .getResponse ();
245
248
if (servletResponse .isCommitted ()) {
246
- Log .w (TAG , "invokeMethod listener.complete servletResponse.isCommitted() >> return;" );
247
- return ;
249
+ Log .w (TAG , "invokeMethod listener.complete servletResponse.isCommitted() >> return;" );
250
+ return ;
248
251
}
249
252
250
253
servletResponse .setCharacterEncoding (servletRequest .getCharacterEncoding ());
@@ -253,6 +256,19 @@ public void complete(JSONObject data, Method method, InterfaceProxy proxy, Objec
253
256
asyncContext .complete ();
254
257
}
255
258
};
259
+
260
+ if (Log .DEBUG == false ) {
261
+ try {
262
+ listener .complete (MethodUtil .JSON_CALLBACK .newErrorResult (new IllegalAccessException ("非 DEBUG 模式下不允许使用 UnitAuto 单元测试!" )));
263
+ }
264
+ catch (Exception e1 ) {
265
+ e1 .printStackTrace ();
266
+ asyncContext .complete ();
267
+ }
268
+
269
+ return ;
270
+ }
271
+
256
272
257
273
try {
258
274
MethodUtil .invokeMethod (request , null , listener );
0 commit comments