barcode read sample 추가

dev
Jonguk. Lim 6 months ago
parent f6cae2aa93
commit ea740def67

@ -111,4 +111,39 @@
</plugins> </plugins>
</build> </build>
<profiles>
<!-- default : local configuration -->
<profile>
<id>local</id>
<properties>
<env>local</env>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- dev configuration -->
<profile>
<id>dev</id>
<properties>
<env>dev</env>
</properties>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
</profile>
<!-- prod configuration -->
<profile>
<id>prod</id>
<properties>
<env>prod</env>
</properties>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
</profile>
</profiles>
</project> </project>

@ -1,5 +1,6 @@
package cokr.xit.adds.nims.web; package cokr.xit.adds.nims.web;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -13,6 +14,10 @@ import cokr.xit.foundation.web.AbstractController;
value = {"/adds/nims"} value = {"/adds/nims"}
) )
public class TestController extends AbstractController { public class TestController extends AbstractController {
// FIXME: property injection으로 변경??
@Value("${app.api.host:http://localhost:9076}")
private String apiHost;
@RequestMapping( @RequestMapping(
name = "Nims 메인", name = "Nims 메인",
value = {"/barcode/main.do"} value = {"/barcode/main.do"}
@ -20,6 +25,6 @@ public class TestController extends AbstractController {
public ModelAndView main() { public ModelAndView main() {
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/barcode-read"); mav.setViewName("adds/nims/barcode-read");
return mav;//.addObject("menus", this.toJson(mav.getModel().remove("menus"))); return mav.addObject("apiHost", apiHost);
} }
} }

@ -52,3 +52,23 @@ propertyService:
# filename: classpath*:properties/your-file-01.properties # filename: classpath*:properties/your-file-01.properties
# - encoding: UTF-8 # - encoding: UTF-8
# filename: classpath*:properties/your-file-02.properties # 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

@ -53,7 +53,7 @@
<label>Result:</label> <label>Result:</label>
<pre><code id="result"></code></pre> <pre><code id="result"></code></pre>
<textarea id="result2" style="width: 500px; height: 200px"></textarea> <textarea id="result2" style="width: 500px; height: 200px"></textarea>
<p><c:out value="${apiHost}"/></p>
</section> </section>
<footer class="footer"> <footer class="footer">
@ -176,7 +176,7 @@
document.getElementById('result2').value = '' document.getElementById('result2').value = ''
requestSubmit({ requestSubmit({
//url: '/api/biz/nims/v1/getProductInfoByQrcodeImg', //url: '/api/biz/nims/v1/getProductInfoByQrcodeImg',
url: 'http://localhost:9076/api/biz/nims/v1/getProductInfoByQrcodeImg', url: '<c:url value="${apiHost}/api/biz/nims/v1/getProductInfoByQrcodeImg" />',
method: 'POST', method: 'POST',
data: formData, data: formData,
progress: () => { progress: () => {

Loading…
Cancel
Save