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 |