Commit bed43f3806bbdde5a3af16372c8996c10517cd92

Authored by 潘钊
1 parent 770ac5ae

init3...

src/main/java/com/bsth/util/ConfigUtil.java
... ... @@ -6,6 +6,8 @@ public class ConfigUtil {
6 6  
7 7 static{
8 8 tools = new Tools("application.properties");
  9 + String active = tools.getValue("spring.profiles.active");
  10 + tools = new Tools("application-"+active+".properties");
9 11 }
10 12  
11 13 public static String get(String key){
... ...
src/main/resources/application-dev.properties 0 → 100644
  1 +server.port=12580
  2 +management.port= 12500
  3 +management.address= 127.0.0.1
  4 +
  5 +
  6 +#
  7 +### gps client
  8 +gps.server.pd=114.80.178.12
  9 +gps.port.pd=8899
  10 +gps.server.pf=180.166.5.82
  11 +gps.port.pf=9030
  12 +forward.device.name=client92
0 13 \ No newline at end of file
... ...
src/main/resources/application-prod.properties 0 → 100644
  1 +server.port=12580
  2 +management.port= 12500
  3 +management.address= 127.0.0.1
  4 +
  5 +
  6 +#
  7 +### gps client
  8 +gps.server.pd=10.10.150.21
  9 +gps.port.pd=8899
  10 +gps.server.pf=180.166.5.82
  11 +gps.port.pf=9030
  12 +forward.device.name=client99
0 13 \ No newline at end of file
... ...
src/main/resources/application.properties
1   -server.port=12580
2   -management.port= 9001
3   -management.address= 127.0.0.1
  1 +spring.profiles: dev,prod
  2 +spring.profiles.active: dev
4 3 \ No newline at end of file
... ...