Skip to content

清理代码,补充readme #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# APIJSONDemo

## 1、支持多数据源
## 支持多数据源

数据源解析顺序:

Expand Down Expand Up @@ -48,21 +48,25 @@

![image](https://user-images.githubusercontent.com/12228225/207245545-277ba9a6-e87f-42b3-af55-9d6a37384a1e.png)

## 2、集成elasticsearch-sql
## 集成elasticsearch-sql

换成xpack, 也一样

应用导入: elasticsearch-sql-7.17.5.0.jar

## 3、apijson支持elasticsearch功能点
## apijson elasticsearch type支持

APIJSONSQLConfig.*TABLE_KEY_MAP*.put("ES_blog", "es_blog/doc");

## apijson支持elasticsearch功能点

新增、修改、删除、查询

## 4、elasticsearch-sql不支持RLIKE
## elasticsearch-sql不支持RLIKE

![image](https://user-images.githubusercontent.com/12228225/207245701-ea2560a9-2389-4953-a568-9e85adfb15ad.png)

## 5、apijson支持字段 .keyword
## apijson支持字段 .keyword

```
{
Expand All @@ -81,7 +85,7 @@



## 4、示例
## 示例

### 单条插入

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,43 +77,11 @@ public void pwdEncrypt(@NotNull JSONObject current, @NotNull String id, @NotNull
current.put(password, c_password + "_" + System.currentTimeMillis());
}

/***
* 业务表-插入不同表1:n <br/>
* 业务表-批量修改不同表1:n <br/>
* 测试 子表 前置函数调用,修改值是否成果 <br/>
* user_address 表 addr字段
*
* @param current
* @param password
* @return
* @throws Exception
*/
public void childFunTest(@NotNull JSONObject current, @NotNull String addr) throws Exception {
String c_addr = current.getString(addr);
current.put(addr, c_addr + "_" + System.currentTimeMillis());
}

/***
* 没有在外层事物里面
*
* @throws Exception
*/
// private void insertTest() throws Exception {
// String json = "{\n" + " \"User\":{\n" + " \"username\":\"test\",\n"
// + " \"password\": \"233223\",\n" + " \"state\": 1\n" + " },\n" + " \"tag\": \"User\"\n"
// + "}";
// com.alibaba.fastjson.JSONObject requestObject = AbstractParser.parseRequest(json);
// JSONResponse response = new JSONResponse(new FormParser(POST, false).parseResponse(requestObject));
// log.info(response.toJSONString());
// }
//
// private void selectTest() throws Exception {
// String json = "{\n" + " \"User\": {\n" + " \"id\": \"4732209c-5785-4827-b532-5092f154fd94\"\n"
// + " },\n" + " \"tag\": \"User\"\n" + "}";
// com.alibaba.fastjson.JSONObject requestObject = AbstractParser.parseRequest(json);
// JSONResponse response = new JSONResponse(new FormParser(GET, false).parseResponse(requestObject));
// log.info(response.toJSONString());
// }

public void removeKeys(@NotNull JSONObject current, String keys) {
String[] ks = StringUtil.split(keys, ";"); // 用分号 ; 分割
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
* 1、应用启动添加数据源
* 2、页面动态添加数据源(数据库存储数据源信息)
*
* @author xy
*
*/
@Data
Expand Down

This file was deleted.