분류 전체보기
-
[스프링 팀프로젝트] IPv4 KPT스파르타코딩클럽/스프링 팀 프로젝트 - Back Office 2023. 12. 11. 15:05
IPv4 | Built with Notion Built with Notion, the all-in-one connected workspace with publishing capabilities. teamsparta.notion.site 1. 프로젝트 개요 프로젝트 명 : X보다 더 나은 Y 프로젝트 설명 : X와 Threads향을 조금씩 가미한 SNS 백엔드 서버 API 필수구현 사용자 인증 (회원가입, 로그인 및 로그아웃) 프로필관리 (프로필 수정, 비밀번호 수정) 게시글 CRUD 추가구현 소셜로그인 (카카오, 네이버) 백오피스 (admin 권한) 좋아요 팔로우 명예의전당 프로필 사진 업로드 게시물 멀티미디어 지원 기능 2. Keep 1. 소통을 중요시하며 자리 비움이나 문제가 생기면 빠르게 공유하겠습..
-
복합키(Composite key)란?스파르타코딩클럽/스프링 팀 프로젝트 - Back Office 2023. 12. 7. 20:52
복합키란 "두 개 이상의 열(column)을 결합하여 하나의 특별한 키로 만든 것" 특징 1. 각각의 키가 유일하지 않을 경우 여러 키를 결합하여 행의 유일성 보장 2. RDB에서 주로 사용되며, 연결테이블에서 많이 사용된다. 3. 종종 FK와 결합되어 사용되며, 두 테이블간의 관계를 보다 명확하게 표현 가능 간단히 내가 이해한것을 써보자면 복합키는 PK가 여러개이다. 그래서 DB는 여러개의 PK를 가진 객체가 서로 같은것인지 확인하기 위해 PK를 객체(=구현체)로 묶어서 확인한다. 프로젝트 내에서 Follow를 구현하기 위해 처음에 복합키를 고려하였다. @Entity @Getter @RequiredArgsConstructor @IdClass(FollowID.class) public class Follo..
-
PUT 그리고 PATCH스파르타코딩클럽/스프링 팀 프로젝트 - Back Office 2023. 12. 6. 21:28
@PatchMapping @PutMapping 간단하게 PATCH는 일부분만 변경 PUT은 전체 변경으로 알려져있다. 다만 PUT에서 데이터를 일부분만 전달할 경우. 입력하지 않은 값은 null이 들어가며, 이 데이터를 지워달라는 요청으로 해석하고 데이터에 null 값을 넣어 데이터를 삭제된 상태로 만든다. PUT과 PATCH의 가장 큰 차이점은 멱등성이다. 멱등성이란? 동일한 연산을 여러 번 적용해도 결과가 달라지지 않는 성질을 말한다. PUT은 멱등성을 가지고 있으며, PATCH는 멱등성을 가지고 있지 않다. 그래서 PUT은 동일 데이터로 특정 필드를 계속 업데이트해도 항상 같은 결과가 나온다. 하지만 PATCH는 멱등성을 가지지 않기 때문에 동일한 연산을 하더라도 다른 결과가 나올 수 있다. (다만..
-
팀프로젝트 Init commit스파르타코딩클럽/스프링 팀 프로젝트 - Back Office 2023. 12. 5. 21:06
Spring 백오피스 프로젝트 Threads SNS 제작 게시글, 댓글, 좋아요, 팔로우 기능을 구현한 SNS 만들기 사용자 인증 기능 회원가입 기능 username, password를 Client에서 전달받기 username은 최소 4자 이상, 10자 이하이며 알파벳 소문자(a~z), 숫자(0~9)로 구성되어야 한다. password는 최소 8자 이상, 15자 이하이며 알파벳 대소문자(a~z, A~Z), 숫자(0~9), 특수문자로 구성되어야 한다. DB에 중복된 username이 없다면 회원을 저장하고 Client 로 성공했다는 메시지, 상태코드 반환하기 회원 권한 부여하기 (ADMIN, USER) - ADMIN 회원은 모든 게시글, 댓글 수정 / 삭제 가능 참고자료 https://mangkyu.tis..
-
테스트코드 질문 요약스파르타코딩클럽/스프링 개인 프로젝트 - Test Code 2023. 12. 1. 21:50
통합테스트와 단위테스트의 차이 단위테스트는 테스트 가능한 가장 작은 소프트웨어를 실행하여 예상대로 동작하는지 확인 단위테스트보다 더 큰 동작을 달성하기 위해 어려 모듈을 모아 의도대로 협력하여 작동하는지 확인 통합테스트와 단위테스트의 장단점 장점 단점 단위테스트 격리된 환경에서 개별 코드단위로 테스트하므로 문제해결이 쉬움 통합이슈를 테스트 불가 통합테스트 구성요소의 상호작용을 테스트하기 때문에 단위테스트보다 정확하게 평가 가능 단위테스트보다 시간이 오래 걸리며, 환경설정이 복잡함 레이어별로 나누어서 Slice Test 를 하는 이유 @SpringBootTest 를 쓴다면 구동되는 모든 설정과 빈을 가져오기 때문에 시간이 오래걸린다. 슬라이스 테스트는 FIRST원칙을 지키는 좋은 방법이다. 테스트의 필요성..
-
[팀프로젝트] 육조판서 플레이트 마무리스파르타코딩클럽/스프링 팀 프로젝트 - News Feed 2023. 11. 28. 21:03
KPT를 작성 의무를 갖지 않은 평범한 팀원이기 때문에 개인적으로 프로젝트를 마무리하면서 느낀점을 적어본다. 1. 코드의 문제 프로젝트를 하며 발생한 모든 문제가 시큐리티에서 파생되어 나왔다. 지금 기억나는 것만 해도 ROLE_USER 권한을 넣지 않아 발생한 문제라던가 비밀번호를 쓰지않기 때문에 return null을 적었더니, 전혀 쓰지않음에도 불구하고 nullPointerException을 발생했던것 그리고 로그인 당시 필터에서 로그인할지, 컨트롤러에서 로그인할지를 정하지 않아서 로그인이 되지 않던 것까지. 시큐리티를 맡은 입장으로서 merge 후에 에러가 터질때마다 참 난감했다. 다른 팀원분이 말씀하셨듯이 기능별로 나눠 구현하는것은 간단한 CRUD 정도에서는 가능했지만 시큐리티 같은 코드 전체에 ..