spring 21

RequestParam(required = true) null exception 하는 법

전체 코드 https://github.com/GHGHGHKO/goose-auth-api-server GitHub - GHGHGHKO/goose-auth-api-server Contribute to GHGHGHKO/goose-auth-api-server development by creating an account on GitHub. github.com @Operation(summary = "GooseAuth delete item uris", description = "id로 접속 정보의 uri들을 삭제한다.") @DeleteMapping(value = "/items/{itemIdentity}") public ResponseEntity gooseAuthDeleteItemUris( @Parameter(nam..

SpringBoot 2022.10.05

jib 배포, 코드 배포, 코드 컨테이너, 앱 컨테이너 만들기

https://alden-kang.tistory.com/1 jib를 이용한 자바 앱 컨테이너화 오늘은 구글 클라우드 도구 중 하나인 jib를 이용한 자바 애플리케이션 컨테이너화 과정에 대해 살펴보려고 합니다. jib가 무엇인지 궁금하신 분들을 위해 간단한 설명과 예제 애플리케이션을 alden-kang.tistory.com 해당 출처를 기반으로 만들었습니다. 본 블로그에서는 java 11을 활용했습니다. jib은 해당 명령어를 실행하면 설정되어 있는 컨테이너 장소에 이미지를 push 하는 명령어이다. 자세한 내용은 출처에 있다. 바로 시작 build.gradle에 아래와 같이 설정한다. plugins { id 'org.springframework.boot' version '2.7.1' id 'io.spri..

SpringBoot 2022.07.15

docker 이미지 생성, docker hub 업로드, docker springboot mysql 연동

application.yml 혹은 application.properties 파일 수정 ​ 우선 local에서 작업한 springboot 프로젝트를 docker 이미지로 뽑아내기 위해 application.yml 혹은 application.properties 파일을 수정해야한다. //application.properties spring.datasource.url=jdbc:mysql://my_mysql:3306/mydatabase?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true application.properties 내용에 위 내용 말고도 다른 내용이 많을 것으로 예상된다. localhost 혹은 127...

Docker 2021.10.22

springboot로 Rest api 만들기(8) SpringSecurity를 이용한 인증 및 권한부여

전체 소스코드 https://github.com/GHGHGHKO/Springboot/tree/main/pepega_chapter_8 GitHub - GHGHGHKO/Springboot: 블로그에 업로드 된 소스코드 블로그에 업로드 된 소스코드. Contribute to GHGHGHKO/Springboot development by creating an account on GitHub. github.com 이전 포스팅에서는 Spring에서 메시지를 처리하는 방법에 대해서 알아봤고 MessageSource를 이용하여 Exception Message를 고도화하였다. swagger에서 response body의 내용을 한글, 영어로 바꾸며 도출하는 내용을 포스팅 했었다. ​ 이번 포스팅에서는 SpringSecu..

SpringBoot 2021.10.22

springboot로 Rest api 만들기(7) MessageSource를 이용한 Exception 처리

시작 전 변경 사항이 있다! (2022.07.18 수정) https://github.com/akkinoc/yaml-resource-bundle/issues/103 bug: No libraries found for 'dev.akkinoc.util.YamlResourceBundle' · Issue #103 · akkinoc/yaml-resource-bundle Describe the bug use Gradle Groovy DSL I found No libraries found for 'dev.akkinoc.util.YamlResourceBundle' To Reproduce implementation 'dev.akkinoc.util:yaml-resource-bundle:2.4.1'... github.com 해..

SpringBoot 2021.10.22

springboot로 Rest api 만들기(6) ControllerAdvice를 이용한 Exception 처리

전체 소스코드 https://github.com/GHGHGHKO/Springboot/tree/main/pepega_chapter_6 GitHub - GHGHGHKO/Springboot: 블로그에 업로드 된 소스코드 블로그에 업로드 된 소스코드. Contribute to GHGHGHKO/Springboot development by creating an account on GitHub. github.com ​ 이전 포스팅에서는 본격적으로 API 서버 개발을 하기 전 API 인터페이스 및 결과 데이터 구조를 살펴보고 확장 가능한 형태로 설계해보았다. ​ API 성공에 대한 내용만 포스팅했지만 이번 포스팅에는 실패 시 ExceptionHandling과 결과 Message 처리에 대한 내용을 살펴보도록 하겠다...

SpringBoot 2021.10.22

springboot로 Rest api 만들기(5) API 인터페이스 및 결과 데이터 구조 설계

전체 소스코드 https://github.com/GHGHGHKO/Springboot/tree/main/pepega_chapter_5 GitHub - GHGHGHKO/Springboot: 블로그에 업로드 된 소스코드 블로그에 업로드 된 소스코드. Contribute to GHGHGHKO/Springboot development by creating an account on GitHub. github.com 이전 포스팅에는 swagger를 활용하여 API 문서를 자동화하는 웹페이지를 제작했다. ​ 이번 포스팅에는 API 서버 개발을 본격적으로 진행해 보기 위해 현재 API 인터페이스 및 결과 데이터의 구조를 살펴보고 확장 가능한 형태로 설계할 것이다. ​ API는 제공 대상이 클라이언트 APP이나 WEB 개..

SpringBoot 2021.10.22

springboot로 Rest api 만들기(4) Swagger API 문서 자동화

전체 소스코드 https://github.com/GHGHGHKO/Springboot/tree/main/pepega_chapter_4 GitHub - GHGHGHKO/Springboot: 블로그에 업로드 된 소스코드 블로그에 업로드 된 소스코드. Contribute to GHGHGHKO/Springboot development by creating an account on GitHub. github.com ​ 이전 포스팅에는 H2 Database를 활용하여 GET, POST 방식으로 데이터를 출력하고 도출하는 방법을 진행했었다. ​ 이번 포스팅에는 프론트앤드 개발자가 편하게 참고할 수 있는 문서인 Swagger라는 것을 활용하여 API 문서 자동화를 진행해보려 한다. ​ ​ 시작 ​ ​ build.grad..

SpringBoot 2021.10.21

springboot로 Rest api 만들기(3) H2 Database 연동

전체 소스코드 https://github.com/GHGHGHKO/Springboot/tree/main/pepega_chapter_3 GitHub - GHGHGHKO/Springboot: 블로그에 업로드 된 소스코드 블로그에 업로드 된 소스코드. Contribute to GHGHGHKO/Springboot development by creating an account on GitHub. github.com 전 포스팅에서는 boot를 활용하여 HelloWorld를 GetMapping, ResponseBody로로 출력해보았다. ​ 이번 포스팅에는 SpringBoot에 Database를 연동하는 실습을 포스팅하겠다. ​ Database는 H2 database를 활용할 예정이다. ​ ​ H2 Database H2..

SpringBoot 2021.10.21

springboot로 Rest api 만들기(2) HelloWorld

전체 소스코드 https://github.com/GHGHGHKO/Springboot/tree/main/pepega_chapter_2 GitHub - GHGHGHKO/Springboot: 블로그에 업로드 된 소스코드 블로그에 업로드 된 소스코드. Contribute to GHGHGHKO/Springboot development by creating an account on GitHub. github.com 이전 포스팅에서는 ​ http://start.spring.io/ 위 웹사이트에서 프로젝트를 만들고 실행해보는 실습을 했다. ​ localhost:8080으로 접속하여 서버가 작동하는지 테스트했다. ​ 이번 포스팅에서는 HelloWorld를 만들어보려고 한다. ​ java는 src/main/java 하위에..

SpringBoot 2021.10.21