@@ -21,4 +21,12 @@ public class ReplyController {
|
||||
replyService.enrollReply(dto);
|
||||
}
|
||||
|
||||
/* 댓글 체크 */
|
||||
/* memberId, bookId 파라미터 */
|
||||
/* 존재 : 1 / 존재x : 0 */
|
||||
@PostMapping("/check")
|
||||
public String replyCheckPOST(ReplyDTO dto) {
|
||||
return replyService.checkReply(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,4 +7,7 @@ public interface ReplyMapper {
|
||||
/* 댓글 등록 */
|
||||
public int enrollReply(ReplyDTO dto);
|
||||
|
||||
/* 댓글 존재 체크 */
|
||||
public Integer checkReply(ReplyDTO dto);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ import com.vam.model.ReplyDTO;
|
||||
public interface ReplyService {
|
||||
|
||||
/* 댓글 등록 */
|
||||
public int enrollReply(ReplyDTO dto);
|
||||
public int enrollReply(ReplyDTO dto);
|
||||
|
||||
/* 댓글 존재 체크 */
|
||||
public String checkReply(ReplyDTO dto);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,4 +21,20 @@ public class ReplyServiceImpl implements ReplyService{
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* 댓글 존재 체크 */
|
||||
@Override
|
||||
public String checkReply(ReplyDTO dto) {
|
||||
|
||||
Integer result = replyMapper.checkReply(dto);
|
||||
|
||||
if(result == null) {
|
||||
return "0";
|
||||
} else {
|
||||
return "1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,5 +10,12 @@
|
||||
insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating})
|
||||
|
||||
</insert>
|
||||
|
||||
<select id="checkReply" resultType="integer">
|
||||
|
||||
select replyId from vam_reply
|
||||
where memberId = #{memberId} and bookId = #{bookId}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -10,5 +10,12 @@
|
||||
insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating})
|
||||
|
||||
</insert>
|
||||
|
||||
<select id="checkReply" resultType="integer">
|
||||
|
||||
select replyId from vam_reply
|
||||
where memberId = #{memberId} and bookId = #{bookId}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Mon Jan 03 13:38:26 KST 2022
|
||||
#Fri Jan 07 17:32:29 KST 2022
|
||||
m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project2\\VamPa
|
||||
m2e.projectName=VamPa
|
||||
groupId=com.vam
|
||||
|
||||
@@ -21,4 +21,12 @@ public class ReplyController {
|
||||
replyService.enrollReply(dto);
|
||||
}
|
||||
|
||||
/* 댓글 체크 */
|
||||
/* memberId, bookId 파라미터 */
|
||||
/* 존재 : 1 / 존재x : 0 */
|
||||
@PostMapping("/check")
|
||||
public String replyCheckPOST(ReplyDTO dto) {
|
||||
return replyService.checkReply(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,5 +6,8 @@ public interface ReplyMapper {
|
||||
|
||||
/* 댓글 등록 */
|
||||
public int enrollReply(ReplyDTO dto);
|
||||
|
||||
/* 댓글 존재 체크 */
|
||||
public Integer checkReply(ReplyDTO dto);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,5 +6,8 @@ public interface ReplyService {
|
||||
|
||||
/* 댓글 등록 */
|
||||
public int enrollReply(ReplyDTO dto);
|
||||
|
||||
/* 댓글 존재 체크 */
|
||||
public String checkReply(ReplyDTO dto);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,4 +21,18 @@ public class ReplyServiceImpl implements ReplyService{
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 댓글 존재 체크 */
|
||||
@Override
|
||||
public String checkReply(ReplyDTO dto) {
|
||||
|
||||
Integer result = replyMapper.checkReply(dto);
|
||||
|
||||
if(result == null) {
|
||||
return "0";
|
||||
} else {
|
||||
return "1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,5 +10,12 @@
|
||||
insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating})
|
||||
|
||||
</insert>
|
||||
|
||||
<select id="checkReply" resultType="integer">
|
||||
|
||||
select replyId from vam_reply
|
||||
where memberId = #{memberId} and bookId = #{bookId}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -10,5 +10,12 @@
|
||||
insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating})
|
||||
|
||||
</insert>
|
||||
|
||||
<select id="checkReply" resultType="integer">
|
||||
|
||||
select replyId from vam_reply
|
||||
where memberId = #{memberId} and bookId = #{bookId}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Mon Jan 03 13:38:26 KST 2022
|
||||
#Fri Jan 07 17:32:30 KST 2022
|
||||
m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project2\\VamPa_MySQL
|
||||
m2e.projectName=VamPa_MySQL
|
||||
groupId=com.vam
|
||||
|
||||
Reference in New Issue
Block a user