본문 바로가기

Footstep . 발자취

2020/04/04 Foot step

About programming

Learned about JPA, JUnit test,

-org.springframework.web.client.RestClientException:

Url을 불러오는 과정에서 url이 맞지 않아서 생기는 문제.

PostsApiController// @PutMapping("/posts/{id}")라면

String url = "http://localhost:" + port + "/posts/" + updateId; 에서 "/posts/" 로 해줘야 함.

 

-web에서 http://localhost:8080/api/v1/posts/2로 들어가서 조회 하려고 할때 조회가 안되면

ApiController 에 GetMapping추가 후 Response와 연결 ex.

@GetMapping("/api/v1/posts/{id}")
public PostsResponseDto findById(@PathVariable Long id){
return postsService.findById(id);
}

 

 

 

 

Todo-list

'Footstep . 발자취' 카테고리의 다른 글

2020/04/06 Foot step  (0) 2020.04.06
2020/04/05 Foot step  (0) 2020.04.05
2020/04/03 Foot step  (0) 2020.04.03
2020/04/02 Foot step  (0) 2020.04.02
2020/04/1 Foot step  (0) 2020.04.01