Skip to content

Commit

Permalink
feat: 오버뷰 기능 구현 (#367)
Browse files Browse the repository at this point in the history
* feat: 나의 태그 조회 기능 구현 및 문서화

* feat: 유저 태그 조회 기능 리팩토링 및 유저 달력 포스트 조회 기능 구현

* feat: myPagePost에 tagList 추가

* feat: Calendar 컴포넌트 추가

* feat: 멤버 프로필 포스트 조회시 필터링 옵션 추가(date, tagId)

* refactor: 선택된 tag 스타일 수정

* feat: 선택된 태그에 따른 필터 쿼리 생성 로직 구현

* refactor: 404 페이지 변경

* feat: Calendar Provider 추가 및 date 필터 기능 추가

* refactor: Calendar Provider 삭제

* fix: main merge 후 없어진 부분 돌림

* fix: 백엔드 코드 충돌 해결

* feat: 날짜 선택 시 focus 효과 추가

* refactor: key 추가 및 first-of-type 변경

* feat: 프로필 페이지에서 날짜 클릭 시 학습로그로 이동

* fix: ? => &로 수정

* refactor: 필터링 기능 함수로 변경 및 선택된 날짜 상태 추가

- useEffect의 의존성으로 인해 원치 않는 버그 발생

* fix: Calendar 월 변경 시 데이터 조회하도록 변경

* feat: 유저 태그 목록 및 캘린더 포스트 목록 조회 기능 구현 (#301)

* fix: release token expire length (#314)

* 뒤로가기 시 필터와 페이지네이션 유지 (#308)

* feature: url path params for history

* feature: url path params for history

* refactor: filter 중복 함수 훅으로 변경

* fix: 필요하지 않은 props 삭제

* fix: makeFilters 에러처리 추가

* refactor: makeFilters 함수 리팩토링

Co-authored-by: dudtjr913 <64782636+dudtjr913@users.noreply.github.com>

* feat: conflict 해결

* feat: merge 후 깨지는 테스트 수정 및 전체 태그 관련 추가

* feat: acceptance test 레벨 생성 추가

* refactor: 머지 후 에러 수정 및 스타일 변경

* refactor: Calendar 컴폰너트 배경 스타일 제거

* refactor: 필터링 레이아웃, 스타일 수정

* refactor: MainPage 내 카드 스타일 수정

* refactor: 캘린더, 태그 ProfilePage로 이동

* refactor: ProfilePageSideBar 컴포넌트  분리

* fix: 달력 2개월씩 넘어가는 버그 수정 및 ellipsis 적용

* fix: 오버뷰와 학습로그 페이지에서 글이 넘칠 때 ellipsis를 적용

* feat: memberTag 틀 작성

* feat: 멤버 태그 도메인 생성 및 멤버 태그 소팅기능 추가

* feat: member-post 필터링 기능 추가

* refactor: localDateTime -> localDate로 바꿈

* fix: time NPE 수정

* feat: 태그가 0일 때 분기처리

* refactor: Profilepage에서 변경된 API 적용

* refactor: Calendar hover 스타일 수정

* feat: 시간 오류 처리

* refactor: Calendar 선택에 따른 포스트목록 보여주기 구현

* refactor: 메뉴명 수정(관리 홈 -> 오버뷰)

* refactor: 폴더 구조 변경

* refactor: 폴더 구조 변경

* refactor: 테스트 폴더구조 정리

* refactor: 머지 후 충돌 해결

* feat: 태그 아이디가 0 일 때는 모두 보여주기

* feat: 스터디로그 명명 수정

* feat: 컨트롤러 필터 리퀘스트 적용

* fix: StudylogsSearchRequest import 수정

* fix: @searchParams 어노테이션 추가

* Delete .idea directory

* fix: pagination 설정 추가

* feat: studylog filter 에 date 추가

* refactor: n+1 문제 jdbcTemplate 구현으로 해결

* fix: 컴파일 오류 수정

* refactor: 멤버태그 cascade 정책 삭제

* refactor: 사용하지 않는 메서드 삭제

* feat: 기존 멤버태그 업데이트 기능 추가

* fix: 한 번에 같은 멤버 태그 업데이트시 증가가 안되는 버그 수정

* fix: 업데이트 안 되었을 시에만 맴버 태그 업데이트

* refactor: 멤버 태그 중복 시 예외 설정

* refactor: 필터링을 /posts 에서 /members/{name}/posts 로 변경

* fix: SearchArgumentResolver

* fix: SearchArgumentResolver

* refactor: 유저별 포스트 조회 API 변경

* fix: merge

Co-authored-by: HyuuunjuKim <gus7wn@gmail.com>
Co-authored-by: dudtjr913 <64782636+dudtjr913@users.noreply.github.com>
Co-authored-by: 류성현 <brown@woowahan.com>
  • Loading branch information
4 people authored Sep 9, 2021
1 parent 641b796 commit c940b63
Show file tree
Hide file tree
Showing 92 changed files with 3,048 additions and 656 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package wooteco.prolog.fixtures;

import wooteco.prolog.studylog.application.dto.StudylogRequest;
import wooteco.prolog.studylog.application.dto.TagRequest;

import java.util.Arrays;
import java.util.List;

import static java.util.stream.Collectors.toList;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.*;

public enum PostAcceptanceFixture {
POST1(
"[자바][옵셔널] 학습log 제출합니다.",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
TAG1,
TAG2
),
POST2(
"[자바스크립트][비동기] 학습log 제출합니다.",
"모던 JS의 fetch문, ajax라이브러리인 axios등을 통해 비동기 요청을 \n " +
"편하게 할 수 있습니다. 자바 최고",
2L,
TAG3,
TAG4
),
POST3(
"[자료구조] 자료구조는 어려워요",
"진짜 어려움",
1L,
TAG1,
TAG5
),
POST4(
"[DOM] DOM DOM Dance",
"덤덤 댄스 아니고",
2L
),
POST5(
"[알고리즘] 자료구조의 big O에 관하여",
"big O는 small O보다 크다",
2L,
TAG5,
TAG6
);

PostAcceptanceFixture(
String title,
String content,
Long missionId,
TagAcceptanceFixture... tags) {
this.tags = Arrays.asList(tags);
List<TagRequest> tagRequests = Arrays.stream(tags)
.map(TagAcceptanceFixture::getTagRequest)
.collect(toList());
this.studylogRequest = new StudylogRequest(title, content, missionId, tagRequests);
}

private final StudylogRequest studylogRequest;
private final List<TagAcceptanceFixture> tags;

public StudylogRequest getPostRequest() {
return studylogRequest;
}

public static List<StudylogRequest> findByMissionNumber(Long missionId) {
return Arrays.stream(PostAcceptanceFixture.values())
.map(PostAcceptanceFixture::getPostRequest)
.filter(it -> it.getMissionId().equals(missionId))
.collect(toList());
}

public static List<StudylogRequest> findByTagNumber(Long tagId) {
return Arrays.stream(PostAcceptanceFixture.values())
.filter(it -> it.tags.stream().anyMatch(tag -> tag.getTagId().equals(tagId)))
.map(PostAcceptanceFixture::getPostRequest)
.collect(toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ public TagRequest getTagRequest() {
public Long getTagId() {
return tagId;
}

public String getTagName() {
return tagRequest.getName();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package wooteco.prolog.steps;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;

import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import java.time.MonthDay;
import java.time.Year;
import java.util.List;
import wooteco.prolog.AcceptanceSteps;
import wooteco.prolog.fixtures.GithubResponses;
import wooteco.prolog.fixtures.PostAcceptanceFixture;
import wooteco.prolog.fixtures.TagAcceptanceFixture;
import wooteco.prolog.studylog.application.dto.CalendarStudylogResponse;
import wooteco.prolog.studylog.application.dto.MemberTagResponse;

public class StudyLogOverviewStepDefinitions extends AcceptanceSteps {

@When("{string}의 태그 목록을 조회하면")
public void 나의태그목록을조회하면(String name) {
final String memberName = GithubResponses.findByName(name).getLogin();
context.invokeHttpGet("/members/" + memberName + "/tags");
}

@Then("해당 유저의 태그 목록이 조회된다")
public void 나의태그목록이조회된다() {
final List<MemberTagResponse> data = context.response.then().extract()
.body()
.jsonPath()
.getList("data", MemberTagResponse.class);

assertThat(data)
.extracting(
memberTagResponse -> memberTagResponse.getTagResponse().getName(),
MemberTagResponse::getCount)
.containsExactlyInAnyOrder(
tuple(TagAcceptanceFixture.TAG1.getTagName(), 1),
tuple(TagAcceptanceFixture.TAG2.getTagName(), 1),
tuple(TagAcceptanceFixture.TAG3.getTagName(), 1),
tuple(TagAcceptanceFixture.TAG4.getTagName(), 1),
tuple("all", 4)
);
}

@When("{string}의 {int}년 {int}월 포스트 목록을 조회하면")
public void 나의포스트목록을조회하면(String name, int year, int month) {
final String memberName = GithubResponses.findByName(name).getLogin();
String path = String.format("members/%s/calendar-posts?year=%d&month=%d", memberName, year, month);
context.invokeHttpGet(path);
}

@When("{string}의 이번 달 포스트 목록을 조회하면")
public void 이번달포스트목록을조회하면(String name) {
나의포스트목록을조회하면(name, Year.now().getValue(), MonthDay.now().getMonth().getValue());
}

@Then("해당 유저의 포스트 목록이 조회된다")
public void 나의포스트목록이조회된다() {
final List<CalendarStudylogResponse> data = context.response.then().extract()
.body()
.jsonPath()
.getList("data", CalendarStudylogResponse.class);

assertThat(data).extracting(CalendarStudylogResponse::getTitle)
.containsExactlyInAnyOrder(
PostAcceptanceFixture.POST1.getPostRequest().getTitle(),
PostAcceptanceFixture.POST2.getPostRequest().getTitle()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Feature: 멤버 관련 기능
Scenario: 자신의 정보를 수정하기
Given "브라운"이 로그인을 하고
When 자신의 닉네임을 "brown"으로 수정하면
Then "브라운"의 닉네임이 "brown"으로 수정
Then "브라운"의 닉네임이 "brown"으로 수정
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@api
Feature: 스터디로그 오버뷰 기능

Background: 사전 작업
Given 레벨 여러개를 생성하고
And 미션 여러개를 생성하고
And "브라운"이 로그인을 하고

Scenario: 해당 유저의 태그 목록 조회하기
Given 포스트 여러개를 작성하고
When "브라운"의 태그 목록을 조회하면
Then 해당 유저의 태그 목록이 조회된다

Scenario: 해당 유저의 포스트 목록 월별로 조회하기
Given 포스트 여러개를 작성하고
When "브라운"의 이번 달 포스트 목록을 조회하면
Then 해당 유저의 포스트 목록이 조회된다
1 change: 1 addition & 0 deletions backend/src/documentation/adoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ include::profile.adoc[]
include::mission.adoc[]
include::tag.adoc[]
include::filter.adoc[]
include::studylogOverview.adoc[]
22 changes: 22 additions & 0 deletions backend/src/documentation/adoc/studylogOverview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[[studylogOverview]]
== 스터디로그 오버뷰

=== 멤버 태그 조회

==== Request

include::{snippets}/members/tags/http-request.adoc[]

==== Response

include::{snippets}/members/tags/http-response.adoc[]

=== 멤버 달력 포스트 조회

==== Request

include::{snippets}/members/calendar-studylogs/http-request.adoc[]

==== Response

include::{snippets}/members/calendar-studylogs/http-response.adoc[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package wooteco.prolog.docu;

import org.junit.jupiter.api.Test;
import org.springframework.http.MediaType;
import wooteco.prolog.Documentation;
import wooteco.prolog.GithubResponses;

public class StudyLogOverviewDocumentation extends Documentation {

@Test
void 유저의_태그를_조회한다() {
given("members/tags")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.when().get("/members/{username}/tags", GithubResponses.브라운.getLogin())
.then().log().all()
.extract();
}

@Test
void 유저의_달력_포스트를_조회한다() {
given("members/calendar-posts")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.when().get("/members/{username}/calendar-posts?year=2021&month=8", GithubResponses.브라운.getLogin())
.then().log().all()
.extract();
}
}
Loading

0 comments on commit c940b63

Please sign in to comment.