Skip to content

Commit 3cf0cb5

Browse files
committed
docs: 更新一些文档
1 parent 6636d96 commit 3cf0cb5

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

doc/Query.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Why #
22

3-
I use DataTables in some projects and wrote SpringMVC server side for it. Later the frontend is rewritten and DataTables is no longer used. Now is the time to refine the protocol for general data-grid query.
3+
I use DataTables in some projects and wrote SpringMVC server side for it. Later the frontend is rewritten and DataTables is no longer used. Now is the time to refine the protocol for general data-grid query.
44

55
* You can not assign a range via `columns[i][search][value]`, as in SQL: `BETWEEN`.
66
* You can only do regular search OR regex search via `columns[i][search][regex]`, but not `=`, `LIKE`.
@@ -34,7 +34,8 @@ HTTP POST as `@RequestBody` is recommended:
3434
"_like": "",
3535
"_exists": true,
3636
"_isNull": true,
37-
"_isEmpty": true
37+
"_isEmpty": true,
38+
"_isvlid": true
3839
}
3940
}
4041
}
@@ -56,7 +57,7 @@ e.g. NO parameters are needed.
5657

5758
### Pagination ###
5859

59-
Paging is controlled by `offset` and `limit`, which keeps the same as `SKIP` and `LIMIT` in SQL.
60+
Paging is controlled by `offset` and `limit`, which keeps the same as `SKIP` and `LIMIT` in SQL.
6061

6162
```http
6263
POST /search
@@ -82,7 +83,7 @@ POST /search
8283
}
8384
```
8485

85-
Ordering by more columns:
86+
Ordering by more columns:
8687

8788
```http
8889
POST /search

doc/Query.zh-CN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"_like": "",
3535
"_exists": true,
3636
"_isNull": true,
37-
"_isEmpty": true
37+
"_isEmpty": true,
38+
"_isvoid": true
3839
}
3940
}
4041
}

eaphone-spring-data-query-samples/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ This is a simple Spring Boot project using [biggates/eaphone-spring-data-query](
44

55
The original sample project is [darrachequesne/spring-data-jpa-datatables-sample](https://github.com/darrachequesne/spring-data-jpa-datatables-sample).
66

7-
## How to run ##
7+
## How to run
88

99
(Not verified)
1010

11-
```
11+
```bash
1212
mvn spring-boot:run
1313
```
1414

1515
The project will start at `http://localhost:8080/`.
1616

17-
## What is this? ##
17+
## What is this?
1818

1919
This project shows how to use eaphone-spring-data-query in your project, and a very basic version of JavaScript grid.
2020

2121
The web page contains three parts: request (and examples), raw response and rendered grid.
2222

2323
![screen cast](../doc/quickview.gif)
2424

25-
## Features ##
25+
## Features
2626

2727
The page contains one data grid, with some pre-defined searching values.
2828

@@ -33,37 +33,37 @@ On the page you can try the following features:
3333
* Change order by any single column
3434
* Pagination
3535

36-
## Some details ##
36+
## Some details
3737

3838
* During the starting process, it inserts `200` completely random rows of `Order` item in `OrderRestController#insertSampleData()`, plus 2 specific `Order` item, in order to provide at least one search result in pre-defined queries.
39-
* The project serves a static web page, displaying a grid using DataTables. The detailed initialization script is in `/index.js`.
39+
* The project serves a static web page, displaying a grid using DataTables. The detailed initialization script is in `/index.js`.
4040

41-
### jpa ###
41+
### jpa
4242

4343
* An [H2](http://www.h2database.com/html/main.html) in-memory database is created.
4444

45-
### mongodb ###
45+
### mongodb
4646

4747
* This project uses [bwaldvogel/mongo-java-server](https://github.com/bwaldvogel/mongo-java-server) to create an in-memory MongoDB server named `test` (see `MongodbSampleApplication$Config`).
4848

49-
* The params `startDate` and `endDate` is used to restrict the range of a value. DataTables only handles "match" type of search, which is usually not enough. The criteria and `preFiltering` is used to further define a criteria.
49+
* The params `startDate` and `endDate` is used to restrict the range of a value. DataTables only handles "match" type of search, which is usually not enough. The criteria and `preFiltering` is used to further define a criteria.
5050

51-
## Usage in your project ##
51+
## Usage in your project
5252

5353
If you want to use `eaphone-spring-data-query` in your own project, these steps must be done:
5454

5555
1. Include the library in your project (it's not in any public Maven repository yet)
5656
2. Declare a spring-data repo, extending `JpaQueryRepository<EntityType, KeyType>` or `MongoDBQueryRepository<DocumentType, KeyType>`
57-
3. Create your controller, basically as:
57+
3. Create your controller, basically as:
5858

59-
```
60-
@Autowired
61-
private OrderRepo repo;
59+
```java
60+
@Autowired
61+
private OrderRepo repo;
6262

63-
@GetMapping()
64-
public QueryOutput<Order> getOrders(@Valid QueryInput input){
65-
return repo.findAll(input);
66-
}
67-
```
63+
@GetMapping()
64+
public QueryOutput<Order> getOrders(@Valid QueryInput input){
65+
return repo.findAll(input);
66+
}
67+
```
6868

6969
4. Write your JavaScript for the datagrid.

0 commit comments

Comments
 (0)