본문 바로가기

스프링과 JPA 기반 웹 어플리케이션 개발85

77. 모임 관련 알림 스터디 수정 추가 알림 새 모임 추가 모임 변경 모임 취소 모임 참가 신청 참가 신청 수락 참가 신청 거절 새 모임 추가, 모임 변경, 모임 취소시 알림 이벤트를 발생시키기 위해 EventService에서 이벤트 추가 package me.weekbelt.studyolle.modules.event; @Service @Transactional @RequiredArgsConstructor public class EventService { // ...... private final ApplicationEventPublisher eventPublisher; // 추가 public Event createEvent(Event event, Study study, Account account) { event.setCre.. 2020. 5. 12.
76. 관심있는 스터디 변경 알림 참여중인 스터디 변경 사항에 대한 알림 스터디 소개가 수정 했을때 스터디 종료시 스터디 팀원 모집 시작 / 중지 스터디 소개가 수정했을때 알림을 발생시키기 위해 스터디 소개 수정, 스터디 종료, 스터디 팀원 모집, 모집 중단 시에 이벤트를 추가합니다. package me.weekbelt.studyolle.modules.study; @RequiredArgsConstructor @Transactional @Service public class StudyService { // ....... public void updateStudyDescription(Study study, StudyDescriptionForm studyDescriptionForm) { modelMapper.map(studyDescriptio.. 2020. 5. 12.
75. 알림 목록 조회 및 삭게 GET "/notifications" 읽지 않은 알림 메시지만 보여준다. 알림 메시지를 카테고리 별로 나눠서 Model에 담아주고 뷰에서 보여준다. 모든 읽지 않은 알림 메시지를 읽은 메시지로 수정한다. GET "/notifications/old" 읽은 알림 메시지를 보여준다. DELETE "/notifications" 읽은 알림 메시지를 삭제한다. GET "/notifications", "/notifications/old", DELETE "/notifications" 핸들러 작성 package me.weekbelt.studyolle.modules.notification; @RequiredArgsConstructor @Controller public class NotificationsController .. 2020. 5. 12.
74. 스터디 알림 아이콘 변경 읽지 않은 알림이 있는 경우 메인 네비게이션 바의 알림 아이콘을 색이 있는 아이콘으로 변경한다.. 핸들러 처리 이후, 뷰 랜더링 전에 스프링 웹 MVC HandlerInterceptor로 읽지 않은 메시지가 있는지 Model에 담아준다. https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/HandlerInterceptor.html HandlerInterceptor (Spring Framework 5.2.6.RELEASE API) Intercept the execution of a handler. Called after HandlerMapping determined an appropriate handle.. 2020. 5. 12.