From ea740def67f4347e020e52182966cdbb08f67e41 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Tue, 21 May 2024 19:51:00 +0900 Subject: [PATCH] =?UTF-8?q?barcode=20read=20sample=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 37 ++++++++++++++++++- .../xit/adds/nims/web/TestController.java | 7 +++- src/main/resources/application.yml | 24 +++++++++++- .../WEB-INF/jsp/adds/nims/barcode-read.jsp | 4 +- 4 files changed, 66 insertions(+), 6 deletions(-) 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 @@
- +