Skip to content

Commit

Permalink
데벨업 v2.0.3 Release (#670)
Browse files Browse the repository at this point in the history
* 풀이 태그 버그 해결 (issue #661) (#663)

* fix: 미션 태그 버그 해결

* refactor: 사용하지 않는 코드 제거

* 런칭 직전 QA 이후 수정사항 반영 (#664)

* fix: 풀이 본문 마크다운 설정 및 카드 overflow ellipsis 적용

* fix: 미션 시작하기 클릭 시 모달이 뜨지 않도록 수정

---------

Co-authored-by: JEON TAEHEON <[email protected]>

* fix: 솔루션 전체 조회를 제출 일자 역순으로 하도록 수정 (#667)

* refactor: 토큰 만료 일자 연장 (#669)

---------

Co-authored-by: Minji <[email protected]>
Co-authored-by: 박한영(Ryan) <[email protected]>
Co-authored-by: JEON TAEHEON <[email protected]>
  • Loading branch information
4 people authored Oct 12, 2024
1 parent 52b7bc4 commit 1796cee
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/secrets
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public List<Solution> findAllCompletedSolutionByHashTagName(String missionTitle,
.join(mission.missionHashTags.hashTags, missionHashTag).fetchJoin()
.join(missionHashTag.hashTag).fetchJoin()
.where(eqCompleted(), eqMissionTitle(missionTitle), eqHashTagName(hashTagName))
.orderBy(solution.id.desc())
.orderBy(solution.submittedAt.desc())
.fetch();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
Expand Down Expand Up @@ -46,6 +47,35 @@ public class SolutionRepositoryCustomTest extends IntegrationTestSupport {
@Autowired
private HashTagRepository hashTagRepository;

@Test
@DisplayName("솔루션을 제출일자 역순으로 조회할 수 있다.")
void findAllCompletedSolutionByHashTagOrderBySubmittedAtDesc() {
Member member = memberRepository.save(MemberTestData.defaultMember().build());
HashTag hashTag = hashTagRepository.save(HashTagTestData.defaultHashTag().withName("JAVA").build());
Mission mission1 = missionRepository.save(MissionTestData.defaultMission().withHashTags(List.of(hashTag)).build());
Mission mission2 = missionRepository.save(MissionTestData.defaultMission().withHashTags(List.of(hashTag)).build());
Solution solution1 = SolutionTestData.defaultSolution()
.withMember(member)
.withMission(mission1)
.withStatus(SolutionStatus.COMPLETED)
.withSubmittedAt(LocalDateTime.of(2024, 1, 1, 0, 0))
.build();
Solution solution2 = SolutionTestData.defaultSolution()
.withMember(member)
.withMission(mission2)
.withStatus(SolutionStatus.COMPLETED)
.withSubmittedAt(LocalDateTime.of(2024, 1, 2, 0, 0))
.build();

solutionRepository.saveAll(List.of(solution1, solution2));

List<Solution> solutions = solutionRepositoryCustom.findAllCompletedSolutionByHashTagName("all", "all");

assertThat(solutions)
.map(Solution::getId)
.containsExactly(solution2.getId(), solution1.getId());
}

@Test
@DisplayName("주어진 해시태그가 포함된 완료된 솔루션을 조회할 수 있다.")
void findAllCompletedSolutionByHashTag() {
Expand Down

0 comments on commit 1796cee

Please sign in to comment.