Skip to content

Commit d325d63

Browse files
committed
最外层返回当前时间戳毫秒值,方便前后端同步校准时间等场景
1 parent 31b58e6 commit d325d63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ public JSONObject parseResponse(JSONObject request) {
481481
long endTime = System.currentTimeMillis();
482482
long duration = endTime - startTime;
483483

484+
res.putIfAbsent("time", endTime);
484485
if (Log.DEBUG) {
485486
res.put("sql:generate|cache|execute|maxExecute", getSQLExecutor().getGeneratedSQLCount() + "|" + getSQLExecutor().getCachedSQLCount() + "|" + getSQLExecutor().getExecutedSQLCount() + "|" + getMaxSQLCount());
486487
res.put("depth:count|max", queryDepth + "|" + getMaxQueryDepth());
@@ -874,7 +875,7 @@ public static JSONObject newErrorResult(Exception e, boolean isRoot) {
874875
*/
875876
@Override
876877
public JSONObject parseCorrectRequest() throws Exception {
877-
if(this.getMethod() != RequestMethod.CRUD) {
878+
if (getMethod() != RequestMethod.CRUD) {
878879
setTag(requestObject.getString(JSONRequest.KEY_TAG));
879880
}
880881
setVersion(requestObject.getIntValue(JSONRequest.KEY_VERSION));

0 commit comments

Comments
 (0)