|
@@ -0,0 +1,209 @@
|
|
|
+package com.its.op.dto.its.oper;
|
|
|
+
|
|
|
+import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import com.its.op.entity.its.oper.TbMsWebMember;
|
|
|
+import com.its.utils.AES256Util;
|
|
|
+import io.swagger.annotations.ApiModel;
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
+import lombok.*;
|
|
|
+
|
|
|
+import javax.validation.constraints.Pattern;
|
|
|
+import javax.validation.constraints.Positive;
|
|
|
+import javax.validation.constraints.Size;
|
|
|
+import java.io.Serializable;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+
|
|
|
+/**
|
|
|
+ * DTO Class
|
|
|
+ */
|
|
|
+@Data
|
|
|
+@Builder
|
|
|
+@ApiModel("TbMsWebMemberDto(홈페이지관리자정보)")
|
|
|
+public class TbMsWebMemberDto implements Serializable {
|
|
|
+ private static final long serialVersionUID = 1L;
|
|
|
+
|
|
|
+ @ApiModelProperty("아이디") // N VARCHAR(50)
|
|
|
+ @JsonProperty("email")
|
|
|
+ private String email;
|
|
|
+
|
|
|
+ @ApiModelProperty("관리자명") // Y VARCHAR(15)
|
|
|
+ @JsonProperty("username")
|
|
|
+ private String username;
|
|
|
+
|
|
|
+ @ApiModelProperty("비번") // Y VARCHAR(100)
|
|
|
+ @JsonProperty("password")
|
|
|
+ private String password;
|
|
|
+
|
|
|
+ @ApiModelProperty("연락처") // Y VARCHAR(20)
|
|
|
+ @JsonProperty("contactnum")
|
|
|
+ private String contactnum;
|
|
|
+
|
|
|
+ @ApiModelProperty("권한명") // Y VARCHAR(3)
|
|
|
+ @JsonProperty("userauth")
|
|
|
+ private String userauth;
|
|
|
+
|
|
|
+ @ApiModelProperty("비밀번호질문") // Y VARCHAR(200)
|
|
|
+ @JsonProperty("question")
|
|
|
+ private String question;
|
|
|
+
|
|
|
+ @ApiModelProperty("비밀번호응답") // Y VARCHAR(100)
|
|
|
+ @JsonProperty("answer")
|
|
|
+ private String answer;
|
|
|
+
|
|
|
+ @ApiModelProperty("등록시각") // Y DATE(0)
|
|
|
+ @JsonProperty("regdate")
|
|
|
+ private String regdate;
|
|
|
+
|
|
|
+ @ApiModelProperty("로그인 실패 횟수") // Y NUMBER(3)
|
|
|
+ @JsonProperty("login_fail_count")
|
|
|
+ private Integer loginFailCount;
|
|
|
+
|
|
|
+ @ApiModelProperty("계정잠금여부(Y:계정잠김)") // Y CHAR(1)
|
|
|
+ @JsonProperty("is_account_lock")
|
|
|
+ private String isAccountLock;
|
|
|
+
|
|
|
+ @ApiModelProperty("관리자계정접속가능아이피") // Y VARCHAR(200)
|
|
|
+ @JsonProperty("ip_address")
|
|
|
+ private String ipAddress;
|
|
|
+
|
|
|
+ @ApiModelProperty("삭제여부(Y:삭제됨)") // Y CHAR(1)
|
|
|
+ @JsonProperty("del_yn")
|
|
|
+ private String delYn;
|
|
|
+
|
|
|
+ // Code Description Field
|
|
|
+ @ApiModelProperty("삭제여부(Y:삭제됨) 설명")
|
|
|
+ @JsonProperty("del_desc") // DEL_YN
|
|
|
+ private String delDesc;
|
|
|
+
|
|
|
+ @ApiModel("TbMsWebMemberUpdReq(홈페이지관리자정보 정보변경)")
|
|
|
+ @Getter
|
|
|
+ @Setter
|
|
|
+ @ToString
|
|
|
+ @NoArgsConstructor(access = AccessLevel.PROTECTED)
|
|
|
+ public static class TbMsWebMemberUpdReq {
|
|
|
+
|
|
|
+ @ApiModelProperty("메일주소, Nullable = N, VARCHAR(50)") // N VARCHAR(50)
|
|
|
+ @JsonProperty("아이디")
|
|
|
+ @Size(min=1, max=50)
|
|
|
+ private String email;
|
|
|
+
|
|
|
+ @ApiModelProperty("관리자명, Nullable = Y, VARCHAR(15)") // Y VARCHAR(15)
|
|
|
+ @JsonProperty("username")
|
|
|
+ @Size(min=1, max=15)
|
|
|
+ private String username;
|
|
|
+
|
|
|
+ @ApiModelProperty("비번, Nullable = Y, VARCHAR(100)") // Y VARCHAR(100)
|
|
|
+ @JsonProperty("password")
|
|
|
+ @Size(min=1, max=100)
|
|
|
+ private String password;
|
|
|
+
|
|
|
+ @ApiModelProperty("연락처, Nullable = Y, VARCHAR(20)") // Y VARCHAR(20)
|
|
|
+ @JsonProperty("contactnum")
|
|
|
+ @Size(min=1, max=20)
|
|
|
+ private String contactnum;
|
|
|
+
|
|
|
+ @ApiModelProperty("권한명, Nullable = Y, VARCHAR(3)") // Y VARCHAR(3)
|
|
|
+ @JsonProperty("userauth")
|
|
|
+ @Size(min=1, max=3)
|
|
|
+ private String userauth;
|
|
|
+
|
|
|
+ @ApiModelProperty("비밀번호질문, Nullable = Y, VARCHAR(200)") // Y VARCHAR(200)
|
|
|
+ @JsonProperty("question")
|
|
|
+ @Size(max=200)
|
|
|
+ private String question;
|
|
|
+
|
|
|
+ @ApiModelProperty("비밀번호응답, Nullable = Y, VARCHAR(100)") // Y VARCHAR(100)
|
|
|
+ @JsonProperty("answer")
|
|
|
+ @Size(max=100)
|
|
|
+ private String answer;
|
|
|
+
|
|
|
+ @ApiModelProperty("등록시각, Nullable = Y, DATE(0)") // Y DATE(0)
|
|
|
+ @JsonProperty("regdate")
|
|
|
+ private String regdate;
|
|
|
+
|
|
|
+ @ApiModelProperty("로그인 실패 횟수, Nullable = Y, NUMBER(3)") // Y NUMBER(3)
|
|
|
+ @JsonProperty("login_fail_count")
|
|
|
+ @Positive
|
|
|
+ private Integer loginFailCount;
|
|
|
+
|
|
|
+ @ApiModelProperty("계정잠금여부(Y:계정잠김), Nullable = Y, CHAR(1)") // Y CHAR(1)
|
|
|
+ @JsonProperty("is_account_lock")
|
|
|
+ @Size(min=1, max=1)
|
|
|
+ @Pattern(regexp = "[YN]")
|
|
|
+ private String isAccountLock;
|
|
|
+
|
|
|
+ @ApiModelProperty("관리자계정접속가능아이피, Nullable = Y, VARCHAR(200)") // Y VARCHAR(200)
|
|
|
+ @JsonProperty("ip_address")
|
|
|
+ @Size(min=1, max=200)
|
|
|
+ private String ipAddress;
|
|
|
+
|
|
|
+ @ApiModelProperty("삭제여부(Y:삭제됨), Nullable = Y, CHAR(1)") // Y CHAR(1)
|
|
|
+ @JsonProperty("del_yn")
|
|
|
+ @Size(min=1, max=1)
|
|
|
+ @Pattern(regexp = "[YN]")
|
|
|
+ private String delYn;
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ public TbMsWebMemberUpdReq(String email, String username, String password, String contactnum, String userauth, String question, String answer, String regdate, Integer login_fail_count, String is_account_lock, String ip_address, String del_yn) {
|
|
|
+ this.email = email;
|
|
|
+ this.username = username;
|
|
|
+ this.password = password;
|
|
|
+ this.contactnum = contactnum;
|
|
|
+ this.userauth = userauth;
|
|
|
+ this.question = question;
|
|
|
+ this.answer = answer;
|
|
|
+ this.regdate = regdate;
|
|
|
+ this.loginFailCount = login_fail_count;
|
|
|
+ this.isAccountLock = is_account_lock;
|
|
|
+ this.ipAddress = ip_address;
|
|
|
+ this.delYn = del_yn;
|
|
|
+ }
|
|
|
+ @ApiModel("TbMsWebMemberUpdReq(홈페이지관리자정보 락 해제)")
|
|
|
+ @Getter
|
|
|
+ @Setter
|
|
|
+ @ToString
|
|
|
+ @NoArgsConstructor(access = AccessLevel.PROTECTED)
|
|
|
+ public static class TbMsWebMemberLockFreeReq {
|
|
|
+
|
|
|
+ @ApiModelProperty("아이디, Nullable = N, VARCHAR(50)") // N VARCHAR(50)
|
|
|
+ @JsonProperty("email")
|
|
|
+ @Size(min = 1, max = 50)
|
|
|
+ private String email;
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ public TbMsWebMemberLockFreeReq(String email) {
|
|
|
+ this.email = email;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public TbMsWebMember toEntity() {
|
|
|
+ AES256Util aes = null;
|
|
|
+ String encodePassword = "";
|
|
|
+ try {
|
|
|
+ aes = new AES256Util(AES256Util.DEFAULT_KEY);
|
|
|
+ encodePassword = aes.aesEncode(this.password); // 암호화
|
|
|
+ //decodePassword = aes.aesDecode(password); // 복호화
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ encodePassword = this.password;
|
|
|
+ } catch (Exception e) {
|
|
|
+ encodePassword = this.password;
|
|
|
+ }
|
|
|
+ return TbMsWebMember.builder()
|
|
|
+ .email(this.email)
|
|
|
+ .username(this.username)
|
|
|
+ .password(encodePassword)
|
|
|
+ .contactnum(this.contactnum)
|
|
|
+ .userauth(this.userauth)
|
|
|
+ .question(this.question)
|
|
|
+ .answer(this.answer)
|
|
|
+ .regdate(this.regdate)
|
|
|
+ .loginFailCount(this.loginFailCount)
|
|
|
+ .isAccountLock(this.isAccountLock)
|
|
|
+ .ipAddress(this.ipAddress)
|
|
|
+ .delYn(this.delYn)
|
|
|
+ .build();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|