Skip to content

Commit 1c3940b

Browse files
committed
Server: PUT 请求在没有 SET 语句时直接报错
1 parent d969721 commit 1c3940b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,10 +1519,11 @@ public String getSetString() throws Exception {
15191519
@JSONField(serialize = false)
15201520
public String getSetString(RequestMethod method, Map<String, Object> content, boolean verifyName) throws Exception {
15211521
Set<String> set = content == null ? null : content.keySet();
1522+
String setString = "";
1523+
15221524
if (set != null && set.size() > 0) {
15231525
String quote = getQuote();
15241526

1525-
String setString = "";
15261527
boolean isFirst = true;
15271528
int keyType = 0;// 0 - =; 1 - +, 2 - -
15281529
Object value;
@@ -1546,12 +1547,12 @@ public String getSetString(RequestMethod method, Map<String, Object> content, bo
15461547

15471548
isFirst = false;
15481549
}
1549-
if (setString.isEmpty()) {
1550-
throw new NotExistException(TAG + "getSetString >> setString.isEmpty()");
1551-
}
1552-
return " SET " + setString;
15531550
}
1554-
return "";
1551+
1552+
if (setString.isEmpty()) {
1553+
throw new IllegalArgumentException("PUT 请求必须在Table内设置要修改的 key:value !");
1554+
}
1555+
return " SET " + setString;
15551556
}
15561557

15571558
/**SET key = CONCAT (key, 'value')

0 commit comments

Comments
 (0)