package com.sample.controller; import lombok.Data; import lombok.Builder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/sample") public class SampleController { @GetMapping("/hello") public SampleDto hello() { return SampleDto.builder().msg("hello").build(); } @Builder @Data private static class SampleDto { private String msg; } }