251121_01_ENH: 최초 기능 구현(로그인)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.kri.contact.server;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ContactServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ContactServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.kri.contact.server.api.auth;
|
||||
|
||||
import com.kri.contact.server.api.auth.request.LoginRequestDto;
|
||||
import com.kri.contact.server.api.auth.response.LoginResponseDto;
|
||||
import com.kri.contact.server.application.AuthService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/auth")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Auth", description = "인증 API")
|
||||
public class AuthController {
|
||||
private final AuthService authService;
|
||||
|
||||
@PostMapping("/login")
|
||||
public LoginResponseDto tryLogin(@RequestBody LoginRequestDto request){
|
||||
return authService.tryLogin(request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.kri.contact.server.api.auth.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class LoginRequestDto {
|
||||
private String userId;
|
||||
private String userPw;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.kri.contact.server.api.auth.response;
|
||||
|
||||
import com.kri.common.auth.jwt.JwtUserClaimsDto;
|
||||
import com.kri.contact.server.persistence.entity.TUserEntity;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class LoginResponseDto {
|
||||
private String accessToken;
|
||||
private JwtUserClaimsDto user;
|
||||
|
||||
public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims){
|
||||
return LoginResponseDto.builder()
|
||||
.accessToken(accessToken)
|
||||
.user(jwtUserClaims)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.kri.contact.server.application;
|
||||
|
||||
import com.kri.common.auth.jwt.JwtService;
|
||||
import com.kri.common.auth.jwt.JwtUserClaimsDto;
|
||||
import com.kri.common.web.BusinessException;
|
||||
import com.kri.contact.server.api.auth.request.LoginRequestDto;
|
||||
import com.kri.contact.server.api.auth.response.LoginResponseDto;
|
||||
import com.kri.contact.server.common.external.intranet.IntranetExtensionApiClient;
|
||||
import com.kri.contact.server.common.external.intranet.response.SearchLoginInfoResponseDto;
|
||||
import com.kri.contact.server.persistence.entity.TUserEntity;
|
||||
import com.kri.contact.server.persistence.repository.UserRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AuthService {
|
||||
private final JwtService jwtService;
|
||||
private final IntranetExtensionApiClient intranetExtensionApiClient;
|
||||
private final UserRepository userRepository;
|
||||
|
||||
public LoginResponseDto tryLogin(LoginRequestDto request){
|
||||
SearchLoginInfoResponseDto loginInfoResponse = intranetExtensionApiClient.searchLoginInfo(request);
|
||||
|
||||
JwtUserClaimsDto claims;
|
||||
if(loginInfoResponse != null){
|
||||
claims = JwtUserClaimsDto.builder()
|
||||
.userId(loginInfoResponse.getUserId())
|
||||
.userName(loginInfoResponse.getUserNm())
|
||||
.userTeam(loginInfoResponse.getUserTeam())
|
||||
.userRole(loginInfoResponse.getUserRole())
|
||||
.build();
|
||||
}
|
||||
else{
|
||||
TUserEntity user = userRepository.findByUserIdAndUserPw(request.getUserId(), request.getUserPw());
|
||||
|
||||
if(user == null){
|
||||
throw BusinessException.forbidden("USER_NOT_FOUND", "사용자가 없습니다.")
|
||||
.with("userId", request.getUserId());
|
||||
}
|
||||
claims = JwtUserClaimsDto.builder()
|
||||
.userId(user.getUserId())
|
||||
.userName(user.getUserNm())
|
||||
.userTeam(user.getUserTeam())
|
||||
.userRole(user.getUserRole())
|
||||
.build();
|
||||
}
|
||||
|
||||
String accessToken = jwtService.generateAccessToken(claims);
|
||||
return LoginResponseDto.from(accessToken, claims);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.kri.common.enums.CodeEnum;
|
||||
|
||||
public enum ResultCodeType implements CodeEnum<Short> {
|
||||
|
||||
CONTACT((short) 0), // 컨택 결과코드
|
||||
INTERVIEW((short) 1), // 면접 결과코드
|
||||
SURVEY((short) 2); // 설문 결과코드
|
||||
|
||||
private final short code;
|
||||
|
||||
ResultCodeType(short code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Short getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
53
src/main/java/com/kri/contact/server/common/external/intranet/IntranetExtensionApiClient.java
vendored
Normal file
53
src/main/java/com/kri/contact/server/common/external/intranet/IntranetExtensionApiClient.java
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
package com.kri.contact.server.common.external.intranet;
|
||||
|
||||
import com.kri.common.http.ExternalApiClient;
|
||||
import com.kri.contact.server.api.auth.request.LoginRequestDto;
|
||||
import com.kri.contact.server.api.auth.response.LoginResponseDto;
|
||||
import com.kri.contact.server.common.external.intranet.response.SearchLoginInfoResponseDto;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.kri.common.http.ExternalApiResponse;
|
||||
|
||||
/**
|
||||
* 공통 모듈로 분리하기 위한 외부(Intranet-Extension) 인증 API 클라이언트.
|
||||
* 현재 프로젝트 내에 두되, 이후 common 리포지토리로 이동이 용이하도록
|
||||
* contact-server 의 도메인(Service) 코드와 분리한다.
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class IntranetExtensionApiClient {
|
||||
|
||||
@Value("${kri.api-url.intranet-extension}")
|
||||
private String intranetExtensionBaseUrl;
|
||||
|
||||
@Value("${kri.auth.apikey.header-name:X-API-Key}")
|
||||
private String apiKeyHeaderName;
|
||||
|
||||
@Value("${kri.auth.apikey.key}")
|
||||
private String apiKey;
|
||||
|
||||
// ExternalApiClient 를 직접 생성해 사용 (starter에서 Bean 미제공 시 대비)
|
||||
private final ExternalApiClient externalApiClient = new ExternalApiClient();
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
public SearchLoginInfoResponseDto searchLoginInfo(LoginRequestDto request) {
|
||||
String url = String.format("%s/api/v1/user/search/login-info", intranetExtensionBaseUrl);
|
||||
// 요구사항: ExternalApiClient.post() 사용 (시그니처: post(url, headers, body))
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put(apiKeyHeaderName, apiKey);
|
||||
try {
|
||||
String body = objectMapper.writeValueAsString(request);
|
||||
ExternalApiResponse response = externalApiClient.post(url, headers, body);
|
||||
|
||||
String test = response.getBody();
|
||||
return objectMapper.readValue(response.getBody(), SearchLoginInfoResponseDto.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.kri.contact.server.common.external.intranet.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor // Jackson이 빈 객체를 생성할 수 있도록 추가
|
||||
@AllArgsConstructor // Builder 패턴 사용 시 필요
|
||||
@Schema(description = "인트라넷 사용자 검색 응답 DTO")
|
||||
public class SearchLoginInfoResponseDto {
|
||||
@Schema(description = "사용자 ID (p_user_mail)")
|
||||
private String userId; // final 제거
|
||||
|
||||
@Schema(description = "사용자 이름 (p_name)")
|
||||
private String userNm; // final 제거
|
||||
|
||||
@Schema(description = "사용자 팀 (p_depart_now + p_team_now)")
|
||||
private String userTeam; // final 제거
|
||||
|
||||
@Schema(description = "사용자 역할")
|
||||
private int userRole; // final 제거
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.kri.contact.server.common.jpa;
|
||||
|
||||
import com.kri.common.jpa.AbstractCodeEnumConverter;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import jakarta.persistence.Converter;
|
||||
|
||||
@Converter(autoApply = false)
|
||||
public class ResultCodeTypeConverter
|
||||
extends AbstractCodeEnumConverter<ResultCodeType, Short> {
|
||||
|
||||
public ResultCodeTypeConverter() {
|
||||
super(ResultCodeType.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.kri.contact.server.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class QueryDSLConfig {
|
||||
|
||||
private final EntityManager entityManager;
|
||||
|
||||
@Bean
|
||||
public JPAQueryFactory jpaQueryFactory() {
|
||||
return new JPAQueryFactory(entityManager);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_event_ty_dic")
|
||||
public class TEventTyDicEntity {
|
||||
@Id
|
||||
@Column(name = "event_ty", nullable = false)
|
||||
private Short eventTy;
|
||||
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
@Column(name = "event_ty_nm", nullable = false, length = 64)
|
||||
private String eventTyNm;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_func")
|
||||
public class TFuncEntity {
|
||||
@Id
|
||||
@NotNull
|
||||
@Column(name = "func_cd")
|
||||
private Integer funcCd;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "func_nm", nullable = false, length = 32)
|
||||
private String funcNm;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("1")
|
||||
@Column(name = "is_menu", nullable = false)
|
||||
private Boolean isMenu = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "depth", nullable = false)
|
||||
private Integer depth;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "parent", nullable = false)
|
||||
private Integer parent;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "func_memo", nullable = false)
|
||||
private String funcMemo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_assign")
|
||||
public class TListAssignEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_assign_idx", nullable = false)
|
||||
private Long listAssignIdx;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "assign_ty", nullable = false)
|
||||
private Short assignTy;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "user_id", length = 32)
|
||||
private String userId;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "reg_user", length = 32)
|
||||
private String regUser;
|
||||
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt")
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "exc_user", length = 32)
|
||||
private String excUser;
|
||||
|
||||
@Column(name = "exc_dt")
|
||||
private Instant excDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list")
|
||||
public class TListEntity {
|
||||
@EmbeddedId
|
||||
private TListEntityId id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "is_use", nullable = false)
|
||||
private Short isUse;
|
||||
|
||||
@Size(max = 2048)
|
||||
@Column(name = "memo", length = 2048)
|
||||
private String memo;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", nullable = false, length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt", nullable = false)
|
||||
private Instant modDt;
|
||||
|
||||
public Long getPrjctIdx(){
|
||||
return id.getPrjctIdx();
|
||||
}
|
||||
|
||||
public Integer getSid(){
|
||||
return id.getSid();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TListEntityId implements Serializable {
|
||||
private static final long serialVersionUID = 7012247084434778447L;
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TListEntityId entity = (TListEntityId) o;
|
||||
return Objects.equals(this.prjctIdx, entity.prjctIdx) &&
|
||||
Objects.equals(this.sid, entity.sid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prjctIdx, sid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_event_hist")
|
||||
public class TListEventHistEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_event_hist_idx", nullable = false)
|
||||
private Long listEventHistIdx;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "result_cd", nullable = false)
|
||||
private Integer resultCd;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "contact_memo", nullable = false)
|
||||
private String contactMemo;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_header")
|
||||
public class TListHeaderEntity {
|
||||
@EmbeddedId
|
||||
private TListHeaderEntityId id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_grad", nullable = false)
|
||||
private Short listHderGrad;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "list_hder_nm", nullable = false, length = 32)
|
||||
private String listHderNm;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_ty", nullable = false)
|
||||
private Short listHderTy;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "use_filter", nullable = false)
|
||||
private Boolean useFilter = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "use_view", nullable = false)
|
||||
private Boolean useView = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "use_intrvwer_view", nullable = false)
|
||||
private Boolean useIntrvwerView = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "use_intrvwer_edit", nullable = false)
|
||||
private Boolean useIntrvwerEdit = false;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", nullable = false, length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt", nullable = false)
|
||||
private Instant modDt;
|
||||
|
||||
public Long getPrjctIdx(){
|
||||
return id.getPrjctIdx();
|
||||
}
|
||||
|
||||
public Integer getListHderId(){
|
||||
return id.getListHderId();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TListHeaderEntityId implements Serializable {
|
||||
private static final long serialVersionUID = -1296812261527497087L;
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_id", nullable = false)
|
||||
private Integer listHderId;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TListHeaderEntityId entity = (TListHeaderEntityId) o;
|
||||
return Objects.equals(this.prjctIdx, entity.prjctIdx) &&
|
||||
Objects.equals(this.listHderId, entity.listHderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prjctIdx, listHderId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_item")
|
||||
public class TListItemEntity {
|
||||
@EmbeddedId
|
||||
private TListItemEntityId id;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "list_item_val", nullable = false)
|
||||
private String listItemVal;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", nullable = false, length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt", nullable = false)
|
||||
private Instant modDt;
|
||||
|
||||
public Long getPrjctIdx(){
|
||||
return id.getPrjctIdx();
|
||||
}
|
||||
|
||||
public Integer getSid(){
|
||||
return id.getSid();
|
||||
}
|
||||
|
||||
public Integer getListHderId(){
|
||||
return id.getListHderId();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TListItemEntityId implements Serializable {
|
||||
private static final long serialVersionUID = -3478285652359764540L;
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_id", nullable = false)
|
||||
private Integer listHderId;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TListItemEntityId entity = (TListItemEntityId) o;
|
||||
return Objects.equals(this.prjctIdx, entity.prjctIdx) &&
|
||||
Objects.equals(this.listHderId, entity.listHderId) &&
|
||||
Objects.equals(this.sid, entity.sid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prjctIdx, listHderId, sid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_item_upload")
|
||||
public class TListItemUploadEntity {
|
||||
@EmbeddedId
|
||||
private TListItemUploadEntityId id;
|
||||
|
||||
@Size(max = 128)
|
||||
@Column(name = "file_nm", length = 128)
|
||||
private String fileNm;
|
||||
|
||||
@Column(name = "file_size")
|
||||
private Integer fileSize;
|
||||
|
||||
@Size(max = 128)
|
||||
@Column(name = "file_path", length = 128)
|
||||
private String filePath;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", nullable = false, length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt", nullable = false)
|
||||
private Instant modDt;
|
||||
|
||||
public Long getPrjctIdx(){
|
||||
return id.getPrjctIdx();
|
||||
}
|
||||
|
||||
public Integer getSid(){
|
||||
return id.getSid();
|
||||
}
|
||||
|
||||
public Integer getListHderId(){
|
||||
return id.getListHderId();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TListItemUploadEntityId implements Serializable {
|
||||
private static final long serialVersionUID = -8073832649114843758L;
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_id", nullable = false)
|
||||
private Integer listHderId;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TListItemUploadEntityId entity = (TListItemUploadEntityId) o;
|
||||
return Objects.equals(this.prjctIdx, entity.prjctIdx) &&
|
||||
Objects.equals(this.listHderId, entity.listHderId) &&
|
||||
Objects.equals(this.sid, entity.sid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prjctIdx, listHderId, sid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
import org.hibernate.type.SqlTypes;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_reset_log")
|
||||
public class TListResetLogEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_reset_log_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long listResetLogIdx;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mode", nullable = false)
|
||||
private Short mode;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_cnt", nullable = false)
|
||||
private Integer listCnt;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
@JdbcTypeCode(SqlTypes.JSON)
|
||||
private Map<String, Object> sid;
|
||||
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "backup_file_path", nullable = false, length = 128)
|
||||
private String backupFilePath;
|
||||
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "backup_file_nm", nullable = false, length = 128)
|
||||
private String backupFileNm;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_resve")
|
||||
public class TListResveEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_resve_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long listResveIdx;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@Size(max = 2048)
|
||||
@NotNull
|
||||
@Column(name = "memo", nullable = false, length = 2048)
|
||||
private String memo;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "is_cnfirm", nullable = false)
|
||||
private Boolean isCnfirm = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "resve_dt", nullable = false)
|
||||
private Instant resveDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "resve_user", nullable = false, length = 32)
|
||||
private String resveUser;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_update_hist")
|
||||
public class TListUpdateHistEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_update_hist_idx", nullable = false)
|
||||
private Long listUpdateHistIdx;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_id", nullable = false)
|
||||
private Integer listHderId;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "before_val", nullable = false)
|
||||
private String beforeVal;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "after_val", nullable = false)
|
||||
private String afterVal;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_upload_log")
|
||||
public class TListUploadLogEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_upload_log_idx", nullable = false)
|
||||
private Long listUploadLogIdx;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "wave", nullable = false)
|
||||
private Integer wave;
|
||||
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "file_nm", nullable = false, length = 128)
|
||||
private String fileNm;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_cnt", nullable = false)
|
||||
private Integer listCnt;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mode", nullable = false)
|
||||
private Short mode;
|
||||
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
@Column(name = "optn", nullable = false, length = 64)
|
||||
private String optn;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "is_success", nullable = false)
|
||||
private Boolean isSuccess = false;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_prjct_assign")
|
||||
public class TPrjctAssignEntity {
|
||||
@EmbeddedId
|
||||
private TPrjctAssignEntityId id;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
public Long getPrjctIdx(){
|
||||
return id.getPrjctIdx();
|
||||
}
|
||||
|
||||
public String getUserId(){
|
||||
return id.getUserId();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TPrjctAssignEntityId implements Serializable {
|
||||
private static final long serialVersionUID = -263674621497298216L;
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "user_id", nullable = false, length = 32)
|
||||
private String userId;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TPrjctAssignEntityId entity = (TPrjctAssignEntityId) o;
|
||||
return Objects.equals(this.prjctIdx, entity.prjctIdx) &&
|
||||
Objects.equals(this.userId, entity.userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prjctIdx, userId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_prjct")
|
||||
public class TPrjctEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "prjct_cd", nullable = false, length = 32)
|
||||
private String prjctCd;
|
||||
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
@Column(name = "prjct_nm", nullable = false, length = 64)
|
||||
private String prjctNm;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "itrnt_prjct_cd", nullable = false, length = 32)
|
||||
private String itrntPrjctCd;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "owner_dept", nullable = false, length = 32)
|
||||
private String ownerDept;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "owner_fw", nullable = false, length = 16)
|
||||
private String ownerFw;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "survey_ty", nullable = false)
|
||||
private Short surveyTy;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "survey_prjct_cd", length = 32)
|
||||
private String surveyPrjctCd;
|
||||
|
||||
@Size(max = 128)
|
||||
@Column(name = "survey_url", length = 128)
|
||||
private String surveyUrl;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "is_ff", nullable = false)
|
||||
private Boolean isFf = false;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "is_use_contact_senario", nullable = false)
|
||||
private Boolean isUseContactSenario = false;
|
||||
|
||||
@Lob
|
||||
@Column(name = "contact_senario")
|
||||
private String contactSenario;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", nullable = false, length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt", nullable = false)
|
||||
private Instant modDt;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "is_del", nullable = false)
|
||||
private Boolean isDel = false;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "del_user", length = 32)
|
||||
private String delUser;
|
||||
|
||||
@Column(name = "del_dt")
|
||||
private Instant delDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_result_code")
|
||||
public class TResultCodeEntity {
|
||||
@EmbeddedId
|
||||
private TResultCodeEntityId id;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "result_cd_lbl", nullable = false, length = 32)
|
||||
private String resultCdLbl;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", nullable = false, length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt", nullable = false)
|
||||
private Instant modDt;
|
||||
|
||||
public Long getPrjctIdx(){
|
||||
return id.getPrjctIdx();
|
||||
}
|
||||
|
||||
public Short getResultCdTy(){
|
||||
return id.getResultCdTy();
|
||||
}
|
||||
|
||||
public ResultCodeType getResultCd(){
|
||||
return id.getResultCd();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import com.kri.contact.server.common.jpa.ResultCodeTypeConverter;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Convert;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TResultCodeEntityId implements Serializable {
|
||||
private static final long serialVersionUID = -1984612223940078355L;
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "result_cd_ty", nullable = false)
|
||||
private Short resultCdTy;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "result_cd", nullable = false)
|
||||
@Convert(converter = ResultCodeTypeConverter.class)
|
||||
private ResultCodeType resultCd;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TResultCodeEntityId entity = (TResultCodeEntityId) o;
|
||||
return Objects.equals(this.prjctIdx, entity.prjctIdx) &&
|
||||
Objects.equals(this.resultCdTy, entity.resultCdTy) &&
|
||||
Objects.equals(this.resultCd, entity.resultCd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prjctIdx, resultCdTy, resultCd);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_role")
|
||||
public class TRoleEntity {
|
||||
@Id
|
||||
@Column(name = "role_cd", nullable = false)
|
||||
private Integer roleCd;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "role_nm", nullable = false, length = 16)
|
||||
private String roleNm;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "memo", nullable = false)
|
||||
private String memo;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", nullable = false, length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt", nullable = false)
|
||||
private Instant modDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_role_func_map")
|
||||
public class TRoleFuncMapEntity {
|
||||
@EmbeddedId
|
||||
private TRoleFuncMapEntityId id;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
public Integer getRoleCd(){
|
||||
return id.getRoleCd();
|
||||
}
|
||||
|
||||
public Long getFuncCd(){
|
||||
return id.getFuncCd();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TRoleFuncMapEntityId implements Serializable {
|
||||
private static final long serialVersionUID = 5430666726716009453L;
|
||||
@NotNull
|
||||
@Column(name = "role_cd", nullable = false)
|
||||
private Integer roleCd;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "func_cd", nullable = false)
|
||||
private Long funcCd;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TRoleFuncMapEntityId entity = (TRoleFuncMapEntityId) o;
|
||||
return Objects.equals(this.roleCd, entity.roleCd) &&
|
||||
Objects.equals(this.funcCd, entity.funcCd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(roleCd, funcCd);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
import org.hibernate.type.SqlTypes;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_sys_event_log")
|
||||
public class TSysEventLogEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "sys_event_log_idx", nullable = false)
|
||||
private Long sysEventLogIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "event_ty", nullable = false)
|
||||
private Short eventTy;
|
||||
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "log_title", nullable = false, length = 128)
|
||||
private String logTitle;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "log_content", nullable = false)
|
||||
@JdbcTypeCode(SqlTypes.JSON)
|
||||
private Map<String, Object> logContent;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED")
|
||||
private Long prjctIdx;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "ip", nullable = false, length = 16)
|
||||
private String ip;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 16)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_user")
|
||||
public class TUserEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "user_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long userIdx;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "user_id", nullable = false, length = 32)
|
||||
private String userId;
|
||||
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "user_pw", nullable = false, length = 128)
|
||||
private String userPw;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "user_nm", nullable = false, length = 32)
|
||||
private String userNm;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@ColumnDefault("'S101'")
|
||||
@Column(name = "user_team", nullable = false, length = 32)
|
||||
private String userTeam;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "user_role", nullable = false)
|
||||
private Integer userRole;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "memo", nullable = false)
|
||||
private String memo;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "mod_user", length = 32)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "mod_dt")
|
||||
private Instant modDt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.kri.contact.server.persistence.repository;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TUserEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface UserRepository extends JpaRepository<TUserEntity, Long>, JpaSpecificationExecutor<TUserEntity> {
|
||||
TUserEntity findByUserIdAndUserPw(String userId, String userPw);
|
||||
}
|
||||
1
src/main/resources/application.properties
Normal file
1
src/main/resources/application.properties
Normal file
@@ -0,0 +1 @@
|
||||
spring.application.name=contact-server
|
||||
Reference in New Issue
Block a user