Skip to content

Commit 2320fff

Browse files
authored
Update README-English.md
1 parent fb4e931 commit 2320fff

File tree

1 file changed

+31
-116
lines changed

1 file changed

+31
-116
lines changed

README-English.md

Lines changed: 31 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -147,114 +147,20 @@ Note: The UI is APIAuto, the URL+JSON is APIJSON<br/>
147147

148148
<br />
149149
<p align="center" >
150-
<a >APIAuto: auto regression test without coding(annotations, comments, etc.)</a>
150+
<a >APIAuto: auto regression test without code, annotation, comment, etc.)</a>
151151
</p>
152152

153153
![](https://oscimg.oschina.net/oscnet/up-c1ba774f8e7fcc5adcdb05cad5bd414d766.JPEG)
154154

155155
<br />
156156
<p align="center" >
157-
<a >A picture is worth a thousand words - some base functions show for APIJSON</a>
157+
<a >A picture is worth a thousand words - some base features show for APIJSON</a>
158158
</p>
159159

160160
![](https://oscimg.oschina.net/oscnet/up-e21240ef3770326ee6015e052226d0da184.JPEG)
161161
![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/APIJSON/APIJSON_query_summary.gif)
162162

163163

164-
### Examples:
165-
166-
#### Get a User
167-
Request:
168-
169-
```js
170-
{
171-
"User":{
172-
 }
173-
}
174-
```
175-
176-
[Click here to test](http://apijson.cn:8080/get/{"User":{}})
177-
178-
Response:
179-
180-
```js
181-
{
182-
"User":{
183-
"id":38710,
184-
"sex":0,
185-
"name":"TommyLemon",
186-
"certified":true,
187-
"tag":"Android&Java",
188-
"phone":13000038710,
189-
"head":"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
190-
"date":1485948110000,
191-
"pictureList":[
192-
"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
193-
"http://common.cnblogs.com/images/icon_weibo_24.png"
194-
]
195-
},
196-
"code":200,
197-
"msg":"success"
198-
}
199-
```
200-
<br />
201-
202-
#### Get an Array of Users
203-
204-
Request:
205-
206-
```js
207-
{
208-
"[]":{
209-
  "count":3,             //just get 3 results
210-
  "User":{
211-
    "@column":"id,name" //just get ids and names
212-
  }
213-
}
214-
}
215-
```
216-
217-
[Click here to test](http://apijson.cn:8080/get/{"[]":{"count":3,"User":{"@column":"id,name"}}})
218-
219-
Response:
220-
221-
```js
222-
{
223-
"[]":[
224-
{
225-
"User":{
226-
"id":38710,
227-
"name":"TommyLemon"
228-
}
229-
},
230-
{
231-
"User":{
232-
"id":70793,
233-
"name":"Strong"
234-
}
235-
},
236-
{
237-
"User":{
238-
"id":82001,
239-
"name":"Android"
240-
}
241-
}
242-
],
243-
"code":200,
244-
"msg":"success"
245-
}
246-
```
247-
248-
<br />
249-
250-
[Test it online](http://apijson.cn/api)<br />
251-
252-
![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/APIJSON_Auto_get.jpg)
253-
254-
![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/APIJSON_Auto_code.jpg)
255-
<p align="center" >
256-
257-
258164
## <h2 id="2">2.Server-side deployment<h2/>
259165
260166
You can use either Eclipse for JavaEE or IntelllJ IDEA Ultimate to make installation. For both, first download the project and save it to a path.
@@ -281,26 +187,35 @@ In the menu at the right, click libs, right click apijson-orm.jar,click add as l
281187
Open apijson.demo.server.DemoSQLConfig. In line 40-61, change return values of `getDBUri`,`getDBAccount`,`getDBPassword`,`getSchema` to your own database.<br/>
282188

283189
```java
284-
@Override
285-
public String getDBUri() {
286-
//TODO: Change the return value to your own
287-
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "jdbc:postgresql://localhost:5432/postgres" : "jdbc:mysql://192.168.71.146:3306/";
288-
}
289-
@Override
290-
public String getDBAccount() {
291-
//TODO: Change the return value to your own
292-
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "postgres" : "root";
293-
}
294-
@Override
295-
public String getDBPassword() {
296-
//TODO: Change the return value to your own
297-
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? null : "root";
298-
}
299-
@Override
300-
public String getSchema() {
301-
String s = super.getSchema();
302-
return StringUtil.isEmpty(s, true) ? "thea" : s; //TODO: Change the return value to your own. For here,change "thea" to "your database's name"
303-
}
190+
static {
191+
DEFAULT_DATABASE = DATABASE_MYSQL; // TODO
192+
DEFAULT_SCHEMA = "sys"; // TODO defaults: MySQL: sys, PostgreSQL: public, SQL Server: dbo, Oracle:
193+
}
194+
195+
@Override
196+
public String getDBVersion() {
197+
return "5.7.22"; // "8.0.11"; // TODO
198+
}
199+
200+
@JSONField(serialize = false)
201+
@Override
202+
public String getDBUri() {
203+
// add userSSL=false for MySQL 8.0+ return "jdbc:mysql://localhost:3306?userSSL=false&serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8";
204+
// for MySQL not greater than 5.7
205+
return "jdbc:mysql://localhost:3306?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8"; // TODO TiDB can be used as MySQL, its defaut port is 4000
206+
}
207+
208+
@JSONField(serialize = false)
209+
@Override
210+
public String getDBAccount() {
211+
return "root"; // TODO
212+
}
213+
214+
@JSONField(serialize = false)
215+
@Override
216+
public String getDBPassword() {
217+
return "apijson"; // TODO TiDB can be used as MySQL, its defaut password is an empty string ""
218+
}
304219
```
305220

306221
**Note**: Instead of this step, you can also [import your database](#2.2).

0 commit comments

Comments
 (0)