diff --git a/pom.xml b/pom.xml
index 359d56a..87dac35 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,4 +111,39 @@
-
\ No newline at end of file
+
+
+
+ local
+
+ local
+
+
+ true
+
+
+
+
+
+ dev
+
+ dev
+
+
+ false
+
+
+
+
+
+ prod
+
+ prod
+
+
+ false
+
+
+
+
+
diff --git a/src/main/java/cokr/xit/adds/nims/web/TestController.java b/src/main/java/cokr/xit/adds/nims/web/TestController.java
index 3474399..44e3ece 100644
--- a/src/main/java/cokr/xit/adds/nims/web/TestController.java
+++ b/src/main/java/cokr/xit/adds/nims/web/TestController.java
@@ -1,5 +1,6 @@
package cokr.xit.adds.nims.web;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@@ -13,6 +14,10 @@ import cokr.xit.foundation.web.AbstractController;
value = {"/adds/nims"}
)
public class TestController extends AbstractController {
+ // FIXME: property injection으로 변경??
+ @Value("${app.api.host:http://localhost:9076}")
+ private String apiHost;
+
@RequestMapping(
name = "Nims 메인",
value = {"/barcode/main.do"}
@@ -20,6 +25,6 @@ public class TestController extends AbstractController {
public ModelAndView main() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/barcode-read");
- return mav;//.addObject("menus", this.toJson(mav.getModel().remove("menus")));
+ return mav.addObject("apiHost", apiHost);
}
}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 203851d..6c7aef6 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -25,7 +25,7 @@ spring:
hikari:
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbc-url: jdbc:log4jdbc:mariadb://211.119.124.9:4407/adds?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Seoul&useSSL=false
- username: addsweb
+ username: addsweb
password: addsweb1234
auto-commit: false
@@ -34,7 +34,7 @@ spring:
web:
resources:
static-locations: /resources/,file:files/
-
+
messageSource:
basenames:
- classpath:message/message-common
@@ -52,3 +52,23 @@ propertyService:
# filename: classpath*:properties/your-file-01.properties
# - encoding: UTF-8
# filename: classpath*:properties/your-file-02.properties
+
+---
+spring:
+ config:
+ activate:
+ on-profile: local
+
+app:
+ api:
+ host: http://localhost:9076
+
+---
+spring:
+ config:
+ activate:
+ on-profile: prod
+
+app:
+ api:
+ host: http://localhost:9076
diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/barcode-read.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/barcode-read.jsp
index aef245f..64fda85 100644
--- a/src/main/webapp/WEB-INF/jsp/adds/nims/barcode-read.jsp
+++ b/src/main/webapp/WEB-INF/jsp/adds/nims/barcode-read.jsp
@@ -53,7 +53,7 @@
-
+