Skip to content

Commit 8592367

Browse files
committed
Server:DemoParser内parseCorrectRequest(JSONObject)抽象到AbstractParser
1 parent 198d897 commit 8592367

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

APIJSON-Java-Server/APIJSONDemo/src/main/java/apijson/demo/server/DemoParser.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@
2222
import zuo.biao.apijson.server.AbstractParser;
2323
import zuo.biao.apijson.server.JSONRequest;
2424
import zuo.biao.apijson.server.SQLConfig;
25-
import zuo.biao.apijson.server.SQLCreator;
2625
import zuo.biao.apijson.server.SQLExecutor;
27-
import zuo.biao.apijson.server.Structure;
2826
import zuo.biao.apijson.server.Verifier;
2927

3028

3129
/**请求解析器
3230
* @author Lemon
3331
*/
34-
public class DemoParser extends AbstractParser implements SQLCreator {
32+
public class DemoParser extends AbstractParser {
3533

3634

3735
public DemoParser() {
@@ -125,12 +123,6 @@ protected void onVerifyContent() throws Exception {
125123
super.onVerifyContent();
126124
}
127125

128-
129-
@Override
130-
public JSONObject parseCorrectRequest(JSONObject target) throws Exception {
131-
return Structure.parseRequest(requestMethod, "", target, requestObject, getMaxUpdateCount(), this);
132-
}
133-
134126
// //可重写来设置最大查询数量
135127
// @Override
136128
// public int getMaxQueryCount() {

APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server/AbstractParser.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**parser for parsing request to JSONObject
4646
* @author Lemon
4747
*/
48-
public abstract class AbstractParser implements Parser {
48+
public abstract class AbstractParser implements Parser, SQLCreator {
4949
protected static final String TAG = "AbstractParser";
5050

5151

@@ -340,9 +340,11 @@ public static JSONObject parseRequest(String request) throws Exception {
340340
return obj;
341341
}
342342

343-
344-
345-
343+
@Override
344+
public JSONObject parseCorrectRequest(JSONObject target) throws Exception {
345+
return Structure.parseRequest(requestMethod, "", target, requestObject, getMaxUpdateCount(), this);
346+
}
347+
346348

347349
/**新建带状态内容的JSONObject
348350
* @param code

0 commit comments

Comments
 (0)