This commit is contained in:
common 2025-02-24 15:05:25 +09:00
commit ca947c62bb
3 changed files with 8 additions and 4 deletions

View File

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

View File

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

View File

@ -23,7 +23,7 @@
<!-- 사용자가 사용한 연차 목록 조회 --> <!-- 사용자가 사용한 연차 목록 조회 -->
<select id="selectUsedVacations" resultType="io.company.localhost.common.dto.MapDto"> <select id="selectUsedVacations" resultType="io.company.localhost.common.dto.MapDto">
SELECT LOCVACUDT AS date, LOCVACTYP AS type, LOCVACRMM AS receiverId, SELECT LOCVACSEQ AS id, LOCVACUDT AS date, LOCVACTYP AS type, LOCVACRMM AS receiverId,
-- 반차(700101, 700102)는 0.5, 연차(700103)는 1로 계산 -- 반차(700101, 700102)는 0.5, 연차(700103)는 1로 계산
SUM(CASE SUM(CASE
WHEN LOCVACTYP IN ('700101', '700102') THEN 0.5 WHEN LOCVACTYP IN ('700101', '700102') THEN 0.5