IT'S DO
Published 2022. 8. 26. 14:40
HelloController 개발/JPA
728x90
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello() {
        return "hello Spring Boot!";
    }

    @GetMapping("/hello/dto")
    public HelloResponseDto helloResponseDto(@RequestParam("name") String name, @RequestParam("nickname") String nickname) {
        return new HelloResponseDto(name, nickname);
    }
}

 

@Getter
@RequiredArgsConstructor
public class HelloResponseDto {

    private final String name;
    private final String nickname;
}

 

'개발 > JPA' 카테고리의 다른 글

Jpa fileupload를 위한 샘플링 자료들  (0) 2022.09.06
지연 로딩 즉시 로딩  (0) 2022.08.30
Entity 클래스는 유의 사항  (0) 2022.08.26
Jpa에서 테이블 내부, 외부  (0) 2022.08.26
업데이트 시 code+1  (0) 2022.08.26
profile

IT'S DO

@멋진놈

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!