6 Commits

Author SHA1 Message Date
Rinjae c8049dd881 Merge remote-tracking branch 'origin/master'
eapim-portal CI (from elink-portal-common) / build (push) Waiting to run
2026-07-13 14:25:16 +09:00
Rinjae 2e2ac8f462 API 그룹 팝업 JSP 파일 추가 - 예제 코드 및 UI 구조 작성
Summernote 에디터 스타일 CSS 추가 - 텍스트 및 컴포넌트 스타일 정의
OpenAPI POC JS 파일 추가 - API 스펙 빌더 및 스텝별 렌더 구현
2026-07-13 14:25:09 +09:00
eastargh f3a9e19b89 Merge branch 'master' of https://git.eactive.synology.me:8090/eapim/djbank/elink-portal-common.git
eapim-portal CI (from elink-portal-common) / build (push) Waiting to run
2026-07-13 13:21:57 +09:00
eastargh b5866b087d ums 설정 변경 2026-07-13 13:21:30 +09:00
Rinjae 6f00de61d9 Q&A 문의 공개범위 기능 추가
eapim-portal CI (from elink-portal-common) / build (push) Waiting to run
- 공개범위 설정 기능 개발(ALL/ORG/PRIVATE) - 게시물/댓글 정교화
- 요청 및 DB 처리 확장 - UI, DTO, Service 계층 업데이트
- 감사 로그 및 조회수 처리 로직 추가
2026-07-13 11:32:34 +09:00
Rinjae e5d0acf694 PortalPropertyRepository 중복 키 조회 메서드 추가 - 무결성 점검용
eapim-portal CI (from elink-portal-common) / build (push) Has been cancelled
2026-07-06 19:45:52 +09:00
6 changed files with 131 additions and 7 deletions
@@ -4,8 +4,23 @@ import com.eactive.apim.portal.portalproperty.entity.PortalProperty;
import com.eactive.apim.portal.portalproperty.entity.PortalPropertyId;
import com.eactive.eai.data.jpa.BaseRepository;
import com.eactive.eai.rms.data.EMSDataSource;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
@EMSDataSource
public interface PortalPropertyRepository extends BaseRepository<PortalProperty, PortalPropertyId> {
/**
* (PROPERTY_GROUP_NAME, PROPERTY_NAME) 조합이 2건 이상인 중복 키를 조회한다.
* DB에 유니크 제약을 걸지 않으므로 기동 시 무결성 점검용으로 사용한다.
*
* @return {@code Object[]{propertyGroupName, propertyName, count}} 목록 (중복 없으면 빈 리스트)
*/
@Query("SELECT p.id.propertyGroupName, p.id.propertyName, COUNT(p) "
+ "FROM PortalProperty p "
+ "GROUP BY p.id.propertyGroupName, p.id.propertyName "
+ "HAVING COUNT(p) > 1")
List<Object[]> findDuplicatePropertyKeys();
}
@@ -51,13 +51,24 @@ public class PortalPropertyService extends AbstractDataService<PortalPropertyGro
Optional<PortalProperty> existingProperty = portalPropertyRepository.findById(propertyId);
if (existingProperty.isPresent()) {
return existingProperty.get().getPropertyValue();
PortalProperty property = existingProperty.get();
// 설명(property_desc)이 비어 있으면 코드가 넘긴 description 으로 채운다.
// (값이 있으면 관리자 편집분 보존 — 덮어쓰지 않음)
if (isBlank(property.getPropertyDesc()) && !isBlank(description)) {
property.setPropertyDesc(description);
portalPropertyRepository.save(property);
}
return property.getPropertyValue();
}
// 프로퍼티가 없으면 기본값으로 생성
return createDefaultProperty(groupName, propertyName, defaultValue, description);
}
private static boolean isBlank(String s) {
return s == null || s.trim().isEmpty();
}
/**
* 기본 프로퍼티를 DB에 생성
*/
@@ -86,4 +86,23 @@ public class Inquiry extends Auditable {
@Column(name = "ATTACH_FILE")
private String attachFile;
/**
* 공개범위 (전체공개/법인공개/비공개). 기본값 ORG.
* PTL_PROPERTY 기관 기본값이 상한(ceiling)이며 읽기/쓰기 시 clamp 된다.
*/
@Enumerated(EnumType.STRING)
@Column(name = "VISIBILITY", length = 16)
private VisibilityScope visibility = VisibilityScope.ORG;
/**
* 조회수. sessionStorage 기반 dedup 후 POST 요청으로만 증가한다.
*/
@Column(name = "VIEW_COUNT")
private long viewCount = 0L;
/** 조회수 1 증가. */
public void increaseViewCount() {
this.viewCount++;
}
}
@@ -36,6 +36,18 @@ public class InquiryComment extends Auditable implements Serializable {
@Column(name = "ADMIN_YN", length = 1)
private String adminYn = "N";
/**
* 댓글 공개범위. 개념상 공개(ALL)/비공개(PRIVATE) 2단계.
* 비공개 댓글은 작성자·같은 법인 corp-manager·관리자만 열람 가능.
*/
@Enumerated(EnumType.STRING)
@Column(name = "VISIBILITY", length = 16)
private VisibilityScope visibility = VisibilityScope.ALL;
public boolean isPrivate() {
return this.visibility == VisibilityScope.PRIVATE;
}
public void markDeleted() {
this.delYn = "Y";
}
@@ -0,0 +1,67 @@
package com.eactive.apim.portal.qna.entity;
/**
* 문의(Q&amp;A) 게시물/댓글의 공개범위.
*
* <p>{@code width}는 공개 범위의 넓이 랭크로, 값이 클수록 더 넓게 공개된다.
* {@code PTL_PROPERTY}에 설정된 기관 기본값이 상한(ceiling)이 되며, 게시물이 상한보다
* 넓게 설정될 수 없다({@link #clampTo}). property가 항상 우선한다.</p>
*
* <ul>
* <li>{@code ALL} : 전체 로그인 사용자 공개</li>
* <li>{@code ORG} : 같은 법인 소속 사용자 공개 (게시물 기본값)</li>
* <li>{@code PRIVATE} : 작성자 본인만 (댓글의 "비공개")</li>
* </ul>
*/
public enum VisibilityScope {
ALL(3, "전체공개"),
ORG(2, "법인공개"),
PRIVATE(1, "비공개");
private final int width;
private final String label;
VisibilityScope(int width, String label) {
this.width = width;
this.label = label;
}
/** 공개 범위 넓이 랭크. 클수록 넓게 공개. */
public int width() {
return width;
}
/** 화면 표기용 한글 라벨. */
public String label() {
return label;
}
/**
* 문자열을 enum으로 안전 변환. null/빈값/미해당은 defaultScope 반환.
*/
public static VisibilityScope fromString(String value, VisibilityScope defaultScope) {
if (value == null || value.trim().isEmpty()) {
return defaultScope;
}
try {
return VisibilityScope.valueOf(value.trim().toUpperCase());
} catch (IllegalArgumentException e) {
return defaultScope;
}
}
/**
* 요청 공개범위를 상한으로 clamp 한다. 요청이 상한보다 넓으면 상한으로 낮춘다.
* (property가 항상 우선하므로, 저장값이 옛 상한이라 더 넓더라도 읽기 시 재-clamp 한다.)
*/
public static VisibilityScope clampTo(VisibilityScope requested, VisibilityScope ceiling) {
if (requested == null) {
return ceiling;
}
if (ceiling == null) {
return requested;
}
return requested.width() > ceiling.width() ? ceiling : requested;
}
}
@@ -78,7 +78,7 @@ public class MessageSendService {
String subject = buildMessage(template.getSubjectTemplate(), messageParams);
if (template.getEnableSms().equalsIgnoreCase("Y")) {
String smsEaiInterfaceId = portalProperties.get("ums.sms.if_id");
String smsEaiInterfaceId = portalProperties.get("djb.ums.sms.if_id");
MessageRequest smsRequest = new MessageRequest();
smsRequest.setMessageCode(MessageCode.valueOf(template.getMessageCode().toUpperCase()));
smsRequest.setSubject(subject);
@@ -88,7 +88,7 @@ public class MessageSendService {
smsRequest.setUsername(user.getUsername());
smsRequest.setPhone(user.getPhone());
smsRequest.setEaiInterfaceId(smsEaiInterfaceId);
smsRequest.setServiceId(portalProperties.get("ums.sms.tx_id"));
smsRequest.setServiceId(portalProperties.get("djb.ums.sms.tx_id"));
smsRequest.setUserId(user.getUserId());
if ("ADMIN_VERIFICATION_MOBILEPHONE".equals(template.getMessageCode().toUpperCase())) {
smsRequest.setMessageType("KAKAO");
@@ -100,7 +100,7 @@ public class MessageSendService {
}
if (template.getEnableEmail().equalsIgnoreCase("Y")) {
String mailEaiInterfaceId = portalProperties.get("ums.email.if_id");
String mailEaiInterfaceId = portalProperties.get("djb.ums.email.if_id");
MessageRequest emailRequest = new MessageRequest();
emailRequest.setMessageCode(MessageCode.valueOf(template.getMessageCode().toUpperCase()));
emailRequest.setSubject(subject);
@@ -110,7 +110,7 @@ public class MessageSendService {
emailRequest.setUsername(user.getUsername());
emailRequest.setEmail(user.getUserId());
emailRequest.setEaiInterfaceId(mailEaiInterfaceId);
emailRequest.setServiceId(portalProperties.get("ums.email.tx_id"));
emailRequest.setServiceId(portalProperties.get("djb.ums.email.tx_id"));
emailRequest.setMessageType("EMAIL");
emailRequest.setUserId(user.getUserId());
messageRequestRepository.save(emailRequest);
@@ -118,7 +118,7 @@ public class MessageSendService {
}
if (template.getEnableMessenger().equalsIgnoreCase("Y")) {
String swingEaiInterfaceId = portalProperties.get("ums.messenger.if_id");
String swingEaiInterfaceId = portalProperties.get("djb.ums.messenger.if_id");
MessageRequest messengerRequest = new MessageRequest();
messengerRequest.setMessageCode(MessageCode.valueOf(template.getMessageCode()));
messengerRequest.setSubject(subject);
@@ -128,7 +128,7 @@ public class MessageSendService {
messengerRequest.setUsername(user.getUsername());
messengerRequest.setMessengerId(user.getUserId());
messengerRequest.setEaiInterfaceId(swingEaiInterfaceId);
messengerRequest.setServiceId(portalProperties.get("ums.messenger.tx_id"));
messengerRequest.setServiceId(portalProperties.get("djb.ums.messenger.tx_id"));
messengerRequest.setMessageType("MESSENGER");
messengerRequest.setUserId(user.getUserId());
messageRequestRepository.save(messengerRequest);