Skip to content

Commit

Permalink
Merge pull request #16 from Team-Never-Land/fix/alarm
Browse files Browse the repository at this point in the history
[FIX] 공지사항 OrderByPubDateDesc로 변경, 알림 문장 변경
  • Loading branch information
ibaesuyeon authored Oct 12, 2024
2 parents 05cc7d2 + da578e1 commit e99fa4a
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
public interface BiddingNoticeRepository extends JpaRepository<BiddingNotice, Long> {
@Query("SELECT n FROM BiddingNotice n WHERE n.title LIKE CONCAT('%', :keyword, '%')")
List<BiddingNotice> searchByTitle(@Param("keyword") String keyword);

Page<BiddingNotice> findAllByOrderByPubDateDesc(Pageable pageable);
BiddingNotice findOneById(Long noticeID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ public interface CareerNoticeRepository extends JpaRepository<CareerNotice, Long
List<CareerNotice> searchByTitle(@Param("keyword") String keyword);
CareerNotice findOneById(Long noticeID);
List<CareerNotice> findTop3ByOrderByPubDateDesc();

Page<CareerNotice> findAllByOrderByPubDateDesc(Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
public interface RevisionNoticeRepository extends JpaRepository<RevisionNotice, Long> {
@Query("SELECT n FROM RevisionNotice n WHERE n.title LIKE CONCAT('%', :keyword, '%')")
List<RevisionNotice> searchByTitle(@Param("keyword") String keyword);

Page<RevisionNotice> findAllByOrderByPubDateDesc(Pageable pageable);
RevisionNotice findOneById(Long noticeID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import depth.mvp.thinkerbell.domain.notice.entity.AcademicNotice;
import depth.mvp.thinkerbell.domain.notice.entity.ScholarshipNotice;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
Expand All @@ -14,6 +16,7 @@ public interface ScholarshipNoticeRepository extends JpaRepository<ScholarshipNo
@Query("SELECT n FROM ScholarshipNotice n WHERE n.title LIKE CONCAT('%', :keyword, '%')")
List<ScholarshipNotice> searchByTitle(@Param("keyword") String keyword);
ScholarshipNotice findOneById(Long noticeID);
Page<ScholarshipNotice> findAllByOrderByPubDateDesc(Pageable pageable);
List<ScholarshipNotice> findTop3ByOrderByPubDateDesc();

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package depth.mvp.thinkerbell.domain.notice.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import depth.mvp.thinkerbell.domain.notice.entity.StudentActsNotice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
Expand All @@ -13,5 +15,6 @@
public interface StudentActsNoticeRepository extends JpaRepository<StudentActsNotice, Long> {
@Query("SELECT n FROM StudentActsNotice n WHERE n.title LIKE CONCAT('%', :keyword, '%')")
List<StudentActsNotice> searchByTitle(@Param("keyword") String keyword);
Page<StudentActsNotice> findAllByOrderByPubDateDesc(Pageable pageable);
StudentActsNotice findOneById(Long noticeID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public BiddingNoticeService(BookmarkService bookmarkService, BiddingNoticeReposi

public PaginationDTO<BiddingNoticeDTO> getAllBiddingNotices(int page, int size, String ssaid) throws NotFoundException {
Pageable pageable = PageRequest.of(page, size);
Page<BiddingNotice> resultPage = biddingNoticeRepository.findAll(pageable);
Page<BiddingNotice> resultPage = biddingNoticeRepository.findAllByOrderByPubDateDesc(pageable);

List<Long> bookmarkedNoticeIds = bookmarkService.getBookmark(ssaid,
this.getClass().getSimpleName().replace("Service", ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public CareerNoticeService(BookmarkService bookmarkService, CareerNoticeReposito

public PaginationDTO<CareerNoticeDTO> getAllCareerNotices(int page, int size, String ssaid) throws NotFoundException {
Pageable pageable = PageRequest.of(page, size);
Page<CareerNotice> resultPage = careerNoticeRepository.findAll(pageable);
Page<CareerNotice> resultPage = careerNoticeRepository.findAllByOrderByPubDateDesc(pageable);

List<Long> bookmarkedNoticeIds = bookmarkService.getBookmark(ssaid,
this.getClass().getSimpleName().replace("Service", ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public RevisionNoticeService(BookmarkService bookmarkService, RevisionNoticeRepo

public PaginationDTO<RevisionNoticeDTO> getAllRevisionNotices(int page, int size, String ssaid) throws NotFoundException {
Pageable pageable = PageRequest.of(page, size);
Page<RevisionNotice> resultPage = revisionNoticeRepository.findAll(pageable);
Page<RevisionNotice> resultPage = revisionNoticeRepository.findAllByOrderByPubDateDesc(pageable);

List<Long> bookmarkedNoticeIds = bookmarkService.getBookmark(ssaid,
this.getClass().getSimpleName().replace("Service", ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ScholarshipNoticeService(BookmarkService bookmarkService, ScholarshipNoti

public PaginationDTO<ScholarshipNoticeDTO> getAllScholarshipNotices(int page, int size, String ssaid) throws NotFoundException {
Pageable pageable = PageRequest.of(page, size);
Page<ScholarshipNotice> resultPage = scholarshipNoticeRepository.findAll(pageable);
Page<ScholarshipNotice> resultPage = scholarshipNoticeRepository.findAllByOrderByPubDateDesc(pageable);

List<Long> bookmarkedNoticeIds = bookmarkService.getBookmark(ssaid,
this.getClass().getSimpleName().replace("Service", ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public StudentActsNoticeService(BookmarkService bookmarkService, StudentActsNoti

public PaginationDTO<StudentActsNoticeDTO> getAllStudentActsNotices(int page, int size, String ssaid) throws NotFoundException {
Pageable pageable = PageRequest.of(page, size);
Page<StudentActsNotice> resultPage = studentActsNoticeRepository.findAll(pageable);
Page<StudentActsNotice> resultPage = studentActsNoticeRepository.findAllByOrderByPubDateDesc(pageable);

List<Long> bookmarkedNoticeIds = bookmarkService.getBookmark(ssaid,
this.getClass().getSimpleName().replace("Service", ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void sendScheduleMessage(User user, String title) {
try{
String cutTitle = cutTitle(title, 40);

String messageBody = String.format("띵~🔔 즐겨찾기한 학사일정이(가) 시작됐어요!\n%s",
String messageBody = String.format("띵~🔔 즐겨찾기한 학사일정이 시작됐어요!\n%s",
cutTitle);

Message message = Message.builder()
Expand Down

0 comments on commit e99fa4a

Please sign in to comment.