first commit
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package com.kri.notihub.server.dto.template;
|
||||
|
||||
import com.kri.notihub.server.common.enums.SendType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TemplateBasicDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "템플릿 타입")
|
||||
public SendType tmplatTy;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotBlank
|
||||
@Schema(description = "템플릿 명")
|
||||
public String tmplatNm;
|
||||
|
||||
@Size(max = 128)
|
||||
@Schema(description = "발송시 제목")
|
||||
public String tmplatTitle;
|
||||
|
||||
@NotBlank
|
||||
@Schema(description = "발송 내용")
|
||||
public String tmplatBody;
|
||||
|
||||
@Schema(description = "이메일 건당 발송 딜레이(단위 ms, 기본: 500ms)")
|
||||
public Short delayTime ;
|
||||
|
||||
@Size(max = 16)
|
||||
@Schema(description = "발송 전화번호(문자 발송에서 사용)")
|
||||
public String sendTel;
|
||||
|
||||
@Size(max = 64)
|
||||
@Email
|
||||
@Schema(description = "발송 이메일(이메일 발송에서 사용)")
|
||||
public String sendEml;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotBlank
|
||||
@Schema(description = "발송자 이름")
|
||||
public String sendNm;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.kri.notihub.server.dto.template;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.kri.notihub.server.common.enums.SendType;
|
||||
import com.kri.notihub.server.persistence.entity.TTmplatEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "템플릿 정보")
|
||||
public class TemplateDto extends TemplateBasicDto{
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "템플릿 고유 키 (없으면 Create / 있으면 Update)")
|
||||
public Long tmplatIdx;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotBlank
|
||||
@Schema(description = "인트라넷 프로젝트 코드")
|
||||
public String itrntPrjctCd;
|
||||
|
||||
@Size(max = 32)
|
||||
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private String regUser;
|
||||
|
||||
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private String modUser;
|
||||
|
||||
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private LocalDateTime modDt;
|
||||
|
||||
public static TemplateDto from(TTmplatEntity entity) {
|
||||
return TemplateDto.builder()
|
||||
.tmplatIdx(entity.getTmplatIdx())
|
||||
.itrntPrjctCd(entity.getItrntPrjctCd())
|
||||
.tmplatTy(SendType.fromCode(entity.getTmplatTy()))
|
||||
.tmplatNm(entity.getTmplatNm())
|
||||
.tmplatTitle(entity.getTmplatTitle())
|
||||
.tmplatBody(entity.getTmplatBody())
|
||||
.delayTime(entity.getDelayTime())
|
||||
.sendTel(entity.getSendTel())
|
||||
.sendEml(entity.getSendEml())
|
||||
.sendNm(entity.getSendNm())
|
||||
.regUser(entity.getRegUser())
|
||||
.regDt(entity.getRegDt())
|
||||
.modUser(entity.getModUser())
|
||||
.modDt(entity.getModDt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.kri.notihub.server.dto.template;
|
||||
|
||||
import com.kri.notihub.server.persistence.entity.TTmplatEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "템플릿 요약 정보")
|
||||
public class TemplateSummaryDto {
|
||||
@Schema(description = "템플릿 고유 키")
|
||||
public Long tmplatIdx;
|
||||
|
||||
@Schema(description = "템플릿 명")
|
||||
public String tmplatNm;
|
||||
|
||||
public static TemplateSummaryDto from(TTmplatEntity entity) {
|
||||
return TemplateSummaryDto.builder()
|
||||
.tmplatIdx(entity.getTmplatIdx())
|
||||
.tmplatNm(entity.getTmplatNm())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user