@@ -72,7 +72,7 @@ public Parser<Long> newParser(HttpSession session, RequestMethod method) {
7272 public String parse (String request , HttpSession session , RequestMethod method ) {
7373 return newParser (session , method ).parse (request );
7474 }
75-
75+
7676 //通用接口,非事务型操作 和 简单事务型操作 都可通过这些接口自动化实现<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
7777
7878 /**获取
@@ -231,9 +231,12 @@ public Object logout(@NotNull HttpSession session) {
231231
232232
233233 public JSONObject listMethod (String request ) {
234+ if (Log .DEBUG == false ) {
235+ return APIJSONParser .newErrorResult (new IllegalAccessException ("非 DEBUG 模式下不允许使用 UnitAuto 单元测试!" ));
236+ }
234237 return MethodUtil .listMethod (request );
235238 }
236-
239+
237240 public void invokeMethod (String request , HttpServletRequest servletRequest ) {
238241 AsyncContext asyncContext = servletRequest .startAsync ();
239242
@@ -243,8 +246,8 @@ public void invokeMethod(String request, HttpServletRequest servletRequest) {
243246 public void complete (JSONObject data , Method method , InterfaceProxy proxy , Object ... extras ) throws Exception {
244247 ServletResponse servletResponse = asyncContext .getResponse ();
245248 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 ;
248251 }
249252
250253 servletResponse .setCharacterEncoding (servletRequest .getCharacterEncoding ());
@@ -253,6 +256,19 @@ public void complete(JSONObject data, Method method, InterfaceProxy proxy, Objec
253256 asyncContext .complete ();
254257 }
255258 };
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+
256272
257273 try {
258274 MethodUtil .invokeMethod (request , null , listener );
0 commit comments