File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/main/java/hs/kr/backend/devpals/domain/project Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 99import java .util .List ;
1010
1111public interface ProjectRepository extends JpaRepository <ProjectEntity , Long > {
12- List <ProjectEntity > findAll ();
12+ List <ProjectEntity > findAllByOrderByCreatedAtDesc ();
1313
1414 @ Query ("SELECT p FROM ProjectEntity p WHERE p.recruitmentEndDate = :tomorrow AND p.isDone = false" )
1515 List <ProjectEntity > findProjectsEndingTomorrow (@ Param ("tomorrow" ) LocalDate tomorrow );
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public class ProjectService {
4747 @ Qualifier ("emailExecutor" )
4848 private final Executor emailExecutor ;
4949
50- private final Map <Long , ProjectAllDto > projectAllCache = new HashMap <>();
50+ private final Map <Long , ProjectAllDto > projectAllCache = new LinkedHashMap <>();
5151
5252 // 프로젝트 목록 조회
5353 @ Transactional
@@ -57,7 +57,7 @@ public ResponseEntity<ApiResponse<ProjectListResponse>> getProjectAll(
5757 String keyword , int page ) {
5858
5959 if (projectAllCache .isEmpty ()) {
60- List <ProjectEntity > projects = projectRepository .findAll ();
60+ List <ProjectEntity > projects = projectRepository .findAllByOrderByCreatedAtDesc ();
6161 projects .forEach (project -> {
6262 if (!projectAllCache .containsKey (project .getId ())) {
6363 projectAllCache .put (project .getId (), convertToDto (project ));
You can’t perform that action at this time.
0 commit comments