Skip to content

Commit 7075c38

Browse files
authored
4th commit
改了目录,对第一、二部分做了精修。
1 parent b91a1a6 commit 7075c38

1 file changed

Lines changed: 48 additions & 35 deletions

File tree

Document-English.md

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
 <a href="https://github.com/TommyLemon/APIJSON/tree/master/APIJSON-JavaScript"><img src="https://img.shields.io/badge/JavaScript-ES6%2B-brightgreen.svg?style=flat"></a>
2626
</p>
2727
<p align="center" >
28-
<a href="https://github.com/TommyLemon/APIJSON">Chinese&nbsp; </a>
28+
<a href="http://apijson.org/">Chinese&nbsp; </a>
2929
<a href="http://i.youku.com/apijson">Video&nbsp; </a>
30-
<a href="http://apijson.org">Test</a>
30+
<a href="http://apijson.cn/">Test</a>
3131
</p>
3232

3333
<p align="center" >
@@ -38,22 +38,11 @@
3838
<br />
3939

4040
* ### [1.About](#1)
41-
* ### [2.Compare](#2)
42-
* [2.1 Process](#2.1)
43-
* [2.2 Client request](#2.2)
44-
* [2.3 Server operate](#2.3)
45-
* [2.4 Client resolve](#2.4)
46-
* [2.5 Requests](#2.5)
47-
* [2.6 Responses](#2.6)
48-
* ### [3.Overview](#3)
49-
* [3.1 Operation](#3.1)
50-
* [3.2 Function](#3.2)
51-
* ### [4.Usage](#4)
52-
* [4.1 Download and unzip](#4.1)
53-
* [4.2 Import tables](#4.2)
54-
* [4.3 Run server](#4.3)
55-
* [4.4 Run client](#4.4)
56-
* [4.4 Operate app](#4.5)
41+
* ### [2.Getting started](#2)
42+
* [2.1 Using Eclipse to make installation](#2.1)
43+
* [2.2 Import MySQL table files](#2.2)
44+
* [2.3 Using IntellIJ IDEA Ultimate to make the installation](#2.3)
45+
5746
* ### [5.Extra](#5)
5847
* [5.1 Recommend](#5.1)
5948
* [5.2 Author](#5.2)
@@ -170,55 +159,79 @@ Response:
170159
<br />
171160

172161

173-
## <h2 id="4">4.Getting started<h2/>
162+
## <h2 id="2">2.Getting started<h2/>
174163

175164
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.
176165

177-
### <h3 id="4.1">4.1 Using Eclipse to make installation<h3/>
166+
### <h3 id="2.1">2.1 Using Eclipse to make installation<h3/>
178167

179-
#### <h4 id="4.1.1">4.1.1 prerequisites<h4/>
168+
#### <h4 id="2.1.1">2.1.1 prerequisites<h4/>
180169

181170
Java Development Kit(JDK): 1.8 or above
182171
[MAVEN](https://maven.apache.org/download.cgi): 3.0 or above
183172
Mysql / Oracle
184173
[Eclipse Java EE IDE](https://www.eclipse.org/downloads/)for Web Developers.Version: Mars.1 Release (4.5.1)
185174

186-
#### <h4 id="4.1.2">4.1.2 Opening the project with Eclipse<h4/>
175+
#### <h4 id="2.1.2">2.1.2 Opening the project with Eclipse<h4/>
187176

188177
Open Eclipse> *File > Import > Maven > Existing Maven Projects > Next > Browse > Select the path of the project you saved / APIJSON-Java-Server / APIJSONBoot > check pom.xml...apijson-demo > Finish*
189178

190-
#### <h4 id="4.1.3">4.1.3 Preparing the library used in demo<h4/>
179+
#### <h4 id="2.1.3">2.1.3 Preparing the library used in demo<h4/>
191180

192181
In the menu at the right, click libs, right click apijson-orm.jar,click add as library. Apply the same to the rest *.jar* files in libs.
193182

194-
#### <h4 id="4.1.4">4.1.4 Configuration<h4/>
183+
#### <h4 id="2.1.4">2.1.4 Configuration<h4/>
195184

196-
Open the class named apijson.demo.server.DemoSQLConfig , then change return values of `getDBUri`,`getDBAccount`,`getDBPassword`,`getSchema` to your own database.
185+
Open apijson.demo.server.DemoSQLConfig. In line 40-61, change return values of `getDBUri`,`getDBAccount`,`getDBPassword`,`getSchema` to your own database.<br/>
186+
187+
<pre><code class="language-java">
188+
@Override
189+
public String getDBUri() {
190+
//TODO: Change the return value to your own
191+
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "jdbc:postgresql://localhost:5432/postgres" : "jdbc:mysql://192.168.71.146:3306/";
192+
}
193+
@Override
194+
public String getDBAccount() {
195+
//TODO: Change the return value to your own
196+
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? "postgres" : "root";
197+
}
198+
@Override
199+
public String getDBPassword() {
200+
//TODO: Change the return value to your own
201+
return DATABASE_POSTGRESQL.equalsIgnoreCase(getDatabase()) ? null : "root";
202+
}
203+
@Override
204+
public String getSchema() {
205+
String s = super.getSchema();
206+
return StringUtil.isEmpty(s, true) ? "thea" : s; //TODO: Change the return value to your own. For here,change "thea" to "your database's name"
207+
}
208+
</code></pre>
197209

198-
**Note**: Instead of this step, you can also [import your database](#4.2).
210+
**Note**: Instead of this step, you can also [import your database](#2.2).
199211

200-
#### <h4 id="4.1.5">4.1.5 Running the application<h4/>
212+
#### <h4 id="2.1.5">2.1.5 Running the application<h4/>
201213

202214
In Eclipse, in the menu on the top, click *Run>Run As>Java Application>choose APIJSONApplication>OK*
203215

204-
### <h3 id="4.2">4.2 Import MySQL table files<h3/>
216+
### <h3 id="2.2">2.2 Import MySQL table files<h3/>
217+
218+
This Server project needs [MySQL Server](https://dev.mysql.com/downloads/mysql/) and [MySQLWorkbench](https://www.mysql.com/products/workbench/). Please make sure that both of them are installed.<br />
205219

206-
This Server project needs MySQL Server and MySQLWorkbench. Please ensure that both of them are installed.<br />
207220
My config is Windows 7 + MySQL Community Server 5.7.16 + MySQLWorkbench 6.3.7 and OSX EI Capitan + MySQL Community Server 5.7.16 + MySQLWorkbench 6.3.8. Systems and softwares are all 64 bit.
208221

209-
Start *MySQLWorkbench > Enter a connection > Click Server menu > Data Import > Select the path of APIJSON-Master/table > Start Import > Refresh SCHEMAS*, and you'll see the tables were already added.
222+
Start *MySQLWorkbench > Enter a connection > Click Server menu > Data Import > Select the path of your .sql file > Start Import > Refresh SCHEMAS*. Now you should see tables are added successfully.
210223

211-
### <h3 id="4.3">4.3 Using IntellIJ IDEA Ultimate to make the installation<h3/>
224+
### <h3 id="2.3">2.3 Using IntellIJ IDEA Ultimate to make the installation<h3/>
212225

213-
#### <h4 id="4.3.1">4.3.1 Opening the project<h4/>
226+
#### <h4 id="2.3.1">2.3.1 Opening the project<h4/>
214227

215228
*Open > Select the path of the project/APIJSON-Java-Server/APIJSONBoot > OK*
216229

217-
#### <h4 id="4.3.2">4.3.2 Preparing the library used in demo<h4/>
230+
#### <h4 id="2.3.2">2.3.2 Preparing the library used in demo<h4/>
218231

219232
In libs, right-click *apijson-orm.jar >Add as Library>OK*. Apply this to all *.jar* files in libs.
220233

221-
#### <h4 id="4.3.3">4.3.3 Running the application<h4/>
234+
#### <h4 id="2.3.3">2.3.3 Running the application<h4/>
222235

223236
In the menu on the top: *Run > Run > Edit Configurations > + > Application > Configuration*<br />
224237
In *Main class* , choose *APIJSONApplication*;<br />
@@ -228,7 +241,7 @@ Click *Run* in the bottom.
228241
**Note**: After running, you should see APIJSON test logs and in the last, it would show ‘APIJSON已启动’. If it shows ‘address already in use’, that means port 8080 has been used . You need tochange the port. See [how to change ports for a Spring Boot Application.](https://stackoverflow.com/questions/21083170/how-to-configure-port-for-a-spring-boot-application)
229242

230243

231-
### <h3 id="4.4">4.4 Run Client project with ADT Bundle or Android Studio<h3/>
244+
### <h3 id="3">4.4 Run Client project with ADT Bundle or Android Studio<h3/>
232245

233246
You can skip this step and download the Client App below.
234247

0 commit comments

Comments
 (0)