Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca44e8a967 | |||
| ce3efa299e |
+12
-1
@@ -51,13 +51,24 @@ public class PortalPropertyService extends AbstractDataService<PortalPropertyGro
|
|||||||
Optional<PortalProperty> existingProperty = portalPropertyRepository.findById(propertyId);
|
Optional<PortalProperty> existingProperty = portalPropertyRepository.findById(propertyId);
|
||||||
|
|
||||||
if (existingProperty.isPresent()) {
|
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);
|
return createDefaultProperty(groupName, propertyName, defaultValue, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isBlank(String s) {
|
||||||
|
return s == null || s.trim().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 기본 프로퍼티를 DB에 생성
|
* 기본 프로퍼티를 DB에 생성
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ public enum MessageCode {
|
|||||||
@Getter
|
@Getter
|
||||||
private final String serviceId;
|
private final String serviceId;
|
||||||
@Getter
|
@Getter
|
||||||
private final int channels;
|
@Deprecated // 삭제 예정
|
||||||
|
private int channels = 0;
|
||||||
|
|
||||||
|
|
||||||
public static Optional<MessageCode> findServiceId(String code) {
|
public static Optional<MessageCode> findServiceId(String code) {
|
||||||
@@ -72,6 +73,11 @@ public enum MessageCode {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MessageCode(String description, String serviceId) {
|
||||||
|
this.description = description;
|
||||||
|
this.serviceId = serviceId;
|
||||||
|
// this.channels = channel.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
MessageCode(String description, String serviceId, Channels channel) {
|
MessageCode(String description, String serviceId, Channels channel) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
|||||||
Reference in New Issue
Block a user