본문 바로가기
Spring

[TIL] 231206Spring @RequestParam

by studymode 2023. 12. 6.

@RequestParam

    @GetMapping("/request-param")
    public ResponseEntity<List<PostResponseDto>> getPostByUser(@RequestParam ("user") String username){
        List<PostResponseDto> postResponseDtoList = new ArrayList<>();
        postResponseDtoList = postService.getPostByUser(username);
        return ResponseEntity.ok().body(postResponseDtoList);
    }

 

 

프로젝트로 RequestParam 사용해봄>_<