- 공개범위 설정 기능 개발(ALL/ORG/PRIVATE) - 게시물/댓글 정교화 - 요청 및 DB 처리 확장 - UI, DTO, Service 계층 업데이트 - 감사 로그 및 조회수 처리 로직 추가
This commit is contained in:
@@ -37,4 +37,7 @@ public class PortalInquiryCommentUI {
|
||||
@DateTimeFormat(pattern = "yyyyMMddHHmmss")
|
||||
private LocalDateTime lastModifiedDate;
|
||||
|
||||
/** 공개범위(ALL=공개/PRIVATE=비공개). */
|
||||
private String visibility;
|
||||
|
||||
}
|
||||
|
||||
+13
@@ -92,4 +92,17 @@ public class PortalInquiryManController extends BaseAnnotationController {
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
// 공개범위 변경 — 감사 로그는 AuditLogInterceptor 가 자동 기록(auditpoints.dat 등록, auditReason 파라미터)
|
||||
@PostMapping(value = "/onl/apim/portalinquiry/portalInquiryMan.json", params = "cmd=VISIBILITY")
|
||||
public ResponseEntity<String> updateVisibility(String targetType, String id, String visibility, String auditReason) {
|
||||
portalInquiryManService.updateVisibility(targetType, id, visibility, auditReason);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/portalinquiry/portalInquiryMan.json", params = "cmd=INCREMENT_VIEW")
|
||||
public ResponseEntity<Void> incrementView(String id) {
|
||||
portalInquiryManService.incrementViewCount(id);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
||||
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||
import com.eactive.apim.portal.qna.entity.Inquiry;
|
||||
import com.eactive.apim.portal.qna.entity.InquiryComment;
|
||||
import com.eactive.apim.portal.qna.entity.VisibilityScope;
|
||||
import com.eactive.apim.portal.user.entity.UserInfo;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.common.exception.IntegrationException;
|
||||
@@ -44,6 +45,7 @@ public class PortalInquiryManService extends BaseService {
|
||||
public static final String REVIEWING = "REVIEWING";
|
||||
public static final String RESPONDED = "RESPONDED";
|
||||
public static final String CLOSED = "CLOSED";
|
||||
public static final String TARGET_COMMENT = "COMMENT";
|
||||
|
||||
|
||||
public PortalInquiryManService(PortalInquiryService portalInquiryService,
|
||||
@@ -235,4 +237,41 @@ public class PortalInquiryManService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
/** 조회수 증가 (JSP sessionStorage dedup 통과 시 호출). 관리자는 공개범위 무관 전체 접근. */
|
||||
public void incrementViewCount(String id) {
|
||||
Inquiry inquiry = portalInquiryService.getById(id);
|
||||
inquiry.increaseViewCount();
|
||||
portalInquiryService.save(inquiry);
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시물/댓글 공개범위 변경. 사유(reason) 필수.
|
||||
* 변경 이력은 eapim-admin 공통 감사 로그(AuditLogInterceptor)가 자동 기록한다
|
||||
* (auditpoints.dat 의 PortalInquiryManController_..._VISIBILITY, serviceType=APIGW, auditReason 파라미터).
|
||||
*
|
||||
* @param targetType INQUIRY 또는 COMMENT
|
||||
* @param id 대상 게시물/댓글 ID
|
||||
* @param newVisibility 변경할 공개범위(ALL/ORG/PRIVATE)
|
||||
* @param reason 변경 사유(필수)
|
||||
*/
|
||||
public void updateVisibility(String targetType, String id, String newVisibility, String reason) {
|
||||
if (StringUtils.isBlank(reason)) {
|
||||
throw new IntegrationException("공개범위 변경 사유를 입력해주세요.");
|
||||
}
|
||||
VisibilityScope newScope = VisibilityScope.fromString(newVisibility, null);
|
||||
if (newScope == null) {
|
||||
throw new IntegrationException("유효하지 않은 공개범위입니다.");
|
||||
}
|
||||
|
||||
if (TARGET_COMMENT.equalsIgnoreCase(targetType)) {
|
||||
InquiryComment comment = portalInquiryCommentService.getById(id);
|
||||
comment.setVisibility(newScope);
|
||||
portalInquiryCommentService.save(comment);
|
||||
} else {
|
||||
Inquiry inquiry = portalInquiryService.getById(id);
|
||||
inquiry.setVisibility(newScope);
|
||||
portalInquiryService.save(inquiry);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,4 +57,10 @@ public class PortalInquiryUI {
|
||||
private String orgName;
|
||||
|
||||
private int commentCount;
|
||||
|
||||
/** 공개범위(ALL/ORG/PRIVATE). */
|
||||
private String visibility;
|
||||
|
||||
/** 조회수. */
|
||||
private long viewCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user