Skip to content

Commit a45b96a

Browse files
committed
APIJSONController 新增 getRequestURL 并调用 AbstractParser.setRequestURL 传参
1 parent 2bb8ad5 commit a45b96a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/apijson/framework/APIJSONController.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,20 @@ public class APIJSONController {
6969
APIJSON_CREATOR = new APIJSONCreator();
7070
}
7171

72+
public String getRequestURL() {
73+
return null;
74+
}
7275

7376
public Parser<Long> newParser(HttpSession session, RequestMethod method) {
7477
Parser<Long> parser = APIJSON_CREATOR.createParser();
7578
parser.setMethod(method);
7679
if (parser instanceof APIJSONParser) {
7780
((APIJSONParser) parser).setSession(session);
7881
}
82+
// 可以更方便地通过日志排查错误
83+
if (parser instanceof AbstractParser) {
84+
((AbstractParser<?>) parser).setRequestURL(getRequestURL());
85+
}
7986
return parser;
8087
}
8188

0 commit comments

Comments
 (0)