Skip to content

Hanghae99-cloneCoding-team8/ohou-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ohou-Backend 📆 2021.12.13 ~ 2021.12.16

프로젝트 소개

원스톱 인테리어 플랫폼으로서 다양한 인테리어 콘텐츠를 제공하는 오늘의 집을 클론 코딩하여 소셜 커머스 사이트의 주요 기능들을 구현해 보았다. 🏠

백엔드 수행작업

  • DB 스키마 설계
  • 오늘의 집 상품 데이터 크롤링 및 DB 구축(AWS RDS)
  • API 설계 및 비즈니스 로직 구현
  • CORS 설정
  • Swagger 설정
  • End-to-End Test
  • AWS EC2 배포

와이어 프레임

Figma


ERD 설계

Untitled (4)


API 설계

api img


Back-End

팀원 소개

👨🏻‍🤝‍👨🏻 Members 👨🏻‍🤝‍👨🏻


🕸️ BACK-END 🕸️ BACK-END 🕸️ BACK-END

기술 스택

                                   


Trouble Shooting

  1. restTemplate의 Delete 메소드 사용시, 테스트 케이스가 계속 실패

오류 코드

restTemplate.delete("/api/products/reviews/" + commentId, request);

오류 발생 이유: restTemplate.delete을 사용하면 request 객체를 매개변수로 받을 수가 없어서 계속 에러가 났다. 아래 코드를 보면 request 객체를 받을 수 있는 메소 없다.

	/**
	 * Delete the resources at the specified URI.
	 * <p>
	 * URI Template variables are expanded using the given URI variables, if any.
	 * <p>
	 * If you need to assert the request result consider using the
	 * {@link TestRestTemplate#exchange exchange} method.
	 * @param url the URL
	 * @param urlVariables the variables to expand in the template
	 * @see RestTemplate#delete(java.lang.String, java.lang.Object[])
	 */
	public void delete(String url, Object... urlVariables) {
		this.restTemplate.delete(url, urlVariables);
	}

	/**
	 * Delete the resources at the specified URI.
	 * <p>
	 * URI Template variables are expanded using the given map.
	 * <p>
	 * If you need to assert the request result consider using the
	 * {@link TestRestTemplate#exchange exchange} method.
	 * @param url the URL
	 * @param urlVariables the variables to expand the template
	 * @see RestTemplate#delete(java.lang.String, java.util.Map)
	 */
	public void delete(String url, Map<String, ?> urlVariables) {
		this.restTemplate.delete(url, urlVariables);
	}

	/**
	 * Delete the resources at the specified URL.
	 * <p>
	 * If you need to assert the request result consider using the
	 * {@link TestRestTemplate#exchange exchange} method.
	 * @param url the URL
	 * @see RestTemplate#delete(java.net.URI)
	 */
	public void delete(URI url) {
		this.restTemplate.delete(applyRootUriIfNecessary(url));
	}

수정코드

ResponseEntity<String> resp = restTemplate.exchange("/api/products/reviews/" + commentId, HttpMethod.DELETE, request, String.class);

exchange 메소드를 사용하여 delete 요청이 request를 받을 수 있도록 설정해주어서 해결 했다.


  1. Jsop 을 사용하여 오늘의 집 웹 크롤링 실패

오류 발생 이유: 정적 웹 페이지가 아닌, 무한 스크롤 등의 기능이 구현된 동적 웹 페이지는 Jsoup 으로 크롤링이 힘들다.

오류 해결: Selenium 을 사용했다.
또한 제품 상세 정보를 크롤링 하기 위해서는, 직접 상품 상세 페이지를 하나하나 들어가서 크롤링 해와야 한다.
이 때, 상품 URL을 먼저 크롤링 해온 후, driver.get(); 메소드로 접속하고, driver.close(); 메소드로 접속 해제를 해주었다.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages