Description
다음과 같은 상황이 발생할 때 당사자에게 알림이 가도록 만든다.
- 유저 작성 게시글에 댓글이 달릴 경우
- 유저 작성 댓글에 대댓글이 달릴 경우
- 타유저가 유저를 팔로할 경우
- 유저가 뱃지를 획득했을 경우
Progress
알림 생성 및 저장
<insert id="insert" parameterType="notification">
insert into noti(type, cno, fwer_no, bno, uno)
values(#{type}, #{comment.no}, #{follower.no}, #{badge.no},
<choose>
<when test="comment == null">
#{userNo}
</when>
<otherwise>
<if test="type==1">
(select a.writer from comment c inner join article a on a.arno = c.arno where c.cno = #{comment.no})
</if>
<if test="type==2">
(select c.uno from comment c inner join comment c2 on c.momno = c2.cno where c.cno = #{comment.no})
</if>
</otherwise>
</choose>
)
</insert>
알림 목록 출력
Trouble Shooting
DB 구조 변경
기존 DB 알림 테이블의 컬럼은 다음과 같았다. 그

Comment가 달린 게시글/댓글 작성자 찾는 문제
현재 시간으로부터 얼마나 지났는지 정보 출력
기존 코드
Description
다음과 같은 상황이 발생할 때 당사자에게 알림이 가도록 만든다.
Progress
Notification관련 Doman, Controller, Service, Dao, Mapper 파일을 만든다.알림 생성 및 저장
CommentService:add()FollowService:add()CollectService:add()알림 목록 출력
NotificatinoDao.findAll(),NotiifcationService.list()NotificationController.list()Trouble Shooting
DB 구조 변경
기존 DB 알림 테이블의 컬럼은 다음과 같았다. 그

Comment가 달린 게시글/댓글 작성자 찾는 문제
현재 시간으로부터 얼마나 지났는지 정보 출력
기존 코드