diff --git a/server/ORACLECREATETABLE.sql b/server/ORACLECREATETABLE.sql new file mode 100644 index 0000000000000000000000000000000000000000..70c6d2a08a28efd4ab2c2215a2b91f00c5d8f586 --- /dev/null +++ b/server/ORACLECREATETABLE.sql @@ -0,0 +1,56 @@ +CREATE TABLE users +( +id NUMBER(11) NOT NULL, +username VARCHAR(45) NOT NULL, +password VARCHAR(100) NOT NULL, +image VARCHAR(200) DEFAULT'', +enabled VARCHAR(45) DEFAULT '1' +); + +--为用户表添加约束-- +ALTER TABLE users +ADD CONSTRAINT PK_ID PRIMARY KEY(id) +ADD CONSTRAINT UNI_NAME UNIQUE(username); + +--为用户表id字段创建序递增序列-- +CREATE SEQUENCE userid_seq START WITH 12 INCREMENT BY 1; + +--为用户表添加触发器实现id字段自增-- +CREATE TRIGGER userid_trigger +BEFORE INSERT ON users +FOR EACH ROW +BEGIN +SELECT userid_seq.nextval into :new.id FROM dual; +END; + +--创建管理员表-- +CREATE TABLE authorities +( + id NUMBER(11) NOT NULL, + username VARCHAR(45) NOT NULL, + authority VARCHAR(45) NOT NULL +); + +--为管理员表添加约束-- +ALTER TABLE authorities ADD CONSTRAINT PK_AUID PRIMARY KEY(id); + +--为管理员表id字段创建递增序列-- +CREATE SEQUENCE authorityid_seq START WITH 14 INCREMENT BY 1; + +--为管理员表设置触发器-- +CREATE TRIGGER authorityid_trigger +BEFORE INSERT ON authorities +FOR EACH ROW +BEGIN +SELECT authorityid_seq.nextval into :new.id FROM dual; +END; + +--创建news表-- +CREATE TABLE news +( + id NUMBER(11) NOT NULL PRIMARY KEY, + title VARCHAR(45) NOT NULL, + img VARCHAR(45) NOT NULL, + content VARCHAR(200), + datetime DATE +); \ No newline at end of file diff --git a/server/README.md b/server/README.md index 4e6c88ca46689dd332d324500b8fb6361530d7e9..04e300c055b1252d1b75ee9de5dccf890a5c8f3d 100644 --- a/server/README.md +++ b/server/README.md @@ -1,70 +1,75 @@ - -** 绉诲姩鏄 鈥斺 璁╃Щ鍔ㄥ簲鐢ㄥ紑鍙戞洿瀹规槗锛** - -[MENU] - -## 绠鍗曟杩 - -鏈」鐩负绉诲姩鏄撳悗鍙版湇鍔$锛屾彁渚涗簡涓涓熀纭鐨凙PP鍚庡彴妗嗘灦銆 - -## 鏂囨。鍙傝 - - - 椤圭洰缃戠珯锛 - - https://www.mobileeasy.cc - - - 浠g爜鎵樼锛 - - 寮婧愪腑鍥(涓荤珯鐐)锛 https://git.oschina.net/sectong/yidongyi - - GitHub锛堝浠界珯鐐癸級锛 https://github.com/sectong/yidongyi - - - 鎶鏈崥瀹細 - - https://blog.sectong.com - - - 鍏徃缃戠珯锛 - - https://sectong.com - -## 鍚姩搴旂敤姝ラ锛 - - - git clone https://git.oschina.net/sectong/yidongyi.git (涓荤珯鐐) or git clone https://github.com/sectong/yidongyi 锛堝浠界珯鐐癸級 - - import to Eclipse锛 - - run - -``` - - cd yidongyi/server - mvn spring-boot:run - ... - ... - log鍑虹幇锛歴tarted on port(s): 8080 (http)锛岃瘉鏄庡惎鍔ㄦ垚鍔 - -``` - -![杈撳叆鍥剧墖璇存槑](http://git.oschina.net/uploads/images/2016/1012/004616_ba7a1304_1034557.png "鍦ㄨ繖閲岃緭鍏ュ浘鐗囨爣棰") - -## 绠$悊绯荤粺 - -http://localhost:8080 - -user: admin , pass: admin - -![杈撳叆鍥剧墖璇存槑](http://git.oschina.net/uploads/images/2016/1012/013225_724e6a89_1034557.png "鍦ㄨ繖閲岃緭鍏ュ浘鐗囨爣棰") - -## API璋冭瘯 - -http://localhost:8080/swagger-ui.html - -![杈撳叆鍥剧墖璇存槑](http://git.oschina.net/uploads/images/2016/1012/012622_a276da1d_1034557.png "鍦ㄨ繖閲岃緭鍏ュ浘鐗囨爣棰") - -## 瀹屾暣鏂囨。鍙傝 - -璇峰弬闃呮湰椤圭洰 Wiki 椤点 - -## 璇峰姞鍏ヤ紒楣呰璁虹兢锛103880410锛岃娉ㄦ槑鏉ヨ嚜[璧涘厠閫氬崥瀹(https://blog.sectong.com)銆乕寮婧愪腑鍥絔(https://git.oschina.net/sectong)鎴朳GitHub](https://github.com/sectong)銆 - -## 鑵捐璇惧爞鍏紑璇 - + +** 绉诲姩鏄 鈥斺 璁╃Щ鍔ㄥ簲鐢ㄥ紑鍙戞洿瀹规槗锛** + +[MENU] + +## 绠鍗曟杩 + +鏈」鐩负绉诲姩鏄撳悗鍙版湇鍔$锛屾彁渚涗簡涓涓熀纭鐨凙PP鍚庡彴妗嗘灦銆 + +## 鏂囨。鍙傝 + + - 椤圭洰缃戠珯锛 + + https://www.mobileeasy.cc + + - 浠g爜鎵樼锛 + + 寮婧愪腑鍥(涓荤珯鐐)锛 https://git.oschina.net/sectong/yidongyi + + GitHub锛堝浠界珯鐐癸級锛 https://github.com/sectong/yidongyi + + - 鎶鏈崥瀹細 + + https://blog.sectong.com + + - 鍏徃缃戠珯锛 + + https://sectong.com + +## 鍚姩搴旂敤姝ラ锛 + + - git clone https://git.oschina.net/sectong/yidongyi.git (涓荤珯鐐) or git clone https://github.com/sectong/yidongyi 锛堝浠界珯鐐癸級 + - import to Eclipse锛 + - 鍒囨崲鍒嗘敮 + ``` + git checkout oracle-connector + ``` + - 杩愯SQL鑴氭湰(鍦∣racle鏁版嵁搴撲腑杩愯) + - run + +``` + + cd yidongyi/server + mvn spring-boot:run + ... + ... + log鍑虹幇锛歴tarted on port(s): 8080 (http)锛岃瘉鏄庡惎鍔ㄦ垚鍔 + +``` + +![杈撳叆鍥剧墖璇存槑](http://git.oschina.net/uploads/images/2016/1012/004616_ba7a1304_1034557.png "鍦ㄨ繖閲岃緭鍏ュ浘鐗囨爣棰") + +## 绠$悊绯荤粺 + +http://localhost:8080 + +user: admin , pass: admin + +![杈撳叆鍥剧墖璇存槑](http://git.oschina.net/uploads/images/2016/1012/013225_724e6a89_1034557.png "鍦ㄨ繖閲岃緭鍏ュ浘鐗囨爣棰") + +## API璋冭瘯 + +http://localhost:8080/swagger-ui.html + +![杈撳叆鍥剧墖璇存槑](http://git.oschina.net/uploads/images/2016/1012/012622_a276da1d_1034557.png "鍦ㄨ繖閲岃緭鍏ュ浘鐗囨爣棰") + +## 瀹屾暣鏂囨。鍙傝 + +璇峰弬闃呮湰椤圭洰 Wiki 椤点 + +## 璇峰姞鍏ヤ紒楣呰璁虹兢锛103880410锛岃娉ㄦ槑鏉ヨ嚜[璧涘厠閫氬崥瀹(https://blog.sectong.com)銆乕寮婧愪腑鍥絔(https://git.oschina.net/sectong)鎴朳GitHub](https://github.com/sectong)銆 + +## 鑵捐璇惧爞鍏紑璇 + 姣忓懆鍦ㄨ吘璁鍫傝棰戠洿鎾紝璁茶堪妗嗘灦鍩虹銆佸師鐞嗐佹紨绀篋EMO锛屽湪绾跨瓟鐤戙 [璧涘厠閫氳吘璁鍫俔(http://sectong.ke.qq.com) \ No newline at end of file diff --git a/server/pom.xml b/server/pom.xml index f28c4c5556031a9aaed62d17e3ece22d6ef54fdf..3762ad7341457f08cfb24d86adc4881b32b222ab 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -49,10 +49,6 @@ org.springframework spring-jdbc - - - com.h2database - h2 io.springfox @@ -69,11 +65,13 @@ org.springframework.boot spring-boot-starter-undertow + + + com.oracle + ojdbc14 + 10.2.0.3 + - - - diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties index 4071d28208641b06df8e6a6de6f44993ffdab138..7898e1d792fb34ddbd423bb8f808ac172be0acf1 100644 --- a/server/src/main/resources/application.properties +++ b/server/src/main/resources/application.properties @@ -10,4 +10,11 @@ image.file.upload.dir=static/upload/ # 寮鍙戠幆澧冿紝鍏抽棴缂撳瓨 spring.thymeleaf.cache=false -spring.template.cache=false \ No newline at end of file +spring.template.cache=false + +# oracle鏁版嵁搴撻厤缃俊鎭 +#spring.datasource.url=jdbc:mysql://localhost/yidongyi?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true +spring.datasource.url = jdbc:oracle:thin:@localhost:1521:ORCL +spring.datasource.username=system +spring.datasource.password=oracle + diff --git a/server/src/main/resources/message.properties b/server/src/main/resources/message.properties index 4de5a6f8b69e02128d62128ebfe75ed033fe6bc2..af2e5c31b05d8670908b6dc308e5d5b934660b3e 100644 --- a/server/src/main/resources/message.properties +++ b/server/src/main/resources/message.properties @@ -1,10 +1,9 @@ - -# 鐢ㄦ埛绫讳俊鎭 -100=鐢ㄦ埛娉ㄥ唽鎴愬姛 -101=鐢ㄦ埛宸叉敞鍐 -102=鐢ㄦ埛鍚嶅凡瀛樺湪 -103=鐢ㄦ埛娉ㄥ唽澶辫触 -104=鐢ㄦ埛鐧婚檰鎴愬姛 -105=鐢ㄦ埛鐧婚檰澶辫触 -106=鐢ㄦ埛涓嶅瓨鍦 - +# 鐢ㄦ埛绫讳俊鎭 +100=鐢ㄦ埛娉ㄥ唽鎴愬姛 +101=鐢ㄦ埛宸叉敞鍐 +102=鐢ㄦ埛鍚嶅凡瀛樺湪 +103=鐢ㄦ埛娉ㄥ唽澶辫触 +104=鐢ㄦ埛鐧婚檰鎴愬姛 +105=鐢ㄦ埛鐧婚檰澶辫触 +106=鐢ㄦ埛涓嶅瓨鍦 +