프로젝트23 StackOverFlow(Clone) 회고 StackOverFlow(Clone) 회고 10월 말에 팀과 같이 StackOverFlow를 클론 코딩하는 프로젝트를 진행하였다. 여기서는 이 프로젝트에 대해 내가 느꼈던 것과 경험했던 것들을 정리하고 부족했던 점이나 개선해야 할 점을 기록하려고 한다. 이 프로젝트는 10월 20일부터 11월 14일까지 약 2주간 진행되었다. 1. 협업의 이상과 현실 나는 지금 까지 내가 배운 기술들을 적용해서 웹사이트를 만들어보고 싶은 마음에, 간간히 사이드 프로젝트를 혼자서 진행했었다. 혼자 서비스를 구상하고, API를 만들고 어떨때는 타임리프 같은 것을 사용해서 직접 화면을 만져보기도 했었다. 하지만 타인과 팀을 짜서 한 프로젝트를 위해 같이 코드를 짜고, 협업 프로그램(git)등을 사용해서 "협업"이라는 것을 해본.. 2022. 12. 8. RelationController RelationController 사전에 정의한 API 명세에 따른 Controller를 구현한다. 1. RelationValidator Controller로 들어오는 accountId 간에 검증을 처리한다. Controller로 들어오는 accountId는 별개의 파라미터로 Spring에서 제공하는 Validator 기능을 사용할 수 없기에 따로 RelationValidator 클래스를 생성하고 Controller에서 해당 Validator를 적용한다. ■ RelationValidator Account간 Relation의 상태에 대해 검증을 시행한다. [RelationValidator] @Component @RequiredArgsConstructor public class RelationValidato.. 2022. 6. 3. RelationService RelationService Relation에 대한 business Logic을 처리하는 RelationService를 생성하고 구현한다. 1. RelationService ■ RelationService [RelationService] @Service @Transactional(readOnly = true) @RequiredArgsConstructor public class RelationService { private final AccountRepository accountRepository; private final RelationRepository relationRepository; . . . } □ requestFriend fromAccountId -> toAccountId 방향의 "친구 요청".. 2022. 6. 3. RelationRepository RelationRepository Relaiton 엔티티를 DB에서 가져오는 RelationRepository를 생성한다. 복잡한 Query문이 들어가거나 Paging을 해야 하는 경우에는 QueryDsl을 사용한다. 1. Spring Data JPA ■ RelationRepository [RelationRepository] public interface RelationRepository extends JpaRepository, RelationRepositoryCustom { @Query("select relations from Relation relations " + "join relations.fromAccount fromAccount " + "join fetch relations.toAccount .. 2022. 6. 1. 이전 1 2 3 4 5 6 다음