Skip to content
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

Update README-English.md #235

Merged
merged 1 commit into from
May 14, 2021
Merged
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
63 changes: 34 additions & 29 deletions README-English.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,22 @@ With APIJSON, client developers will no longer be suffered from possible errors
Server developers no longer need to worry about compatibility of APIs and documents with legacy apps.

### Examples:

#### Get a User
Request:
<pre><code class="language-json">

```json
{
"User":{
 }
}
</code></pre>
```

[Click here to test](http://apijson.cn:8080/get/{"User":{}})

Response:
<pre><code class="language-json">

```json
{
"User":{
"id":38710,
Expand All @@ -106,13 +109,14 @@ Response:
"code":200,
"msg":"success"
}
</code></pre>

```
<br />

#### Get an Array of Users

Request:
<pre><code class="language-json">

```json
{
"[]":{
  "count":3,             //just get 3 results
Expand All @@ -121,12 +125,13 @@ Request:
  }
}
}
</code></pre>
```

[Click here to test](http://apijson.cn:8080/get/{"[]":{"count":3,"User":{"@column":"id,name"}}})

Response:
<pre><code class="language-json">

```json
{
"[]":[
{
Expand All @@ -151,7 +156,7 @@ Response:
"code":200,
"msg":"success"
}
</code></pre>
```

<br />

Expand Down Expand Up @@ -188,28 +193,28 @@ In the menu at the right, click libs, right click apijson-orm.jar,click add as l

Open apijson.demo.server.DemoSQLConfig. In line 40-61, change return values of `getDBUri`,`getDBAccount`,`getDBPassword`,`getSchema` to your own database.<br/>

<pre><code class="language-java">
```java
@Override
public String getDBUri() {
//TODO: Change the return value to your own
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "jdbc:postgresql://localhost:5432/postgres" : "jdbc:mysql://192.168.71.146:3306/";
}
@Override
public String getDBAccount() {
//TODO: Change the return value to your own
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "postgres" : "root";
}
@Override
public String getDBUri() {
//TODO: Change the return value to your own
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "jdbc:postgresql://localhost:5432/postgres" : "jdbc:mysql://192.168.71.146:3306/";
}
@Override
public String getDBAccount() {
public String getDBPassword() {
//TODO: Change the return value to your own
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "postgres" : "root";
}
@Override
public String getDBPassword() {
//TODO: Change the return value to your own
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? null : "root";
}
@Override
public String getSchema() {
String s = super.getSchema();
return StringUtil.isEmpty(s, true) ? "thea" : s; //TODO: Change the return value to your own. For here,change "thea" to "your database's name"
}
</code></pre>
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? null : "root";
}
@Override
public String getSchema() {
String s = super.getSchema();
return StringUtil.isEmpty(s, true) ? "thea" : s; //TODO: Change the return value to your own. For here,change "thea" to "your database's name"
}
```

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

Expand Down