Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdate AbstractObjectParser.java #119
Merged
Conversation
POST(新增)支持批量,批量事务问题处理方式:全部成功,则成功,只要一条失败,全部失败
|
非常感谢,里面有个小 bug 会导致编译不通过,具体见批注 |
|
感谢贡献,已合并,现在你也是 APIJSON 项目的一个 Contributer 了 https://github.com/TommyLemon/APIJSON/graphs/contributors https://github.com/APIJSON/APIJSON/blob/master/README.md#%E8%B4%A1%E7%8C%AE%E8%80%85%E4%BB%AC |
| @@ -240,8 +240,33 @@ public AbstractObjectParser parse() throws Exception { | |||
| response.put(key, onChildParse(index, key, (JSONObject)value)); | |||
| index ++; | |||
| } | |||
| } | |||
| else if (method == PUT && value instanceof JSONArray | |||
| } else if (value instanceof JSONArray && method == POST && | |||
TommyLemon
Feb 27, 2020
Member
POST 未被 import 进来直接使用,编译报错
POST 未被 import 进来直接使用,编译报错
| JSONObject before = (JSONObject)response.get(key); | ||
| if(result.get("code").equals(200)){ | ||
| if(before!=null){ | ||
| before.put("count",before.getInteger("count")+result.getInteger("count")); |
TommyLemon
Feb 27, 2020
Member
"count" 已有 JSONRequst.KEY_COUNT 常量,建议替换
"count" 已有 JSONRequst.KEY_COUNT 常量,建议替换
| } | ||
| } else { | ||
| //只要有一条失败,则抛出异常,全部失败 | ||
| throw new RuntimeException(key + "," + valueArray.getJSONObject(i) +",新增失败!"); |
TommyLemon
Feb 27, 2020
Member
建议根据 JSONResponse.KEY_CODE 及 JSONResponse.KEY_MSG 改为更准确的 Exeption,方便排查错误
建议根据 JSONResponse.KEY_CODE 及 JSONResponse.KEY_MSG 改为更准确的 Exeption,方便排查错误
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.


POST(新增)支持批量,批量事务问题处理方式:全部成功,则成功,只要一条失败,全部失败