문의 상태값 'REVIEWING' 추가:
- 상태 코드/배지 지원 로직(DjbInquiryStatus) 반영 - Inquiry 댓글 작성자명 관리자 구분 로직 수정
This commit is contained in:
@@ -25,7 +25,7 @@ public class InquiryDTO {
|
||||
@Size(max = 4000, message = "제목은 50자를 초과할 수 없습니다.")
|
||||
private String inquiryDetail;
|
||||
|
||||
@Pattern(regexp = "^(PENDING|RESPONDED|CLOSED)$", message = "유효하지 않은 문의 상태입니다.")
|
||||
@Pattern(regexp = "^(PENDING|REVIEWING|RESPONDED|CLOSED)$", message = "유효하지 않은 문의 상태입니다.")
|
||||
private String inquiryStatus;
|
||||
|
||||
private String inquirerName;
|
||||
|
||||
+9
-3
@@ -160,9 +160,15 @@ public class InquiryCommentFacadeImpl implements InquiryCommentFacade {
|
||||
&& writerId.equals(current.getId())
|
||||
&& entity.getInquiry() != null
|
||||
&& !DjbInquiryStatus.isClosed(entity.getInquiry().getInquiryStatus());
|
||||
String writerName = writerId != null ? writerNames.get(writerId) : null;
|
||||
if (writerName == null || writerName.isEmpty()) {
|
||||
writerName = "(알 수 없음)";
|
||||
String writerName;
|
||||
if ("Y".equals(entity.getAdminYn())) {
|
||||
// 관리자 댓글은 실명 대신 "관리자"로만 표기 (신원 비노출)
|
||||
writerName = "관리자";
|
||||
} else {
|
||||
writerName = writerId != null ? writerNames.get(writerId) : null;
|
||||
if (writerName == null || writerName.isEmpty()) {
|
||||
writerName = "(알 수 없음)";
|
||||
}
|
||||
}
|
||||
return InquiryCommentDTO.builder()
|
||||
.id(entity.getId())
|
||||
|
||||
+34
@@ -3,6 +3,7 @@ package com.eactive.apim.portal.djb.community.qna.constant;
|
||||
public final class DjbInquiryStatus {
|
||||
|
||||
public static final String PENDING = "PENDING";
|
||||
public static final String REVIEWING = "REVIEWING";
|
||||
public static final String RESPONDED = "RESPONDED";
|
||||
public static final String CLOSED = "CLOSED";
|
||||
|
||||
@@ -12,4 +13,37 @@ public final class DjbInquiryStatus {
|
||||
public static boolean isClosed(String status) {
|
||||
return CLOSED.equals(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 상태 코드에 대응하는 사용자 노출용 한글명을 반환한다.
|
||||
* (미매칭/null은 대기 상태로 간주)
|
||||
*/
|
||||
public static String displayName(String status) {
|
||||
if (RESPONDED.equals(status)) {
|
||||
return "답변완료";
|
||||
}
|
||||
if (CLOSED.equals(status)) {
|
||||
return "종료";
|
||||
}
|
||||
if (REVIEWING.equals(status)) {
|
||||
return "검토중";
|
||||
}
|
||||
return "답변대기"; // PENDING 및 기본값
|
||||
}
|
||||
|
||||
/**
|
||||
* 상태 코드에 대응하는 배지 CSS modifier 클래스를 반환한다.
|
||||
*/
|
||||
public static String badgeClass(String status) {
|
||||
if (RESPONDED.equals(status)) {
|
||||
return "inquiry-status-badge--completed";
|
||||
}
|
||||
if (CLOSED.equals(status)) {
|
||||
return "inquiry-status-badge--closed";
|
||||
}
|
||||
if (REVIEWING.equals(status)) {
|
||||
return "inquiry-status-badge--reviewing";
|
||||
}
|
||||
return "inquiry-status-badge--pending"; // PENDING 및 기본값
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16897,6 +16897,9 @@ input[type=checkbox]:checked + .custom-checkbox {
|
||||
.inquiry-status-badge--pending {
|
||||
background-color: #8c959f;
|
||||
}
|
||||
.inquiry-status-badge--reviewing {
|
||||
background-color: #e08e0b;
|
||||
}
|
||||
.inquiry-status-badge--closed {
|
||||
background-color: #4a5560;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -80,7 +80,6 @@
|
||||
+ '<div class="djb-comment-meta">'
|
||||
+ ' <div class="djb-comment-meta-left">'
|
||||
+ ' <span class="djb-comment-writer">' + escapeHtml(c.writerName || '(알 수 없음)') + '</span>'
|
||||
+ (c.adminYn === 'Y' ? ' <span class="djb-comment-admin-badge">관리자</span>' : '')
|
||||
+ ' </div>'
|
||||
+ ' <div class="djb-comment-meta-right">'
|
||||
+ ' <span class="djb-comment-date">' + escapeHtml(formatDate(c.createdDate)) + '</span>'
|
||||
|
||||
@@ -384,6 +384,11 @@
|
||||
background-color: #8c959f;
|
||||
}
|
||||
|
||||
// 검토중 - 주황색 배경
|
||||
&--reviewing {
|
||||
background-color: #e08e0b;
|
||||
}
|
||||
|
||||
// 종료 - 짙은 회색 배경
|
||||
&--closed {
|
||||
background-color: #4a5560;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<div class="inquiry-detail-header">
|
||||
<div class="inquiry-header-top">
|
||||
<span class="inquiry-status-badge"
|
||||
th:classappend="${inquiry.inquiryStatus == 'RESPONDED' ? 'inquiry-status-badge--completed' : (inquiry.inquiryStatus == 'CLOSED' ? 'inquiry-status-badge--closed' : 'inquiry-status-badge--pending')}"
|
||||
th:text="${inquiry.inquiryStatus == 'RESPONDED' ? '답변완료' : (inquiry.inquiryStatus == 'CLOSED' ? '종료' : '답변대기')}">
|
||||
th:classappend="${T(com.eactive.apim.portal.djb.community.qna.constant.DjbInquiryStatus).badgeClass(inquiry.inquiryStatus)}"
|
||||
th:text="${T(com.eactive.apim.portal.djb.community.qna.constant.DjbInquiryStatus).displayName(inquiry.inquiryStatus)}">
|
||||
답변대기
|
||||
</span>
|
||||
<div class="inquiry-header-right">
|
||||
|
||||
@@ -70,8 +70,8 @@
|
||||
<div class="row-cell" style="width: 100px;" data-label="작성자" th:text="${inquiry.maskedInquirerName}">홍**</div>
|
||||
<div class="row-cell" style="width: 120px;" data-label="처리상태">
|
||||
<span class="inquiry-status-badge"
|
||||
th:classappend="${inquiry.inquiryStatus == 'RESPONDED' ? 'inquiry-status-badge--completed' : (inquiry.inquiryStatus == 'CLOSED' ? 'inquiry-status-badge--closed' : 'inquiry-status-badge--pending')}"
|
||||
th:text="${inquiry.inquiryStatus == 'RESPONDED' ? '답변완료' : (inquiry.inquiryStatus == 'CLOSED' ? '종료' : '답변대기')}">
|
||||
th:classappend="${T(com.eactive.apim.portal.djb.community.qna.constant.DjbInquiryStatus).badgeClass(inquiry.inquiryStatus)}"
|
||||
th:text="${T(com.eactive.apim.portal.djb.community.qna.constant.DjbInquiryStatus).displayName(inquiry.inquiryStatus)}">
|
||||
답변대기
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user