글

라벨이 postman인 게시물 표시

[SpringBoot] 스프링부트 프로젝트 생성 후 Swagger 사용 및 테스트하기3 REST PULL테스트~에러예외처리~(만들기 스프링부트3.25 )_IntelliJ IDEA 2024.1JDK17 spring-boot test api ajax json--++

   * 초기 세팅 (개발환경) 및 설정  https://rockbottomdevbus.blogspot.com/2024/04/springboot-1-325-intellij-idea-20241.html * 이전 글  [SpringBoot] 스프링부트 프로젝트 생성 후 Swagger 사용 및 테스트하기1 REST PULL테스트~Swagger 사용방법~(만들기 스프링부트3.25 )_IntelliJ IDEA 2024.1JDK17 spring-boot test api ajax json--++ https://rockbottomdevbus.blogspot.com/2024/04/springboot-swagger-1-rest-pullswagger.html [SpringBoot] 스프링부트 프로젝트 생성 후 Swagger 사용 및 테스트하기2 REST PULL테스트~컨트롤러 추가 테스트~(만들기 스프링부트3.25 )_IntelliJ IDEA 2024.1JDK17 spring-boot test api ajax json--++ https://rockbottomdevbus.blogspot.com/2024/04/springboot-swagger-2-rest-pull-325.html * 어드비아스 패키지 추가 - CustomRestAdvice 파일 생성   1. advice 패키지 생성  >> 경로 : /main/java/{pakage name}/advice 2. CustomRestAdvice.java  클래스 생성 >> 1번 경로에 생성 : 오류처리(예외처리) 오류 발생 시 화면에 에러를 띄워줌 (400번대 에러) --  CustomRestAdvice.java  package org.zerock.b01.controller.advice; import lombok.extern.log4j. Log4j2 ; import org.springframework.dao.DataIntegrit...

[SpringBoot] 스프링부트 프로젝트 생성 후 Swagger 사용 및 테스트하기2 REST PULL테스트~컨트롤러 추가 테스트~(만들기 스프링부트3.25 )_IntelliJ IDEA 2024.1JDK17 spring-boot test api ajax json--++

이미지
  * 초기 세팅 (개발환경) 및 설정  https://rockbottomdevbus.blogspot.com/2024/04/springboot-1-325-intellij-idea-20241.html * 이전 글  [SpringBoot] 스프링부트 프로젝트 생성 후 Swagger 사용 및 테스트하기1 REST PULL테스트~Swagger 사용방법~(만들기 스프링부트3.25 )_IntelliJ IDEA 2024.1JDK17 spring-boot test api ajax json--++ https://rockbottomdevbus.blogspot.com/2024/04/springboot-swagger-1-rest-pullswagger.html * 컨트롤러 추가 - ReplyController 파일 생성   1. controller 패키지 생성  >> 경로 : /main/java/{pakage name}/controller 2. ReplyController.java  클래스 생성 >> 1번 경로에 생성 게시판(댓글) 컨트롤 생성 --  ReplyController.java  package org.zerock.b01.controller; import io.swagger.v3.oas.annotations. Operation ; import lombok.extern.log4j. Log4j2 ; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation. PostMapping ; import org.springframework.web.bind.annotation. RequestBody ; import org.springframework.web.bind.annotation. RequestMap...

[SpringBoot] 스프링부트 프로젝트 생성 후 Swagger 사용 및 테스트하기1 REST PULL테스트~Swagger 사용방법~(만들기 스프링부트3.25 )_IntelliJ IDEA 2024.1JDK17 spring-boot test api ajax json--++

이미지
  * 초기 세팅 (개발환경) 및 설정  https://rockbottomdevbus.blogspot.com/2024/04/springboot-1-325-intellij-idea-20241.html * Swagger  - RESTpull API를 테스트 할 수 있는 포스트맨과 비슷한 프레임워크   - 라이브러리 추가  1. build.gadle - dependencies에 라이브러리 한줄 추가  -- build.gradle dependencies { // Swagger UI (REST Pull [ajax] API 테스트용 ) implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0' } - SwaggerConfig 파일 생성  1. config 패키지 생성  >> 경로 : /main/java/{pakage name}/config 2. SwaggerConfig.java  클래스 생성 >> 1번 경로에 생성 Swagger 설정 파일 생성  --  SwaggerConfig.java  package org.zerock.b01.config; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import org.springframework.context.annotation. Bean ; import org.springframework.context.annotation. Configuration ; @Configuration public class SwaggerConfig { @Bean public OpenAPI openAPI () { return new OpenAPI() .info( new Info...
T O P