Skip to content

Commit 763ff41

Browse files
authored
Merge branch 'master' into bra1
2 parents 3d00f90 + af9a1fc commit 763ff41

File tree

7 files changed

+41
-22
lines changed

7 files changed

+41
-22
lines changed

APIJSONORM/build.sh

Whitespace-only changes.

APIJSONORM/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>apijson.orm</groupId>
77
<artifactId>apijson-orm</artifactId>
8-
<version>4.6.7</version>
8+
<version>4.7.2</version>
99
<packaging>jar</packaging>
1010

1111
<name>APIJSONORM</name>

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,10 @@ public void onFunctionResponse(String type) throws Exception {
774774
//解析函数function
775775
Set<Entry<String, String>> functionSet = map == null ? null : map.entrySet();
776776
if (functionSet != null && functionSet.isEmpty() == false) {
777-
// JSONObject json = "-".equals(type) ? request : response; // key-():function 是实时执行,而不是在这里批量执行
777+
JSONObject json = "-".equals(type) ? request : response; // key-():function 是实时执行,而不是在这里批量执行
778778

779779
for (Entry<String, String> entry : functionSet) {
780-
781-
// parseFunction(json, entry.getKey(), entry.getValue());
782-
parseFunction(entry.getKey(), entry.getValue(), parentPath, name, response);
780+
parseFunction(entry.getKey(), entry.getValue(), parentPath, name, json);
783781
}
784782
}
785783
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ public String getColumnString(boolean inSQLJoin) throws Exception {
10461046
// 由于 HashMap 对 key 做了 hash 处理,所以 get 比 containsValue 更快
10471047
if ("".equals(RAW_MAP.get(c)) || RAW_MAP.containsValue(c)) { // newSQLConfig 提前处理好的
10481048
//排除@raw中的值,以避免使用date_format(date,'%Y-%m-%d %H:%i:%s') 时,冒号的解析出错
1049-
column.remove(c);
1049+
//column.remove(c);
10501050
continue;
10511051
}
10521052
}
@@ -1525,7 +1525,7 @@ public static String getLimitString(int page, int count, boolean isTSQL, boolean
15251525
int offset = getOffset(page, count);
15261526

15271527
if (isTSQL) { // OFFSET FECTH 中所有关键词都不可省略, 另外 Oracle 数据库使用子查询加 where 分页
1528-
return isOracle? " WHERE ROWNUM BETWEEN "+ offset +" AND "+ (offset + count): " OFFSET " + offset + " ROWS FETCH FIRST " + count + " ROWS ONLY";
1528+
return isOracle ? " WHERE ROWNUM BETWEEN "+ offset +" AND "+ (offset + count) : " OFFSET " + offset + " ROWS FETCH FIRST " + count + " ROWS ONLY";
15291529
}
15301530

15311531
return " LIMIT " + count + (offset <= 0 ? "" : " OFFSET " + offset); // DELETE, UPDATE 不支持 OFFSET

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,14 @@ public void verifyRepeat(String table, String key, Object value, long exceptId)
447447
if (exceptId > 0) {//允许修改自己的属性为该属性原来的值
448448
request.put(JSONRequest.KEY_ID + "!", exceptId); // FIXME 这里 id 写死了,不支持自定义
449449
}
450-
JSONObject repeat = createParser().setMethod(GET).setNeedVerify(true).parseResponse(
450+
JSONObject repeat = createParser().setMethod(HEAD).setNeedVerify(true).parseResponse(
451451
new JSONRequest(table, request)
452452
);
453453
repeat = repeat == null ? null : repeat.getJSONObject(table);
454454
if (repeat == null) {
455455
throw new Exception("服务器内部错误 verifyRepeat repeat == null");
456456
}
457-
if (repeat.getIntValue(JSONResponse.KEY_CODE) > 0) {
457+
if (repeat.getIntValue(JSONResponse.KEY_COUNT) > 0) {
458458
throw new ConflictException(key + ": " + value + " 已经存在,不能重复!");
459459
}
460460
}
@@ -1424,7 +1424,7 @@ public static void verifyRepeat(String table, String key, Object value, long exc
14241424

14251425
String finalIdKey = StringUtil.isEmpty(idKey, false) ? apijson.JSONObject.KEY_ID : idKey;
14261426

1427-
SQLConfig config = creator.createSQLConfig().setMethod(RequestMethod.GET).setCount(1).setPage(0);
1427+
SQLConfig config = creator.createSQLConfig().setMethod(RequestMethod.HEAD).setCount(1).setPage(0);
14281428
config.setTable(table);
14291429
if (exceptId > 0) { //允许修改自己的属性为该属性原来的值
14301430
config.putWhere(finalIdKey + "!", exceptId, false);
@@ -1437,7 +1437,7 @@ public static void verifyRepeat(String table, String key, Object value, long exc
14371437
if (result == null) {
14381438
throw new Exception("服务器内部错误 verifyRepeat result == null");
14391439
}
1440-
if (result.getIntValue(JSONResponse.KEY_CODE) > 0) {
1440+
if (result.getIntValue(JSONResponse.KEY_COUNT) > 0) {
14411441
throw new ConflictException(key + ": " + value + " 已经存在,不能重复!");
14421442
}
14431443
} finally {

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
- [Wscats](https://github.com/Wscats)(腾讯工程师)
3232
- [jun0315](https://github.com/jun0315)(腾讯工程师)
3333
- [JieJo](https://github.com/JieJo)
34+
- [yeyuezhishou](https://github.com/yeyuezhishou)(圆通工程师)
35+
- [kenlig](https://github.com/kenlig)
36+
- [andream7](https://github.com/andream7)
3437

3538

3639
#### 其中特别致谢: <br/>

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[【腾讯犀牛鸟开源人才培养计划】开始啦!加入我们开源共建吧~](https://github.com/Tencent/APIJSON/issues/229)
2-
31
Tencent is pleased to support the open source community by making APIJSON available. <br/>
42
Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. <br/>
53
This source code is licensed under the Apache License Version 2.0 <br/>
@@ -241,7 +239,7 @@ https://github.com/Tencent/APIJSON/issues/187
241239

242240

243241
### 贡献者们
244-
主项目 APIJSON 的贡献者们(5 个腾讯工程师、1 个知乎基础研发架构师 等):<br />
242+
主项目 APIJSON 的贡献者们(5 个腾讯工程师、1 个知乎基础研发架构师、1 个圆通工程师 等):<br />
245243
https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md <br />
246244
<div style="float:left">
247245
<a href="https://github.com/TommyLemon"><img src="https://avatars1.githubusercontent.com/u/5738175?s=400&u=5b2f372f0c03fae8f249d2d754e38971c2e17b92&v=4"
@@ -269,6 +267,9 @@ https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md <br />
269267
<a href="https://github.com/Tencent/APIJSON/pull/233"><img src="https://avatars.githubusercontent.com/u/1252459?v=4" height="54" width="54" ></a>
270268
<a href="https://github.com/Tencent/APIJSON/pull/250"><img src="https://avatars.githubusercontent.com/u/44310040?v=4" height="54" width="54" ></a>
271269
<a href="https://github.com/Tencent/APIJSON/pull/253"><img src="https://avatars.githubusercontent.com/u/19265050?v=4" height="54" width="54" ></a>
270+
<a href="https://github.com/Tencent/APIJSON/pull/278"><img src="https://avatars.githubusercontent.com/u/4099373?v=4" height="54" width="54" ></a>
271+
<a href="https://github.com/Tencent/APIJSON/pull/279"><img src="https://avatars.githubusercontent.com/u/28685375?v=4" height="54" width="54" ></a>
272+
<a href="https://github.com/Tencent/APIJSON/pull/280"><img src="https://avatars.githubusercontent.com/u/60541766?v=4" height="54" width="54" ></a>
272273
</div>
273274
<br />
274275

@@ -279,6 +280,8 @@ https://search.gitee.com/?skin=rec&type=repository&q=apijson&sort=stars_count <b
279280
<a href="https://github.com/APIJSON/apijson-orm"><img src="https://avatars.githubusercontent.com/u/41146037?s=200&v=4"
280281
height="54" width="54" ></a>
281282
<a href="https://github.com/liaozb/APIJSON.NET"><img src="https://avatars3.githubusercontent.com/u/12622501?s=400&v=4"
283+
height="54" width="54" ></a>
284+
<a href="https://gitee.com/tiangao/apijson-go"><img src="https://portrait.gitee.com/uploads/avatars/user/43/130007_tiangao_1578918889.png!avatar200"
282285
height="54" width="54" ></a>
283286
<a href="https://github.com/qq547057827/apijson-php"><img src="https://avatars3.githubusercontent.com/u/1657532?s=400&v=4" height="54" width="54" ></a>
284287
<a href="https://github.com/xianglong111/json-api"><img src="https://avatars.githubusercontent.com/u/9738743?s=460&v=4" height="54" width="54" ></a>
@@ -380,7 +383,7 @@ https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
380383

381384
[APIJSON复杂业务深入实践(类似12306订票系统)](https://blog.csdn.net/aa330233789/article/details/105309571)
382385

383-
[全国行政区划数据抓取与处理](https://my.oschina.net/hwxia/blog/4999897)
386+
[全国行政区划数据抓取与处理](https://www.xlongwei.com/detail/21032616)
384387

385388
### 生态项目
386389
[APIJSON-Demo](https://github.com/APIJSON/APIJSON-Demo) APIJSON 各种语言、各种框架 的 使用示例项目、上手文档、测试数据 SQL 文件 等
@@ -445,17 +448,32 @@ https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
445448
感谢热心的作者们的贡献,点 ⭐Star 支持下他们吧。
446449

447450
### 腾讯犀牛鸟开源人才培养计划
451+
https://github.com/Tencent/APIJSON/issues/229
448452

449453
#### qiujunlin **2.接入 presto/hive/clickhouse/db2 任意一个**
450454

451-
APIJSON 接入 clickhouse 使用demo
452-
455+
APIJSON 接入 clickhouse 使用demo <br />
453456
https://github.com/qiujunlin/APIJSONDemo
454-
455-
#### zhouzuobiao 1.完善入门介绍视频
456-
457-
APIJSON- 后端零代码接口和文档ORM库 <br />
458-
https://lexiangla.com/teams/k100046/classes/a4eba9f4b6d711eba2ec268dd73d15f1?type=0&company_from=79350bd4d06911ea91f05254002f1020
457+
458+
#### zhangshukun 2.接入 presto/hive/clickhouse/db2 任意一个
459+
APIJSON-Demo接入db2 <br />
460+
https://github.com/andream7/apijson-db2
461+
462+
#### zhaoqiming 1.完善入门介绍视频
463+
APIJSON 后端教程(1):简介
464+
https://www.bilibili.com/video/BV1vL411W7yd
465+
466+
APIJSON 后端教程(2):数据库
467+
https://www.bilibili.com/video/BV1eB4y1N77s
468+
469+
APIJSON 后端教程(3):Demo
470+
https://www.bilibili.com/video/BV1FX4y1c7ug
471+
472+
APIJSON 后端教程(4):Boot
473+
https://www.bilibili.com/video/BV18h411z7FK
474+
475+
APIJSON 后端教程(5):Final
476+
https://www.bilibili.com/video/BV1GM4y1N7XJ
459477

460478
### 持续更新
461479

0 commit comments

Comments
 (0)