![thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdznPGf%2FbtrEsBUBw4f%2FEWmKQq7pkzIB5Hq8zOHOh0%2Fimg.png)
[java] JSONObject, JSONArray 이용하기
2022. 6. 10. 13:19
몰아 넣기
자바에서 JSON 파싱하기 첫번째 : JSONObject, JSONArray 이용하기 JSONObject, JSONArray 이용하기 restTeamplate를 이용한 데이터를 받았을 경우 // 데이터를 받은 ResponseEntity타입의 객체를 getBody() 이용하여 String 객체에 대입한다. String result = responseEntity.getBody(); // result데이터를 JSONObject 객체로 변환한다. JSONObject rjson = new JSONObject(result); // JSONObject 객체는 Key : value 형태이기 때문에 .getJSONArray("key") 로 값을 확인 할 수 있다. JSONArray items = rjson.getJSON..
![thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FczarfA%2FbtrEpAvacBF%2FC9dOnKgkBS2KXJCxE98HO0%2Fimg.png)
[java] Arrays의 메소드
2022. 6. 10. 11:17
몰아 넣기
자바 Arrays의 메소드 String[] a = {"a","b","c","d"}; int[] b = {1,5,5,7,3,3,42,6,8,45323,4,63,2,1}; .asList(T..a) 배열을 ArrayList로 변환해준다. Arrays.asList(a); .toString() 배열에도 toString이 존재한다. toString이라는 메소드는 클래스에서 ALT+SHIFT+S를 누른 후 Generate toString을 이용해 오버라이딩할 수 있다. System.out.println(Arrays.toString(b)); Sort(array) 정렬은 쓰이는 곳이 굉장히 많은데 기본적으로 Sort()를 하면 오름차순 정렬이 된다. 정수형 배열을 내림차순 정렬하고 싶으면 반복문으로 배열을 뒤에서부터 꺼..
![thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlefvL%2FbtrErfYmzcK%2F5jmIt4htpGOYzogPa7Nji1%2Fimg.png)
[java] 날짜와 시간 다루기
2022. 6. 10. 11:09
몰아 넣기
DateTimeFormatter (Java Platform SE 8 ) Parses the text using this formatter, without resolving the result, intended for advanced use cases. Parsing is implemented as a two-phase operation. First, the text is parsed using the layout defined by the formatter, producing a Map of field to value, a docs.oracle.com 날짜와 시간 다루기 예제 public class Main { public static void main(String[] args) { System.out...
[github]README 마크다운 양식
2022. 5. 8. 20:31
Git
# 프로젝트 이름 [![made-with-Markdown](https://img.shields.io/badge/Made%20with-Markdown-1f425f.svg)](http://commonmark.org) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/ohahohah/readme-template/graphs/commit-activity) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) > 프로젝트 간략 소개 한..
![thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FvLEX4%2FbtrA7HxFmCK%2FLNJU6NzkfWgAhf6klax4k1%2Fimg.png)
[스프링 부트 개념과 활용] SpringApplication 2부
2022. 5. 3. 15:55
무조건 따라하기/스프링부트(SpringBoot)
#1.7. Application Events and Listeners #Application 실행 후 뭔가 실행하고 싶을 때 ApplicationRunner를 추천 #1.7. Application Events and Listeners Application과 같은 동선에 sampleListener 를 생성하고 ApplicationListener클래스를 implments 해주고 빈등록과 오버라이드를 해주면 끝 여기서는 문서에 나와있는 ApplicationStartingEvent를 등록해주었다. package com.example.springapplication; import org.springframework.boot.context.event.ApplicationStartedEvent; import org...
![thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbUH2mc%2FbtrA53aLkxq%2F27bEJLPTdzBBTOGvP1ZFf1%2Fimg.png)
[스프링 부트 개념과 활용] SpringApplication 1부
2022. 5. 3. 15:29
무조건 따라하기/스프링부트(SpringBoot)
글을 쓰게 된이유 학원에서 스프링을 배웠다 하지만 그 스프링도 맛보기로 배운 스킬 실무에서는 스프링부트를 사용하기에 나는 많이 다르다고 느꼈다. 그리고 편리한 기능도 많고 좋은기능도 많다는 것을 알게 되었지만 스프링부트에 대해서 더 많이 알고싶어 강의를 수강했다. 그 강의의 내용을 바탕으로 글을 쓸 예정이다. Core Features Spring Boot lets you externalize your configuration so that you can work with the same application code in different environments. You can use a variety of external configuration sources, include Java propertie..
스프링부트와 AWS로 혼자 구현하는 웹 서비스 - 05장 (3) 구글로그인 - 구글로그인 연동하기
2022. 4. 29. 17:06
무조건 따라하기/Spring Boot 기반 Web Service
05장 (3) 구글로그인 - 구글로그인 연동하기 1) 기능 구현하기 User 클래스 생성 Role 클래스 생성 UserRepository 클래스 생성 package com.jojoldu.book.springboot.domain.user; import com.jojoldu.book.springboot.domain.BaseTimeEntity; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enu..
![thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbANF2M%2FbtrAOAd5s9o%2FEpWdTgXhZd05rALSEY5H30%2Fimg.png)
스프링부트와 AWS로 혼자 구현하는 웹 서비스 - 05장 (2) 구글로그인 - 구글크라우드 설정
2022. 4. 29. 16:24
무조건 따라하기/Spring Boot 기반 Web Service
5.2 구글 서비스 등록 구글 클라우드 플랫폼 Google Cloud Platform 하나의 계정으로 모든 Google 서비스를 Google Cloud Platform을 사용하려면 로그인하세요. accounts.google.com 1. 상단 오른쪽 새프로젝트(나는 이미 만들었기에 firstProject) 클릭 2. 팝업에 오른쪽 상단 새프로젝트 클릭 후 프로젝트 하나 생성 3. 메뉴 > api 및 서비스 > 사용자 인증 정보 4. +사용자 인증 정보 만들기 > OAuth 클라이언트 ID 클릭 5. 웹 애플리케이션 선택 , 승인된 리디렉션 URL 따라 쓰기 6. 사용자 인증 정보 자신이 만든 클라이언트 선택 7. 오른쪽 클라이언트ID, 클라이언트 보안비밀를 프로젝트에 설정을 해줄것이다. ** 승인된 리디렉..