From f3af06ddd490f23e7b41cf6379f7c7ba77240c52 Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Fri, 16 Oct 2015 15:22:34 +0900 Subject: [PATCH 1/8] sprint2 project Start! --- .../main/java/com/ruby/codej/sprint2/Sprint2CodeTest.java | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/Sprint2CodeTest.java diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/Sprint2CodeTest.java b/MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/Sprint2CodeTest.java new file mode 100644 index 0000000..880fff7 --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/Sprint2CodeTest.java @@ -0,0 +1,6 @@ +package com.ruby.codej.sprint2; + +public class Sprint2CodeTest { + public Sprint2CodeTest() { + } +} From 5f08b22ba1f3321b052a068650e3f1577da6d4db Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Fri, 16 Oct 2015 15:32:54 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=EC=8A=A4=ED=94=84=EB=A6=B0=ED=8A=B8=20API?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruby/codej/sprint2/SprintCodeAPI.java | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/SprintCodeAPI.java diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/SprintCodeAPI.java b/MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/SprintCodeAPI.java new file mode 100644 index 0000000..9380618 --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/sprint2/SprintCodeAPI.java @@ -0,0 +1,7 @@ +package com.ruby.codej.sprint2; + +public class SprintCodeAPI { + public SprintCodeAPI() { + // TODO Auto-generated constructor stub + } +} From 061e52ac32a3af7ca5ee292cf16d225e9b70cdab Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Mon, 19 Oct 2015 11:22:06 +0900 Subject: [PATCH 3/8] =?UTF-8?q?jdk=201.8=20=EC=82=AC=EC=9A=A9=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95=20=EB=9E=8C=EB=8B=A4=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=8B=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruby/codej/AjaxCallController.java | 37 +++++++++++++++++++ .../main/java/com/ruby/codej/RamdaTest.java | 5 +++ .../java/com/ruby/codej/TestRamdaCode.java | 32 ++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/RamdaTest.java create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/TestRamdaCode.java diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java b/MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java new file mode 100644 index 0000000..a153a2c --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java @@ -0,0 +1,37 @@ +package com.ruby.codej; + +import java.text.DateFormat; +import java.util.Date; +import java.util.Locale; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * @author woohyunjo + */ +@Controller +@RequestMapping("/ajax") +public class AjaxCallController { + private static final Logger LOGGER = LoggerFactory.getLogger(HomeController.class); + + @RequestMapping(value = "/list", method = RequestMethod.GET) + public String home(Locale locale, Model model) { + LOGGER.info("Welcome home! The client locale is {}.", locale); + + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); + + String formattedDate = dateFormat.format(date); + + model.addAttribute("serverTime", formattedDate); + + LOGGER.info("ajax list call"); + + return "home"; + } +} diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/RamdaTest.java b/MyGitSpringProject/src/main/java/com/ruby/codej/RamdaTest.java new file mode 100644 index 0000000..ac8200e --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/RamdaTest.java @@ -0,0 +1,5 @@ +package com.ruby.codej; + +public interface RamdaTest { + public int test(int x, int y); +} diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/TestRamdaCode.java b/MyGitSpringProject/src/main/java/com/ruby/codej/TestRamdaCode.java new file mode 100644 index 0000000..13e65db --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/TestRamdaCode.java @@ -0,0 +1,32 @@ +package com.ruby.codej; + +public class TestRamdaCode { + public static void main(String[] args) { + + System.out.println(useRamdaExcutor()); + + System.out.println(useBaseExcutor()); + } + + + public static int useRamdaExcutor(){ + RamdaTest rTest2 = (x,y)-> {return x + y;}; + + return rTest2.test(3, 54); + } + + public static int useBaseExcutor(){ + + //전통적인 익명 클래스 인스턴스화 + RamdaTest rTest = new RamdaTest() { + + @Override + public int test(int x, int y) { + return x+y; + } + }; + + return rTest.test(3, 54); + + } +} From 1370fc349f2f589c3c9bcdc4136798108e69c717 Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Mon, 19 Oct 2015 17:20:35 +0900 Subject: [PATCH 4/8] =?UTF-8?q?ajax=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=EB=A5=BC=20=EC=9C=84=ED=95=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EC=BD=94=EB=93=9C=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruby/codej/AjaxCallController.java | 1 + .../src/main/java/com/ruby/codej/TestCodeClass.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java b/MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java index a153a2c..a4648d9 100644 --- a/MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/AjaxCallController.java @@ -1,6 +1,7 @@ package com.ruby.codej; import java.text.DateFormat; +import java.time.DayOfWeek; import java.util.Date; import java.util.Locale; diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/TestCodeClass.java b/MyGitSpringProject/src/main/java/com/ruby/codej/TestCodeClass.java index 111a044..296ab38 100644 --- a/MyGitSpringProject/src/main/java/com/ruby/codej/TestCodeClass.java +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/TestCodeClass.java @@ -1,8 +1,14 @@ package com.ruby.codej; +import java.time.DayOfWeek; + public class TestCodeClass { public TestCodeClass() { System.out.println("테스트 코드 추가2"); } + + public static void main(String[] args) { + System.out.println(DayOfWeek.FRIDAY); + } } From 601f829dfea1a05e8273f261642438933eae6b11 Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Mon, 19 Oct 2015 18:51:34 +0900 Subject: [PATCH 5/8] =?UTF-8?q?RestTemplate=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyGitSpringProject/pom.xml | 121 +++++++++++------- .../java/com/ruby/codej/RestTemplateTest.java | 25 ++++ .../webapp/WEB-INF/spring/root-context.xml | 8 ++ 3 files changed, 109 insertions(+), 45 deletions(-) create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/RestTemplateTest.java diff --git a/MyGitSpringProject/pom.xml b/MyGitSpringProject/pom.xml index 94b5123..90e2554 100644 --- a/MyGitSpringProject/pom.xml +++ b/MyGitSpringProject/pom.xml @@ -24,7 +24,7 @@ commons-logging commons-logging - + @@ -32,14 +32,14 @@ spring-webmvc ${org.springframework-version} - + org.aspectj aspectjrt ${org.aspectj-version} - - + + org.slf4j @@ -89,7 +89,7 @@ javax.inject 1 - + javax.servlet @@ -108,51 +108,82 @@ jstl 1.2 - + junit junit 4.7 test - + + + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.9 + + + + - - - - maven-eclipse-plugin - 2.9 - - - org.springframework.ide.eclipse.core.springnature - - - org.springframework.ide.eclipse.core.springbuilder - - true - true - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.6 - 1.6 - -Xlint:all - true - true - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - org.test.int1.Main - - - - + + + + maven-eclipse-plugin + 2.9 + + + org.springframework.ide.eclipse.core.springnature + + + org.springframework.ide.eclipse.core.springbuilder + + true + true + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + + 1.6 + 1.6 + -Xlint:all + true + true + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + org.test.int1.Main + + + + diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/RestTemplateTest.java b/MyGitSpringProject/src/main/java/com/ruby/codej/RestTemplateTest.java new file mode 100644 index 0000000..54cd52c --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/RestTemplateTest.java @@ -0,0 +1,25 @@ +package com.ruby.codej; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter; +import org.springframework.web.client.RestTemplate; + +public class RestTemplateTest { + public static void main(String[] args) { + RestTemplate restTemplate = new RestTemplate(); + + String url = "http://searchapi.qa.tmon.co.kr/api/search/ac/tmxkzm"; + + List> messageConverters = new ArrayList>(); + MappingJacksonHttpMessageConverter map = new MappingJacksonHttpMessageConverter(); + messageConverters.add(map); + restTemplate.setMessageConverters(messageConverters); + + Object bean = restTemplate.getForObject(url, Object.class); + System.out.println("The object received from REST call : " + bean); + + } +} diff --git a/MyGitSpringProject/src/main/webapp/WEB-INF/spring/root-context.xml b/MyGitSpringProject/src/main/webapp/WEB-INF/spring/root-context.xml index f7a30f0..dde9eac 100644 --- a/MyGitSpringProject/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/MyGitSpringProject/src/main/webapp/WEB-INF/spring/root-context.xml @@ -5,4 +5,12 @@ + + + + + + + + From 1f0522235c4a9198eb082a5b1a2ea3cbe198fd81 Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Mon, 19 Oct 2015 18:54:19 +0900 Subject: [PATCH 6/8] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=EB=9F=AC=EB=A6=AC=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyGitSpringProject/pom.xml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/MyGitSpringProject/pom.xml b/MyGitSpringProject/pom.xml index 90e2554..3fb0cab 100644 --- a/MyGitSpringProject/pom.xml +++ b/MyGitSpringProject/pom.xml @@ -122,31 +122,7 @@ org.codehaus.jackson jackson-mapper-asl 1.9.9 - - - - + From e860fc47413d432a22c59ccd300c26cc132f0abc Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Tue, 20 Oct 2015 12:06:45 +0900 Subject: [PATCH 7/8] =?UTF-8?q?Ramda=20Test=20Class=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=201.=EB=9E=8C=EB=8B=A4=EC=8B=9D=202.Stream=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruby/codej/AutoCompleteWord.java | 108 ++++++++++++++++++ .../ruby/codej/ramda/module/RamdaApiTest.java | 55 +++++++++ 2 files changed, 163 insertions(+) create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java b/MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java new file mode 100644 index 0000000..2e852f6 --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java @@ -0,0 +1,108 @@ +package com.ruby.codej; + + +/** + * Created by jekalmin on 2015-10-14. + */ +public class AutoCompleteWord { + + String type; + String word; + String html; + String count; + String initMatch; + String parentCatSrl; + String parentCatName; + String gnbCatSrl; + String gnbCatName; + String viewGnbCat; + String isMartCat; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getWord() { + return word; + } + + public void setWord(String word) { + this.word = word; + } + + public String getHtml() { + return html; + } + + public void setHtml(String html) { + this.html = html; + } + + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } + + public String getInitMatch() { + return initMatch; + } + + public void setInitMatch(String initMatch) { + this.initMatch = initMatch; + } + + public String getParentCatSrl() { + return parentCatSrl; + } + + public void setParentCatSrl(String parentCatSrl) { + this.parentCatSrl = parentCatSrl; + } + + public String getParentCatName() { + return parentCatName; + } + + public void setParentCatName(String parentCatName) { + this.parentCatName = parentCatName; + } + + public String getGnbCatSrl() { + return gnbCatSrl; + } + + public void setGnbCatSrl(String gnbCatSrl) { + this.gnbCatSrl = gnbCatSrl; + } + + public String getGnbCatName() { + return gnbCatName; + } + + public void setGnbCatName(String gnbCatName) { + this.gnbCatName = gnbCatName; + } + + public String getViewGnbCat() { + return viewGnbCat; + } + + public void setViewGnbCat(String viewGnbCat) { + this.viewGnbCat = viewGnbCat; + } + + public String getIsMartCat() { + return isMartCat; + } + + public void setIsMartCat(String isMartCat) { + this.isMartCat = isMartCat; + } +} diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java b/MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java new file mode 100644 index 0000000..5747848 --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java @@ -0,0 +1,55 @@ +package com.ruby.codej.ramda.module; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +public class RamdaApiTest { + public static void main(String[] args) { + + //testStreamApi(); + testStreamApi2(); + } + + + public static void testRamdaApi(){ + List numbers = Arrays.asList(1,2,3,4,5,6); + + //Java 7 + for(int number : numbers){ + System.out.print(number); + } + + System.out.println("\n-------------------------------------"); + + //Java8 + numbers.forEach((Integer value) -> + System.out.print(value) + ); + System.out.println("\n-------------------------------------"); + + System.out.print("짝수값은 : "); + //Java8 + numbers.forEach((Integer value) -> { + //짝수 + if(value % 2 == 0){ + System.out.print(value); + } + }); + } + + public static void testStreamApi(){ + + List numbers = Arrays.asList(1,2,3,4,5,6); + long count = numbers.stream().filter(num-> num%2 ==0).count(); + System.out.println(count); + + } + + public static void testStreamApi2(){ + Stream numbers = Stream.of(1,2,3,4,5); + numbers.map(num->num*2).forEach(num->System.out.println(num)); + } + + +} From 7b83008f964e541903beffcc13cdfdd3ade6f871 Mon Sep 17 00:00:00 2001 From: woohyunjo Date: Tue, 20 Oct 2015 12:06:45 +0900 Subject: [PATCH 8/8] =?UTF-8?q?Ramda=20Test=20Class=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=201.=EB=9E=8C=EB=8B=A4=EC=8B=9D=202.Stream=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruby/codej/AutoCompleteWord.java | 108 ++++++++++++++++++ .../ruby/codej/ramda/module/RamdaApiTest.java | 55 +++++++++ 2 files changed, 163 insertions(+) create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java create mode 100644 MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java b/MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java new file mode 100644 index 0000000..2e852f6 --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/AutoCompleteWord.java @@ -0,0 +1,108 @@ +package com.ruby.codej; + + +/** + * Created by jekalmin on 2015-10-14. + */ +public class AutoCompleteWord { + + String type; + String word; + String html; + String count; + String initMatch; + String parentCatSrl; + String parentCatName; + String gnbCatSrl; + String gnbCatName; + String viewGnbCat; + String isMartCat; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getWord() { + return word; + } + + public void setWord(String word) { + this.word = word; + } + + public String getHtml() { + return html; + } + + public void setHtml(String html) { + this.html = html; + } + + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } + + public String getInitMatch() { + return initMatch; + } + + public void setInitMatch(String initMatch) { + this.initMatch = initMatch; + } + + public String getParentCatSrl() { + return parentCatSrl; + } + + public void setParentCatSrl(String parentCatSrl) { + this.parentCatSrl = parentCatSrl; + } + + public String getParentCatName() { + return parentCatName; + } + + public void setParentCatName(String parentCatName) { + this.parentCatName = parentCatName; + } + + public String getGnbCatSrl() { + return gnbCatSrl; + } + + public void setGnbCatSrl(String gnbCatSrl) { + this.gnbCatSrl = gnbCatSrl; + } + + public String getGnbCatName() { + return gnbCatName; + } + + public void setGnbCatName(String gnbCatName) { + this.gnbCatName = gnbCatName; + } + + public String getViewGnbCat() { + return viewGnbCat; + } + + public void setViewGnbCat(String viewGnbCat) { + this.viewGnbCat = viewGnbCat; + } + + public String getIsMartCat() { + return isMartCat; + } + + public void setIsMartCat(String isMartCat) { + this.isMartCat = isMartCat; + } +} diff --git a/MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java b/MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java new file mode 100644 index 0000000..5747848 --- /dev/null +++ b/MyGitSpringProject/src/main/java/com/ruby/codej/ramda/module/RamdaApiTest.java @@ -0,0 +1,55 @@ +package com.ruby.codej.ramda.module; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +public class RamdaApiTest { + public static void main(String[] args) { + + //testStreamApi(); + testStreamApi2(); + } + + + public static void testRamdaApi(){ + List numbers = Arrays.asList(1,2,3,4,5,6); + + //Java 7 + for(int number : numbers){ + System.out.print(number); + } + + System.out.println("\n-------------------------------------"); + + //Java8 + numbers.forEach((Integer value) -> + System.out.print(value) + ); + System.out.println("\n-------------------------------------"); + + System.out.print("짝수값은 : "); + //Java8 + numbers.forEach((Integer value) -> { + //짝수 + if(value % 2 == 0){ + System.out.print(value); + } + }); + } + + public static void testStreamApi(){ + + List numbers = Arrays.asList(1,2,3,4,5,6); + long count = numbers.stream().filter(num-> num%2 ==0).count(); + System.out.println(count); + + } + + public static void testStreamApi2(){ + Stream numbers = Stream.of(1,2,3,4,5); + numbers.map(num->num*2).forEach(num->System.out.println(num)); + } + + +}