Merge remote-tracking branch 'origin/jihee' into main

This commit is contained in:
dyhj625 2025-02-27 13:16:25 +09:00
commit 1345a5ce0b
2 changed files with 9 additions and 0 deletions

View File

@ -203,6 +203,7 @@ public class BoardController {
@ParameterCheck
@PostMapping("/{LOCBRDSEQ}/comment")
public ApiResponse<String> addCommentOrReply(@ReqMap MapDto map) {
if (map.containsKey("LOCCMTPWD") && !map.getString("LOCCMTPWD").trim().isEmpty()) { // 체크
String rawPassword = map.getString("LOCCMTPWD");
String hashedPassword = passwordEncoder.encode(rawPassword);

View File

@ -135,6 +135,7 @@ public class localbordService {
}
public void insertCommentOrReply(MapDto map) {
// 익명게시판이면 회원 정보를 null로 설정
if ("300102".equals(String.valueOf(map.get("LOCBRDTYP")))) {
map.put("MEMBERSEQ", null);
@ -144,9 +145,16 @@ public class localbordService {
}
if (map.get("LOCCMTPNT") == null) {
map.put("LOCCMTPNT", null);
if ("300102".equals(String.valueOf(map.get("LOCBRDTYP")))) {
map.put("MEMBERSEQ", null);
}else {
Long userId = AuthUtil.getUser().getId();
map.put("MEMBERSEQ", userId);
}
boardMapper.insertCommentOrReply(map);
}
}
public void updateComment(MapDto map) {
boardMapper.updateComment(map);