From 7fb50464329ced289f92c7f47bf462fbe848bd2e Mon Sep 17 00:00:00 2001 From: IkHeyonCho Date: Tue, 6 Feb 2024 16:26:27 +0900 Subject: [PATCH 01/30] =?UTF-8?q?feat=20:=20Entity=20=EC=84=A4=EA=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/contract/entity/Contract.java | 36 +++++++++++++++++++ .../domain/contract/entity/OpStatus.java | 5 +++ .../numOfUsersType/entity/NumOfUsersType.java | 32 +++++++++++++++++ .../domain/supplyType/entity/SupplyType.java | 32 +++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java new file mode 100644 index 0000000..6d49c9e --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -0,0 +1,36 @@ +package com.kbds.itamserveradmin.domain.contract.entity; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.persistence.Entity; +import javax.persistence.Id; +import java.time.LocalDateTime; + +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class Contract { + @Id + private String contId; + + + private Asset ast; + private Cooperation corp; + private NewAstReq newAstReq; + private User user; + + private String contLicTag; + private int contPrice; + private String contAdminName; + private String contVer; + private OpStatus contOpStatus; + private LocalDateTime contRegDate; + private String contName; + + +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java new file mode 100644 index 0000000..cc1dddd --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java @@ -0,0 +1,5 @@ +package com.kbds.itamserveradmin.domain.contract.entity; + +public enum OpStatus { + IN_OPERATION, IN_DISPOSAL +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java new file mode 100644 index 0000000..fa642bf --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java @@ -0,0 +1,32 @@ +package com.kbds.itamserveradmin.domain.numOfUsersType.entity; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.OneToOne; + +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class NumOfUsersType { + + @OneToOne + @Column(name = "cont_id") + private Contract cont; + + private Integer maxUsersLimit; + private Integer maxCpuLimit; + private String ipRange; + private Integer currUsers; + private Integer currCpu; + private Integer totalNumPur; + private Integer totalServer; + private Integer totalCal; +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java b/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java new file mode 100644 index 0000000..888a8d4 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java @@ -0,0 +1,32 @@ +package com.kbds.itamserveradmin.domain.supplyType.entity; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; + +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class SupplyType { + + @Id + private String splyId; + + @OneToOne + @JoinColumn(name = "cont_id") + private Contract cont; + + private String splyInstallFile; + private String splyInstallGuide; + private String acsUrl; + private String splyVer; + private String splyUserGuide; +} From 8d417d55ecfd0b37a02a69894ec11a93faf3068d Mon Sep 17 00:00:00 2001 From: chaehuiseon Date: Wed, 7 Feb 2024 02:45:55 +0900 Subject: [PATCH 02/30] =?UTF-8?q?[#2]=20=EC=98=88=EC=99=B8=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=B8=EB=93=A4=EB=9F=AC=20=EB=B0=8F=20=EA=B3=B5?= =?UTF-8?q?=ED=86=B5=20=EC=97=90=EB=9F=AC=EC=BD=94=EB=93=9C=20=EC=85=8B?= =?UTF-8?q?=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/exception/BaseException.java | 22 +++++++ .../global/exception/ErrorCode.java | 33 ++++++++++ .../global/exception/ErrorResponse.java | 51 ++++++++++++++++ .../exception/GlobalExceptionHandler.java | 61 +++++++++++++++++++ .../business/EntityNotFoundException.java | 12 ++++ 5 files changed, 179 insertions(+) create mode 100644 src/main/java/com/kbds/itamserveradmin/global/exception/BaseException.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/exception/ErrorResponse.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/exception/GlobalExceptionHandler.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/exception/business/EntityNotFoundException.java diff --git a/src/main/java/com/kbds/itamserveradmin/global/exception/BaseException.java b/src/main/java/com/kbds/itamserveradmin/global/exception/BaseException.java new file mode 100644 index 0000000..da7962c --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/exception/BaseException.java @@ -0,0 +1,22 @@ +package com.kbds.itamserveradmin.global.exception; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class BaseException extends RuntimeException { + private final ErrorCode errorCode; + + + public BaseException(ErrorCode errorCode) { + super(errorCode.getMessage()); + this.errorCode = errorCode; + } + + public BaseException(String message) { + super(message); + this.errorCode = ErrorCode.INTERNAL_SERVER_ERROR; + } +} + diff --git a/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java b/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java new file mode 100644 index 0000000..97f26f2 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java @@ -0,0 +1,33 @@ +package com.kbds.itamserveradmin.global.exception; + +import lombok.Getter; +import org.springframework.http.HttpStatus; + + +/* + * 에러 코드 관리 + */ +@Getter +public enum ErrorCode { + + + //기타 + INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "I-001", "내부 에러가 발생했습니다."); + + + + private final HttpStatus httpStatus; + private final String code; + private final String message; + + ErrorCode(HttpStatus httpStatus, String code, String message) { // ErrorCode 에서 각 해당하는 코드를 생성자로 맵핑 + this.httpStatus = httpStatus; + this.code = code; + this.message = message; + } + + + + + +} diff --git a/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorResponse.java b/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorResponse.java new file mode 100644 index 0000000..0c7588b --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorResponse.java @@ -0,0 +1,51 @@ +package com.kbds.itamserveradmin.global.exception; + + +import lombok.Builder; +import lombok.Getter; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; + +import java.util.List; + +@Getter +@Builder +public class ErrorResponse { + + private String errorCode; + private String errorMessage; + + public static ErrorResponse of(String errorCode, String errorMessage) { + return ErrorResponse.builder() + .errorCode(errorCode) + .errorMessage(errorMessage) + .build(); + } + + public static ErrorResponse of(String errorCode, BindingResult bindingResult) { + return ErrorResponse.builder() + .errorCode(errorCode) + .errorMessage(createErrorMessage(bindingResult)) + .build(); + } + + private static String createErrorMessage(BindingResult bindingResult){ + StringBuilder sb = new StringBuilder(); + boolean isFirst = true; + List fieldErrors = bindingResult.getFieldErrors(); + for (FieldError fieldError : fieldErrors) { + if(!isFirst){ + sb.append(","); + } else { + isFirst = false; + } + sb.append("["); + sb.append(fieldError.getField()); + sb.append("]"); + sb.append(fieldError.getDefaultMessage()); + } + + return sb.toString(); + } + +} diff --git a/src/main/java/com/kbds/itamserveradmin/global/exception/GlobalExceptionHandler.java b/src/main/java/com/kbds/itamserveradmin/global/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..f28e51a --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/exception/GlobalExceptionHandler.java @@ -0,0 +1,61 @@ +package com.kbds.itamserveradmin.global.exception; + + +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + + + + + + + +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + /** + * More detailed exception comes first + * 더 자세한 exception 순으로 정렬 + */ + + + /** + * jakarta.validation.Valid 또는 @Validated binding error가 발생할 경우 + */ + @ExceptionHandler(BindException.class) + protected ResponseEntity handleBindException(BindException e) { + log.error("handleBindException", e); + ErrorResponse errorResponse = ErrorResponse.of(HttpStatus.BAD_REQUEST.toString(), e.getBindingResult()); + return ResponseEntity.status(HttpStatus.BAD_REQUEST) + .body(errorResponse); + } + + /** + * ErrorCode 를 담고 있는 BaseException 처리 + * 비즈니스 로직 실행 중 예외 처리 + */ + @ExceptionHandler(BaseException.class) + protected ResponseEntity handleBaseException(BaseException e) { + log.error("handleBaseException", e); + ErrorResponse errorResponse = ErrorResponse.of(e.getErrorCode().getCode(), e.getMessage()); + return ResponseEntity.status(e.getErrorCode().getHttpStatus()) + .body(errorResponse); + } + + + /** + * 나머지 예외 처리 (Exception 클래스를 부모로 두는 모든 자식 예외들) + */ + @ExceptionHandler(Exception.class) + protected ResponseEntity handleException(Exception e) { + log.error("handleException", e); + ErrorResponse errorResponse = ErrorResponse.of(HttpStatus.INTERNAL_SERVER_ERROR.toString(), e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(errorResponse); + } + +} diff --git a/src/main/java/com/kbds/itamserveradmin/global/exception/business/EntityNotFoundException.java b/src/main/java/com/kbds/itamserveradmin/global/exception/business/EntityNotFoundException.java new file mode 100644 index 0000000..8768b37 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/exception/business/EntityNotFoundException.java @@ -0,0 +1,12 @@ +package com.kbds.itamserveradmin.global.exception.business; + + +import com.kbds.itamserveradmin.global.exception.BaseException; +import com.kbds.itamserveradmin.global.exception.ErrorCode; + +public class EntityNotFoundException extends BaseException { + + public EntityNotFoundException(ErrorCode status) { + super(status); + } +} From 24d8f659d257fb76039723609c02a7b9898b3dcd Mon Sep 17 00:00:00 2001 From: chaehuiseon Date: Wed, 7 Feb 2024 11:04:48 +0900 Subject: [PATCH 03/30] =?UTF-8?q?[BUILD][#6]=20mysql=20setting,=20applicat?= =?UTF-8?q?ion.yml=20=EC=B4=88=EA=B8=B0=20=EC=85=8B=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 17 +++++++++++ src/main/resources/application.yml | 45 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/main/resources/application.yml diff --git a/build.gradle b/build.gradle index a743d01..fc91a8b 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,23 @@ dependencies { compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' + + + + //h2 DB + runtimeOnly 'com.h2database:h2' + + + runtimeOnly ('mysql:mysql-connector-java') //mysql8 + implementation 'org.springframework.boot:spring-boot-starter-jdbc' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + //jasypt 설정파일 암호화 라이브러리 + implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5' + + + + } tasks.named('test') { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..4840a05 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,45 @@ +server: + port: 9000 + servlet: + context-path: / + encoding: + charset: utf-8 + enabled: true + force: true + +spring: + + application: + name : itam-server-admin + + datasource: + platform: mysql + url: jdbc:mysql://localhost:3306/kbds?serverTimezone=Asia/Seoul&characterEncoding=UTF-8 + username: root + password: smilechs5542 + driver-class-name: com.mysql.cj.jdbc.Driver # mysql 8버전 + + + jpa: + hibernate: + ddl-auto: create # create, update, none + naming: + #entity만들때, 변수명 그대로 데이터베이스 필드에 넣어주겠다. + #만약, org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy 전략을 사용하겠다고 하면, + #entity에서 변수명을 myEmail 이라고 하면, DB에 myEmail이 아닌 my_email로 만들어짐. + physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + use-new-id-generator-mappings: false #jpa 기본 numbering 전략을 따라가지 않겠다. + properties: + hibernate: + # show formatted sql + show_sql: true + format_sql: true + use_sql_comments: true #querydsl jpql 보기 + # turn OSIV off + open-in-view: false + +#logging: +# level: +# org.hibernate.SQL: debug # 하이버네이트가 생성하는 SQL이 다보인다. +## org.hibernate.type: #binding parameter의 값이 무엇인지를 알려줌. + From a21e710a9c7a5bbfe512fae40a950ca691afcaf5 Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 11:26:33 +0900 Subject: [PATCH 04/30] =?UTF-8?q?feat:=20Asset=20Entity=20=EC=84=A4?= =?UTF-8?q?=EA=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/asset/entity/Asset.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java new file mode 100644 index 0000000..cb249f9 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java @@ -0,0 +1,43 @@ +package com.kbds.itamserveradmin.domain.asset.entity; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.Id; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class Asset { + + @Id + private Long astId; + + private String astName; + private Boolean isAstInternal; + + @ElementCollection + private List astTag = new ArrayList<>(); + private Cooperation corp; + private User user; + + private String astSwCtgy; + private String astPrice; + private String astVer; + private Boolean isAstInstallFile; + private String astSpd; + private String astDpd; + + + + +} From 30dac09113efda892feccdbb0107fa3462201d32 Mon Sep 17 00:00:00 2001 From: chaehuiseon Date: Wed, 7 Feb 2024 11:29:26 +0900 Subject: [PATCH 05/30] api test --- .../com/kbds/itamserveradmin/domain/Test.java | 26 +++++++++++++++++-- .../kbds/itamserveradmin/global/Test2.java | 4 +++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/Test.java b/src/main/java/com/kbds/itamserveradmin/domain/Test.java index 6254f25..1954fe4 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/Test.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/Test.java @@ -1,5 +1,27 @@ package com.kbds.itamserveradmin.domain; -public class Test { - private String test; + +import com.kbds.itamserveradmin.global.exception.BaseException; +import com.kbds.itamserveradmin.global.exception.ErrorCode; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +class Test { + + @PostMapping("/test") + public ResponseEntity test(){ + boolean test = true; + + if(test) { + throw new BaseException(ErrorCode.INTERNAL_SERVER_ERROR); + } + + return ResponseEntity.ok("성공"); + + } + + + } diff --git a/src/main/java/com/kbds/itamserveradmin/global/Test2.java b/src/main/java/com/kbds/itamserveradmin/global/Test2.java index 768f659..8c07038 100644 --- a/src/main/java/com/kbds/itamserveradmin/global/Test2.java +++ b/src/main/java/com/kbds/itamserveradmin/global/Test2.java @@ -1,5 +1,9 @@ package com.kbds.itamserveradmin.global; + + + + public class Test2 { private String test2; } From 76c6cea792c36a1508816f81ffb5781a5ad98dd9 Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 11:51:02 +0900 Subject: [PATCH 06/30] =?UTF-8?q?chore:=20Asset=20=EC=97=B0=EA=B4=80?= =?UTF-8?q?=EA=B4=80=EA=B3=84=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/asset/entity/Asset.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java index cb249f9..d9c5c8c 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java @@ -1,14 +1,14 @@ package com.kbds.itamserveradmin.domain.asset.entity; +import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; +import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.ElementCollection; -import javax.persistence.Entity; -import javax.persistence.Id; +import javax.persistence.*; import java.util.ArrayList; import java.util.List; @@ -27,7 +27,13 @@ public class Asset { @ElementCollection private List astTag = new ArrayList<>(); + + @ManyToOne + @Column(name = 'corp_id' ) private Cooperation corp; + + @ManyToOne + @Column(name = 'user_id') private User user; private String astSwCtgy; @@ -37,7 +43,4 @@ public class Asset { private String astSpd; private String astDpd; - - - } From 3794ae59403cb4c34f50d1652ef49cbf1196d82e Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 11:53:32 +0900 Subject: [PATCH 07/30] =?UTF-8?q?chore:=20Asset=20=EC=97=B0=EA=B4=80?= =?UTF-8?q?=EA=B4=80=EA=B3=84=20=EC=84=A4=EC=A0=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kbds/itamserveradmin/domain/asset/entity/Asset.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java index d9c5c8c..56582ef 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java @@ -29,11 +29,11 @@ public class Asset { private List astTag = new ArrayList<>(); @ManyToOne - @Column(name = 'corp_id' ) + @JoinColumn(name = 'corp_id' ) private Cooperation corp; @ManyToOne - @Column(name = 'user_id') + @JoinColumn(name = 'user_id') private User user; private String astSwCtgy; From cffc15773432ef47a8fe548ec9a4d27b80c058a5 Mon Sep 17 00:00:00 2001 From: IkHyeon Date: Wed, 7 Feb 2024 12:00:35 +0900 Subject: [PATCH 08/30] =?UTF-8?q?feat=20:=20Contract=20=EC=97=B0=EA=B4=80?= =?UTF-8?q?=EA=B4=80=EA=B3=84=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/contract/entity/Contract.java | 18 +++++++++++++++--- .../domain/cooperation/entity/Cooperation.java | 5 +++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java index 6d49c9e..ef6aae5 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -1,12 +1,15 @@ package com.kbds.itamserveradmin.domain.contract.entity; +import com.kbds.itamserveradmin.domain.asset.entity.Asset; +import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; +import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequest; +import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Entity; -import javax.persistence.Id; +import javax.persistence.*; import java.time.LocalDateTime; @Entity @@ -19,11 +22,20 @@ public class Contract { private String contId; + @OneToOne + @JoinColumn(name = "ast_id") private Asset ast; + + @ManyToOne + @JoinColumn(name = "corp_id") private Cooperation corp; - private NewAstReq newAstReq; + + @OneToOne + private NewAssetRequest newAstReq; + private User user; + private String contLicTag; private int contPrice; private String contAdminName; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java index 44f611a..b21838f 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java @@ -1,5 +1,6 @@ package com.kbds.itamserveradmin.domain.cooperation.entity; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; import com.kbds.itamserveradmin.domain.department.entity.Department; import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; @@ -55,8 +56,8 @@ public class Cooperation { // @OneToMany(mappedBy ="cooperation") // private List assets = new ArrayList<>(); -// @OneToMany(mappedBy = "cooperation") -// private List contracts = new ArrayList<>(); + @OneToMany(mappedBy = "cooperation") + private List contracts = new ArrayList<>(); //==연관관계==// From 63f0e7a4d99ff0b56b59e88c3db10e0eb312b9fc Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 12:06:20 +0900 Subject: [PATCH 09/30] =?UTF-8?q?chore:=20AssetTag=20Enum=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/asset/entity/Asset.java | 9 +++------ .../domain/asset/entity/AstTag.java | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AstTag.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java index 56582ef..81be8be 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java @@ -21,19 +21,16 @@ public class Asset { @Id private Long astId; - private String astName; private Boolean isAstInternal; - - @ElementCollection - private List astTag = new ArrayList<>(); + private AstTag astTag; @ManyToOne - @JoinColumn(name = 'corp_id' ) + @JoinColumn(name = "corp_id" ) private Cooperation corp; @ManyToOne - @JoinColumn(name = 'user_id') + @JoinColumn(name = "user_id") private User user; private String astSwCtgy; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AstTag.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AstTag.java new file mode 100644 index 0000000..e1b3fd9 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AstTag.java @@ -0,0 +1,16 @@ +package com.kbds.itamserveradmin.domain.asset.entity; + +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum AstTag { + + DAS("데이타시스템"), BNK("국민은행"), ISR("손해보험"), CRD("국민카드"), STK("증권"), LIF("라이프"), + ASM("자산운용"), CAP("캐피탈"), RET("부동산신탁"), SAV("저축은행"), INV("인베스트먼트"); + + @JsonValue + private String value; +} From 20b2db48b400fd625a45b8bb1c19bbda264259b5 Mon Sep 17 00:00:00 2001 From: chaehuiseon Date: Wed, 7 Feb 2024 12:09:14 +0900 Subject: [PATCH 10/30] =?UTF-8?q?[FEAT][#2]=20Swagger,=20WebConfig=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EC=85=8B=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 16 +++++++ .../global/config/SwaggerConfig.java | 47 +++++++++++++++++++ .../global/config/WebConfig.java | 26 ++++++++++ .../global/constant/RoleType.java | 15 ++++++ .../global/resolver/authinfo/AuthInfo.java | 16 +++++++ .../resolver/authinfo/Authenticated.java | 11 +++++ .../authinfo/UserInfoArgumentResolver.java | 47 +++++++++++++++++++ src/main/resources/application.yml | 6 +++ 8 files changed, 184 insertions(+) create mode 100644 src/main/java/com/kbds/itamserveradmin/global/config/SwaggerConfig.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/config/WebConfig.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/constant/RoleType.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/AuthInfo.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/Authenticated.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/UserInfoArgumentResolver.java diff --git a/build.gradle b/build.gradle index fc91a8b..e7ae354 100644 --- a/build.gradle +++ b/build.gradle @@ -43,6 +43,22 @@ dependencies { + // Security, Authentication + // 시큐리티 추가 + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'io.jsonwebtoken:jjwt:0.9.1' + + // swagger 문서화 + implementation 'io.springfox:springfox-boot-starter:3.0.0' + implementation 'io.springfox:springfox-swagger-ui:3.0.0' + + + + // 이미지 S3 업로드 + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + + + } diff --git a/src/main/java/com/kbds/itamserveradmin/global/config/SwaggerConfig.java b/src/main/java/com/kbds/itamserveradmin/global/config/SwaggerConfig.java new file mode 100644 index 0000000..ed1cb4f --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/config/SwaggerConfig.java @@ -0,0 +1,47 @@ +package com.kbds.itamserveradmin.global.config; + + + +import com.fasterxml.classmate.TypeResolver; +import lombok.RequiredArgsConstructor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; + +import java.util.List; + +@Configuration +@EnableWebMvc +public class SwaggerConfig { + + private static final String API_NAME = "KB ITAM API"; + private static final String API_VERSION = "0.0.1"; + private static final String API_DESCRIPTION = "KB 금융그룹 ITAM API 명세서"; + + @Bean + public Docket api(){ + return new Docket(DocumentationType.OAS_30) + .useDefaultResponseMessages(true) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.basePackage("com.kbitam.api")) + .paths(PathSelectors.any()) + .build(); + } + + public ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title(API_NAME) + .version(API_VERSION) + .description(API_DESCRIPTION) + .build(); + } + + +} diff --git a/src/main/java/com/kbds/itamserveradmin/global/config/WebConfig.java b/src/main/java/com/kbds/itamserveradmin/global/config/WebConfig.java new file mode 100644 index 0000000..f06c686 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/config/WebConfig.java @@ -0,0 +1,26 @@ +package com.kbds.itamserveradmin.global.config; + + + +import com.kbds.itamserveradmin.global.resolver.authinfo.UserInfoArgumentResolver; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.List; + +@Configuration +public class WebConfig implements WebMvcConfigurer { + @Bean + public UserInfoArgumentResolver userInfoArgumentResolver() { + return new UserInfoArgumentResolver(); + } + + @Override + public void addArgumentResolvers(List resolvers) { + resolvers.add(userInfoArgumentResolver()); + WebMvcConfigurer.super.addArgumentResolvers(resolvers); + } +} + diff --git a/src/main/java/com/kbds/itamserveradmin/global/constant/RoleType.java b/src/main/java/com/kbds/itamserveradmin/global/constant/RoleType.java new file mode 100644 index 0000000..0015cf7 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/constant/RoleType.java @@ -0,0 +1,15 @@ +package com.kbds.itamserveradmin.global.constant; + + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum RoleType { + GUEST("ROLE_GUEST", "외부 사용자"), + USER("ROLE_USER", "일반 사용자"); + + private final String key; + private final String title; +} diff --git a/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/AuthInfo.java b/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/AuthInfo.java new file mode 100644 index 0000000..dc6ac67 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/AuthInfo.java @@ -0,0 +1,16 @@ +package com.kbds.itamserveradmin.global.resolver.authinfo; + + +import com.kbds.itamserveradmin.global.constant.RoleType; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.List; + +@AllArgsConstructor +@Getter +public class AuthInfo { + private String token; + private String email; + private List role; +} diff --git a/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/Authenticated.java b/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/Authenticated.java new file mode 100644 index 0000000..30fa058 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/Authenticated.java @@ -0,0 +1,11 @@ +package com.kbds.itamserveradmin.global.resolver.authinfo; + + + +import java.lang.annotation.*; + +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Authenticated { +} diff --git a/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/UserInfoArgumentResolver.java b/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/UserInfoArgumentResolver.java new file mode 100644 index 0000000..920d0be --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/resolver/authinfo/UserInfoArgumentResolver.java @@ -0,0 +1,47 @@ +package com.kbds.itamserveradmin.global.resolver.authinfo; + + + +import com.kbds.itamserveradmin.global.constant.RoleType; +import org.springframework.core.MethodParameter; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.web.bind.support.WebDataBinderFactory; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.method.support.ModelAndViewContainer; +import org.springframework.security.core.userdetails.UserDetails; + + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +public class UserInfoArgumentResolver implements HandlerMethodArgumentResolver { + @Override + public boolean supportsParameter(MethodParameter parameter) { + return parameter.getParameterAnnotation(Authenticated.class) != null && + parameter.getParameterType() == AuthInfo.class; + } + + @Override + public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { + UserDetails authentication = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + return new AuthInfo( + webRequest.getHeader("Authorization"), + authentication.getUsername(), + mapRolesFromAuthorities(authentication.getAuthorities()) + ); + } + + private List mapRolesFromAuthorities(Collection authorities) { + List roles = new ArrayList<>(); + Iterator iter = authorities.iterator(); + while (iter.hasNext()) { + roles.add(RoleType.valueOf(iter.next().getAuthority())); + } + return roles; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 4840a05..404c33b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -38,6 +38,12 @@ spring: # turn OSIV off open-in-view: false + + security: + user: + name: test + password: 1234 + #logging: # level: # org.hibernate.SQL: debug # 하이버네이트가 생성하는 SQL이 다보인다. From b22a9e77020e2dde209f28caed2a6293ac33fc08 Mon Sep 17 00:00:00 2001 From: IkHyeon Date: Wed, 7 Feb 2024 12:09:33 +0900 Subject: [PATCH 11/30] =?UTF-8?q?chore=20:=20Contract=20=C3=A3entity=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kbds/itamserveradmin/domain/contract/entity/Contract.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java index ef6aae5..454c95b 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -22,7 +22,7 @@ public class Contract { private String contId; - @OneToOne + @ManyToOne @JoinColumn(name = "ast_id") private Asset ast; @@ -33,6 +33,8 @@ public class Contract { @OneToOne private NewAssetRequest newAstReq; + @ManyToOne + @JoinColumn(name = "usr_id") private User user; From 872eaf314180500863f118ebd60c7b09b11e7827 Mon Sep 17 00:00:00 2001 From: UU_jeong <80961726+oU-Ua@users.noreply.github.com> Date: Wed, 7 Feb 2024 12:47:01 +0900 Subject: [PATCH 12/30] =?UTF-8?q?chore=20:=20fetch=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/AssetRequestManage.java | 3 ++- .../domain/cooperation/entity/Cooperation.java | 9 ++++++--- .../domain/department/entity/Department.java | 9 ++++++--- .../numOfUsersType/entity/NumOfUsersType.java | 1 + .../entity/NewAssetRequest.java | 3 ++- .../domain/user/entity/User.java | 18 ++++++++++++------ 6 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java index e3d49b7..31f887d 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java @@ -40,6 +40,7 @@ public class AssetRequestManage { @JoinColumn(name = "ast_req_id") private AssetRequest assetRequest; - @OneToMany(mappedBy = "assetRequestMange") + @OneToMany(mappedBy = "assetRequestMange",fetch = FetchType.LAZY) + @Builder.Default private List assetRequestManageLogs = new ArrayList<>(); } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java index b21838f..286571f 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java @@ -47,16 +47,19 @@ public class Cooperation { private boolean isSubCorp; //==연관관계==// - @OneToMany(mappedBy = "cooperation") + @OneToMany(mappedBy = "cooperation",fetch = FetchType.LAZY) + @Builder.Default private List departments = new ArrayList<>(); - @OneToMany(mappedBy = "cooperation") + @OneToMany(mappedBy = "cooperation",fetch = FetchType.LAZY) + @Builder.Default private List users = new ArrayList<>(); // @OneToMany(mappedBy ="cooperation") // private List assets = new ArrayList<>(); - @OneToMany(mappedBy = "cooperation") + @OneToMany(mappedBy = "cooperation",fetch = FetchType.LAZY) + @Builder.Default private List contracts = new ArrayList<>(); //==연관관계==// diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java index a60a141..b7f7af1 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java @@ -31,13 +31,16 @@ public class Department { @JoinColumn(name = "corp_id") private Cooperation cooperation; - @OneToMany(mappedBy = "department") + @OneToMany(mappedBy = "department",fetch = FetchType.LAZY) + @Builder.Default private List users = new ArrayList<>(); - @OneToMany(mappedBy = "department") + @OneToMany(mappedBy = "department",fetch = FetchType.LAZY) + @Builder.Default private List departmentAssets = new ArrayList<>(); - @OneToMany(mappedBy = "department") + @OneToMany(mappedBy = "department",fetch = FetchType.LAZY) + @Builder.Default private List newAssetRequests = new ArrayList<>(); //==연관관계==// } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java index fa642bf..afafb01 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java @@ -17,6 +17,7 @@ @Builder public class NumOfUsersType { + @Id @OneToOne @Column(name = "cont_id") private Contract cont; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java index ebd7656..70aa0ce 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java @@ -39,6 +39,7 @@ public class NewAssetRequest { @JoinColumn(name = "dept_id") private Department department; - @OneToMany(mappedBy = "newAssetRequest") + @OneToMany(mappedBy = "newAssetRequest",fetch = FetchType.LAZY) + @Builder.Default private List newAssetRequestAdmins = new ArrayList<>(); } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index 8fa87ba..24916ad 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -51,22 +51,28 @@ public class User { @JoinColumn(name = "corp_id") private Cooperation cooperation; - @OneToMany(mappedBy = "user") + @OneToMany(mappedBy = "user",fetch = FetchType.LAZY) + @Builder.Default private List userLogs = new ArrayList<>(); - @OneToMany(mappedBy = "writer") + @OneToMany(mappedBy = "writer",fetch = FetchType.LAZY) + @Builder.Default private List assetNotices = new ArrayList<>(); //==연관관계==// - @OneToMany(mappedBy = "manager") + @OneToMany(mappedBy = "manager",fetch = FetchType.LAZY) + @Builder.Default private List assetAdmins = new ArrayList<>(); - @OneToMany(mappedBy = "astRequestUser") + @OneToMany(mappedBy = "astRequestUser",fetch = FetchType.LAZY) + @Builder.Default private List assetRequests = new ArrayList<>(); - @OneToMany(mappedBy = "editor") + @OneToMany(mappedBy = "editor",fetch = FetchType.LAZY) + @Builder.Default private List contractLogs = new ArrayList<>(); - @OneToMany(mappedBy = "user") + @OneToMany(mappedBy = "user",fetch = FetchType.LAZY) + @Builder.Default private List newAssetRequestAdmins = new ArrayList<>(); } From 915e49a60f8fae5696d995812fe387315e9aca3b Mon Sep 17 00:00:00 2001 From: chaehuiseon Date: Wed, 7 Feb 2024 13:07:15 +0900 Subject: [PATCH 13/30] =?UTF-8?q?[CHORE][#1]=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../domain/assetRequest/entity/AssetRequestManage.java | 3 ++- .../domain/cooperation/entity/Cooperation.java | 2 +- .../domain/numOfUsersType/entity/NumOfUsersType.java | 7 ++----- src/main/resources/application.yml | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index e7ae354..93e67b4 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,7 @@ dependencies { // 이미지 S3 업로드 - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + //implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java index 31f887d..118609d 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java @@ -40,7 +40,8 @@ public class AssetRequestManage { @JoinColumn(name = "ast_req_id") private AssetRequest assetRequest; - @OneToMany(mappedBy = "assetRequestMange",fetch = FetchType.LAZY) + + @OneToMany(mappedBy = "assetRequestManage",fetch = FetchType.LAZY) @Builder.Default private List assetRequestManageLogs = new ArrayList<>(); } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java index 286571f..0fe019d 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java @@ -58,7 +58,7 @@ public class Cooperation { // @OneToMany(mappedBy ="cooperation") // private List assets = new ArrayList<>(); - @OneToMany(mappedBy = "cooperation",fetch = FetchType.LAZY) + @OneToMany(mappedBy = "corp",fetch = FetchType.LAZY) @Builder.Default private List contracts = new ArrayList<>(); diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java index afafb01..05a9db6 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java @@ -5,10 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.OneToOne; +import javax.persistence.*; @Entity @Data @@ -19,7 +16,7 @@ public class NumOfUsersType { @Id @OneToOne - @Column(name = "cont_id") + @JoinColumn(name = "cont_id") private Contract cont; private Integer maxUsersLimit; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 404c33b..48957c1 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -23,11 +23,11 @@ spring: jpa: hibernate: ddl-auto: create # create, update, none - naming: + #naming: #entity만들때, 변수명 그대로 데이터베이스 필드에 넣어주겠다. #만약, org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy 전략을 사용하겠다고 하면, #entity에서 변수명을 myEmail 이라고 하면, DB에 myEmail이 아닌 my_email로 만들어짐. - physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + #physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl use-new-id-generator-mappings: false #jpa 기본 numbering 전략을 따라가지 않겠다. properties: hibernate: From 72f6fa78127c059dcfd60bdbe8a9f0fa8ccbad6c Mon Sep 17 00:00:00 2001 From: UU_jeong <80961726+oU-Ua@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:08:27 +0900 Subject: [PATCH 14/30] =?UTF-8?q?chore=20:=20entity=20pk=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/numOfUsersType/entity/NumOfUsersType.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java index 05a9db6..2b2b4ed 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java @@ -15,6 +15,8 @@ public class NumOfUsersType { @Id + private String NumOfUsersId; + @OneToOne @JoinColumn(name = "cont_id") private Contract cont; From d52f92143774ba71162693830c51fa809c00cb43 Mon Sep 17 00:00:00 2001 From: chaehuiseon Date: Wed, 7 Feb 2024 13:13:10 +0900 Subject: [PATCH 15/30] =?UTF-8?q?=20ver1.0.0=20=EA=B8=B0=EB=B3=B8=EC=85=8B?= =?UTF-8?q?=ED=8C=85=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/kbds/itamserveradmin/domain/Test.java | 1 + .../domain/numOfUsersType/entity/NumOfUsersType.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/Test.java b/src/main/java/com/kbds/itamserveradmin/domain/Test.java index 1954fe4..770e22c 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/Test.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/Test.java @@ -13,6 +13,7 @@ class Test { @PostMapping("/test") public ResponseEntity test(){ boolean test = true; + System.out.println("시작"); if(test) { throw new BaseException(ErrorCode.INTERNAL_SERVER_ERROR); diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java index 2b2b4ed..0a63e89 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java @@ -29,4 +29,8 @@ public class NumOfUsersType { private Integer totalNumPur; private Integer totalServer; private Integer totalCal; + + + + } From 8c8f7565f3570ebb1e2f9e99f606c15284929ad4 Mon Sep 17 00:00:00 2001 From: dangnak2 <80161984+dangnak2@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:19:58 +0900 Subject: [PATCH 16/30] =?UTF-8?q?feat=20:=20=EA=B3=84=EC=95=BD=20=ED=99=9C?= =?UTF-8?q?=EB=8F=99=20=EA=B8=B0=EB=A1=9D=20Entity=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EB=B0=8F=20=EC=97=B0=EA=B4=80=EA=B4=80=EA=B3=84=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/contract/entity/Contract.java | 5 +++ .../domain/contract/entity/ContractLog.java | 38 ----------------- .../contract/entity/ContractRecord.java | 29 +++++++++++++ .../domain/contract/entity/RecordType.java | 24 +++++++++++ .../numOfUsersType/entity/NumOfUsersType.java | 3 +- .../domain/user/entity/User.java | 5 ++- .../global/entity/BaseEntity.java | 42 +++++++++++++++++++ .../global/exception/ErrorCode.java | 3 ++ src/main/resources/application.yml | 1 + 9 files changed, 110 insertions(+), 40 deletions(-) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractLog.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java create mode 100644 src/main/java/com/kbds/itamserveradmin/global/entity/BaseEntity.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java index 454c95b..77c0088 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -11,6 +11,8 @@ import javax.persistence.*; import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; @Entity @Data @@ -37,6 +39,9 @@ public class Contract { @JoinColumn(name = "usr_id") private User user; + @OneToMany(mappedBy = "contract", fetch = FetchType.LAZY) + private List records = new ArrayList<>(); + private String contLicTag; private int contPrice; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractLog.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractLog.java deleted file mode 100644 index 79f2310..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractLog.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.kbds.itamserveradmin.domain.contract.entity; - -import com.kbds.itamserveradmin.domain.user.entity.User; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import java.time.LocalDateTime; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class ContractLog { - @Id - private String ContLogId; - - private String ContLogContent; - private String ContLogType; - private LocalDateTime ContSud; - - - //==연관관계==// - - @ManyToOne - @JoinColumn(name = "editor_id") - private User editor; - -// @ManyToOne -// @JoinColumn(name = "contract_id") -// private Contract contract; -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java new file mode 100644 index 0000000..37a7a4f --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java @@ -0,0 +1,29 @@ +package com.kbds.itamserveradmin.domain.contract.entity; + +import com.kbds.itamserveradmin.domain.user.entity.User; +import com.kbds.itamserveradmin.global.entity.BaseEntity; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import javax.persistence.*; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class ContractRecord extends BaseEntity { + + @Id + private String contractRecordId; + + private String content; + + private RecordType recordType; + + @ManyToOne + @JoinColumn(nullable = false, name = "user_Id") + private User user; + + @ManyToOne + @JoinColumn(nullable = false, name = "contract_id") + private Contract contract; +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java new file mode 100644 index 0000000..4082d5e --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java @@ -0,0 +1,24 @@ +package com.kbds.itamserveradmin.domain.contract.entity; + + +import com.kbds.itamserveradmin.global.exception.BaseException; +import com.kbds.itamserveradmin.global.exception.ErrorCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; + +@Getter +@RequiredArgsConstructor +public enum RecordType { + FIELD_UPDATE("필드 변경"), + TITLE_UPDATE("제목 변경"), + ENTER("계약 체결"); + private final String value; + + public static RecordType getRecordTypeByName(String value) { + return Arrays.stream(RecordType.values()) + .filter(r -> r.getValue().equals(value)) + .findAny().orElseThrow(() -> new BaseException(ErrorCode.CONTRACT_RECORD_TYPE_NOT_FOUND)); + } +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java index 05a9db6..bb834f4 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java @@ -6,13 +6,14 @@ import lombok.NoArgsConstructor; import javax.persistence.*; +import java.io.Serializable; @Entity @Data @NoArgsConstructor @AllArgsConstructor @Builder -public class NumOfUsersType { +public class NumOfUsersType implements Serializable { @Id @OneToOne diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index 24916ad..811f8bb 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -3,7 +3,7 @@ import com.kbds.itamserveradmin.domain.asset.entity.AssetNotice; import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequest; -import com.kbds.itamserveradmin.domain.contract.entity.ContractLog; +import com.kbds.itamserveradmin.domain.contract.entity.ContractRecord; import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; import com.kbds.itamserveradmin.domain.department.entity.Department; import lombok.AllArgsConstructor; @@ -75,4 +75,7 @@ public class User { @OneToMany(mappedBy = "user",fetch = FetchType.LAZY) @Builder.Default private List newAssetRequestAdmins = new ArrayList<>(); + + @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) + private List records = new ArrayList<>(); } diff --git a/src/main/java/com/kbds/itamserveradmin/global/entity/BaseEntity.java b/src/main/java/com/kbds/itamserveradmin/global/entity/BaseEntity.java new file mode 100644 index 0000000..4909bac --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/global/entity/BaseEntity.java @@ -0,0 +1,42 @@ +package com.kbds.itamserveradmin.global.entity; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import javax.persistence.Column; +import javax.persistence.MappedSuperclass; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Getter +@MappedSuperclass +public class BaseEntity implements Serializable { + + @CreatedDate + @Column(nullable = false, updatable = false) + private LocalDateTime createdAt; + + @LastModifiedDate + private LocalDateTime updateAt; + + @Setter + @Column(nullable = false, columnDefinition = "BOOLEAN DEFAULT true") + private Boolean isEnable = true; + + @PrePersist + public void prePersist() { + LocalDateTime now = LocalDateTime.now(); + createdAt = now; + updateAt = now; + } + + @PreUpdate + public void preUpdate() { + updateAt = LocalDateTime.now(); + } + +} + diff --git a/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java b/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java index 97f26f2..4da812c 100644 --- a/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java +++ b/src/main/java/com/kbds/itamserveradmin/global/exception/ErrorCode.java @@ -10,12 +10,15 @@ @Getter public enum ErrorCode { + // contract + CONTRACT_RECORD_TYPE_NOT_FOUND(HttpStatus.NOT_FOUND, "C-001", "활동 기록 타입을 찾을 수 없습니다."), //기타 INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "I-001", "내부 에러가 발생했습니다."); + private final HttpStatus httpStatus; private final String code; private final String message; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 48957c1..11e8d89 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -37,6 +37,7 @@ spring: use_sql_comments: true #querydsl jpql 보기 # turn OSIV off open-in-view: false + database: mysql security: From dd7f5a53200673b4726cdcce9f04e8e327533c39 Mon Sep 17 00:00:00 2001 From: dangnak2 <80161984+dangnak2@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:20:54 +0900 Subject: [PATCH 17/30] =?UTF-8?q?feat=20:=20=ED=9A=8C=EC=82=AC=20Entity=20?= =?UTF-8?q?=EC=82=AC=EC=97=85=EC=9E=90=20=EB=B2=88=ED=98=B8=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itamserveradmin/domain/cooperation/entity/Cooperation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java index 0fe019d..b841ee9 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java @@ -26,7 +26,7 @@ public class Cooperation { private String corpName; @Column(name = "crn") - private String crn; // 사업자 번호가 list인가요 ?! + private String corpNum; @Column(name = "corp_contact") private String corpContact; From 39993c0167195f8fb0657620d9d4d5591428e323 Mon Sep 17 00:00:00 2001 From: dangnak2 <80161984+dangnak2@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:22:38 +0900 Subject: [PATCH 18/30] =?UTF-8?q?feat=20:=20=EA=B8=B0=ED=9A=8D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20AssetPurchas?= =?UTF-8?q?eRequest=20Entity=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/AssetPurchaseRequest.java | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/AssetPurchaseRequest.java b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/AssetPurchaseRequest.java index 4c9224b..5dbdc9d 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/AssetPurchaseRequest.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/AssetPurchaseRequest.java @@ -1,43 +1,43 @@ -package com.kbds.itamserveradmin.domain.purchaseRequest.entity; - -import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.*; -import java.time.LocalDateTime; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class AssetPurchaseRequest { - @Id - @Column(name = "ast_pur_req_id)") - private String astPurReqId; - - @Column(name = "ast_pur_req_name") - private String astPurReqName; - - @Enumerated(EnumType.STRING) - private PurchaseRequestStatus astPurReqStatus; - - private Long astPurReqLicCnt; - private LocalDateTime astPurReqContStartDate; - private LocalDateTime astPurReqContEndDate; - private LocalDateTime astPurReqDate; - private String astPurReqVer; - - //==연관관계==// - @ManyToOne - @JoinColumn(name = "corp_id") - private Cooperation cooperation; - +//package com.kbds.itamserveradmin.domain.purchaseRequest.entity; +// +//import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +//import javax.persistence.*; +//import java.time.LocalDateTime; +// +//@Entity +//@Data +//@NoArgsConstructor +//@AllArgsConstructor +//@Builder +//public class AssetPurchaseRequest { +// @Id +// @Column(name = "ast_pur_req_id)") +// private String astPurReqId; +// +// @Column(name = "ast_pur_req_name") +// private String astPurReqName; +// +// @Enumerated(EnumType.STRING) +// private PurchaseRequestStatus astPurReqStatus; +// +// private Long astPurReqLicCnt; +// private LocalDateTime astPurReqContStartDate; +// private LocalDateTime astPurReqContEndDate; +// private LocalDateTime astPurReqDate; +// private String astPurReqVer; +// +// //==연관관계==// // @ManyToOne -// @JoinColumn(name = "ast_id") -// private Asset asset; - //==연관관계==// -} +// @JoinColumn(name = "corp_id") +// private Cooperation cooperation; +// +//// @ManyToOne +//// @JoinColumn(name = "ast_id") +//// private Asset asset; +// //==연관관계==// +//} From fca22743b287ca596c359025cf37c31c73c4779e Mon Sep 17 00:00:00 2001 From: dangnak2 <80161984+dangnak2@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:27:21 +0900 Subject: [PATCH 19/30] =?UTF-8?q?feat=20:=20=EC=9C=A0=EC=A0=80=20&=20?= =?UTF-8?q?=EA=B3=84=EC=95=BD=20=ED=99=9C=EB=8F=99=20=EA=B8=B0=EB=A1=9D=20?= =?UTF-8?q?entity=20=EC=97=B0=EA=B4=80=20=EA=B4=80=EA=B3=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kbds/itamserveradmin/domain/user/entity/User.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index 811f8bb..2d72758 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -68,10 +68,6 @@ public class User { @Builder.Default private List assetRequests = new ArrayList<>(); - @OneToMany(mappedBy = "editor",fetch = FetchType.LAZY) - @Builder.Default - private List contractLogs = new ArrayList<>(); - @OneToMany(mappedBy = "user",fetch = FetchType.LAZY) @Builder.Default private List newAssetRequestAdmins = new ArrayList<>(); From a095218b627de59208f93bd0374070bd5b3624b5 Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 18:44:02 +0900 Subject: [PATCH 20/30] =?UTF-8?q?chore:=20BaseEntity=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/assetRequest/entity/AssetRequest.java | 1 + .../domain/assetRequest/entity/AssetRequestLog.java | 5 ++--- .../domain/assetRequest/entity/AssetRequestManage.java | 6 ++---- .../domain/assetRequest/entity/AssetRequestManageLog.java | 5 ++--- .../itamserveradmin/domain/contract/entity/Contract.java | 6 ++++-- .../com/kbds/itamserveradmin/domain/user/entity/User.java | 3 ++- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java index 16d21e7..616430c 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java @@ -2,6 +2,7 @@ import com.kbds.itamserveradmin.domain.assetRequest.entity.RequestStatus; import com.kbds.itamserveradmin.domain.user.entity.User; +import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java index c61d395..2b89a0a 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java @@ -1,6 +1,7 @@ package com.kbds.itamserveradmin.domain.assetRequest.entity; import com.kbds.itamserveradmin.domain.user.entity.User; +import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -14,7 +15,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class AssetRequestLog { +public class AssetRequestLog extends BaseEntity { @Id @Column(name = "ast_req_log_id") private String astReqLogId; @@ -22,8 +23,6 @@ public class AssetRequestLog { @Enumerated(EnumType.STRING) private RequestStatus astReqLogStatus; - private LocalDateTime astReqSud; - private String astReqVer; private String astReqName; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java index 118609d..9ba3844 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java @@ -1,6 +1,7 @@ package com.kbds.itamserveradmin.domain.assetRequest.entity; import com.kbds.itamserveradmin.domain.user.entity.AssetAdmin; +import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -17,13 +18,10 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class AssetRequestManage { +public class AssetRequestManage extends BaseEntity { @Id private String astReqMgId; - private LocalDateTime astReqMgDate; - private LocalDateTime astReqMgSud; - @Enumerated(EnumType.STRING) private RequestMangeStatus astReqMgStatus; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java index 1e8bfb2..49bc5c6 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java @@ -1,5 +1,6 @@ package com.kbds.itamserveradmin.domain.assetRequest.entity; +import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -13,12 +14,10 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class AssetRequestManageLog { +public class AssetRequestManageLog extends BaseEntity { @Id private String astReqMgLogId; - private LocalDateTime astReqMgLogSud; - @Enumerated(EnumType.STRING) private RequestMangeStatus astReqMgLogStatus; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java index 77c0088..13fbc1c 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -4,6 +4,7 @@ import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequest; import com.kbds.itamserveradmin.domain.user.entity.User; +import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,7 +20,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class Contract { +public class Contract extends BaseEntity { @Id private String contId; @@ -48,8 +49,9 @@ public class Contract { private String contAdminName; private String contVer; private OpStatus contOpStatus; - private LocalDateTime contRegDate; private String contName; + + } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index 2d72758..b972618 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -6,6 +6,7 @@ import com.kbds.itamserveradmin.domain.contract.entity.ContractRecord; import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; import com.kbds.itamserveradmin.domain.department.entity.Department; +import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -20,7 +21,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class User { +public class User extends BaseEntity { @Id @Column(name = "user_id") private String userId; From 0714c028c34d3e3568efa25f78312f30660ec6f2 Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 19:22:52 +0900 Subject: [PATCH 21/30] =?UTF-8?q?chore:=20Entity=20Time=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assetRequest/entity/AssetRequestLog.java | 14 ++++++++++++-- .../entity/AssetRequestManage.java | 18 +++++++++++++++++- .../entity/AssetRequestManageLog.java | 17 +++++++++++++++-- .../domain/contract/entity/Contract.java | 12 +++++++----- 4 files changed, 51 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java index 2b89a0a..84ad2d5 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java @@ -15,7 +15,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class AssetRequestLog extends BaseEntity { +public class AssetRequestLog { @Id @Column(name = "ast_req_log_id") private String astReqLogId; @@ -29,7 +29,7 @@ public class AssetRequestLog extends BaseEntity { private Long astReqCnt; - + private LocalDateTime astReqSud; //==연관관계==// @ManyToOne @JoinColumn(name = "ast_req_id") @@ -40,4 +40,14 @@ public class AssetRequestLog extends BaseEntity { private User assetRequestUser; //==연관관계==// + @PrePersist + public void prePersist() { + LocalDateTime now = LocalDateTime.now(); + astReqSud = now; + } + + @PreUpdate + public void preUpdate() { + astReqSud = LocalDateTime.now(); + } } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java index 9ba3844..06f8580 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java @@ -18,13 +18,16 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class AssetRequestManage extends BaseEntity { +public class AssetRequestManage { @Id private String astReqMgId; @Enumerated(EnumType.STRING) private RequestMangeStatus astReqMgStatus; + private LocalDateTime astReqMgDate; + private LocalDateTime astReqMgSud; + private String astReqDept; private String astReqName; @@ -42,4 +45,17 @@ public class AssetRequestManage extends BaseEntity { @OneToMany(mappedBy = "assetRequestManage",fetch = FetchType.LAZY) @Builder.Default private List assetRequestManageLogs = new ArrayList<>(); + + @PrePersist + public void prePersist() { + LocalDateTime now = LocalDateTime.now(); + astReqMgDate = now; + astReqMgSud = now; + } + + @PreUpdate + public void preUpdate() { + astReqMgSud = LocalDateTime.now(); + } + } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java index 49bc5c6..6e26c9c 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java @@ -14,7 +14,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class AssetRequestManageLog extends BaseEntity { +public class AssetRequestManageLog { @Id private String astReqMgLogId; @@ -23,6 +23,7 @@ public class AssetRequestManageLog extends BaseEntity { private String astReqName; + private LocalDateTime astReqMgLogSud; //==연관관계==// @@ -30,6 +31,18 @@ public class AssetRequestManageLog extends BaseEntity { @JoinColumn(name = "ast_req_mg_id") private AssetRequestManage assetRequestManage; - //==연관관계==// + @PrePersist + public void prePersist() { + LocalDateTime now = LocalDateTime.now(); + astReqMgLogSud = now; + } + + @PreUpdate + public void preUpdate() { + astReqMgLogSud = LocalDateTime.now(); + } + + + } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java index 13fbc1c..8f7f693 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -20,11 +20,10 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class Contract extends BaseEntity { +public class Contract { @Id private String contId; - @ManyToOne @JoinColumn(name = "ast_id") private Asset ast; @@ -43,7 +42,7 @@ public class Contract extends BaseEntity { @OneToMany(mappedBy = "contract", fetch = FetchType.LAZY) private List records = new ArrayList<>(); - + private LocalDateTime contRegDate; private String contLicTag; private int contPrice; private String contAdminName; @@ -51,7 +50,10 @@ public class Contract extends BaseEntity { private OpStatus contOpStatus; private String contName; - - + @PrePersist + public void prePersist() { + LocalDateTime now = LocalDateTime.now(); + contRegDate = now; + } } From 5bf2eeaf78e3a018b4fc24670d274ecb578d4004 Mon Sep 17 00:00:00 2001 From: IkHyeon Date: Wed, 7 Feb 2024 20:59:20 +0900 Subject: [PATCH 22/30] =?UTF-8?q?feat=20:=20=C3=A3=C2=85Period=20dType=20t?= =?UTF-8?q?ity=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KbdsItamServerAdminApplication.java | 3 +- .../com/kbds/itamserveradmin/domain/Test.java | 4 +- .../entity/PeriodType.java} | 18 ++++----- .../numOfUsersType/entity/NumOfUsersType.java | 37 ------------------- src/main/resources/application.yml | 4 +- 5 files changed, 14 insertions(+), 52 deletions(-) rename src/main/java/com/kbds/itamserveradmin/domain/{supplyType/entity/SupplyType.java => contract/entity/PeriodType.java} (54%) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java diff --git a/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java b/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java index b91abd3..a7804f0 100644 --- a/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java +++ b/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java @@ -2,8 +2,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -@SpringBootApplication +@SpringBootApplication(exclude = SecurityAutoConfiguration.class) public class KbdsItamServerAdminApplication { public static void main(String[] args) { diff --git a/src/main/java/com/kbds/itamserveradmin/domain/Test.java b/src/main/java/com/kbds/itamserveradmin/domain/Test.java index 770e22c..27de1b3 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/Test.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/Test.java @@ -13,13 +13,13 @@ class Test { @PostMapping("/test") public ResponseEntity test(){ boolean test = true; - System.out.println("시작"); + System.out.println("start"); if(test) { throw new BaseException(ErrorCode.INTERNAL_SERVER_ERROR); } - return ResponseEntity.ok("성공"); + return ResponseEntity.ok("success"); } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/PeriodType.java similarity index 54% rename from src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/entity/PeriodType.java index 888a8d4..c3aa7e4 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/PeriodType.java @@ -1,5 +1,5 @@ -package com.kbds.itamserveradmin.domain.supplyType.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; +package com.kbds.itamserveradmin.domain.contract.entity; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,24 +9,22 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import java.time.LocalDateTime; @Entity @Data @NoArgsConstructor @AllArgsConstructor @Builder -public class SupplyType { - +public class PeriodType { @Id - private String splyId; + private Long periodId; @OneToOne @JoinColumn(name = "cont_id") private Contract cont; - private String splyInstallFile; - private String splyInstallGuide; - private String acsUrl; - private String splyVer; - private String splyUserGuide; + private LocalDateTime contStartDate; + + private LocalDateTime contEndDate; } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java deleted file mode 100644 index 0fddd2b..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.kbds.itamserveradmin.domain.numOfUsersType.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.*; -import java.io.Serializable; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class NumOfUsersType implements Serializable { - - @Id - private String NumOfUsersId; - - @OneToOne - @JoinColumn(name = "cont_id") - private Contract cont; - - private Integer maxUsersLimit; - private Integer maxCpuLimit; - private String ipRange; - private Integer currUsers; - private Integer currCpu; - private Integer totalNumPur; - private Integer totalServer; - private Integer totalCal; - - - - -} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 11e8d89..c511f04 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -14,9 +14,9 @@ spring: datasource: platform: mysql - url: jdbc:mysql://localhost:3306/kbds?serverTimezone=Asia/Seoul&characterEncoding=UTF-8 + url: jdbc:mysql://localhost:3306/kb?serverTimezone=Asia/Seoul&characterEncoding=UTF-8 username: root - password: smilechs5542 + password: Whdlrgus99@ driver-class-name: com.mysql.cj.jdbc.Driver # mysql 8버전 From ac732ab34eef2cacf1edbfe6cbf39d2a5088f390 Mon Sep 17 00:00:00 2001 From: UU_jeong <80961726+oU-Ua@users.noreply.github.com> Date: Wed, 7 Feb 2024 21:23:09 +0900 Subject: [PATCH 23/30] =?UTF-8?q?feat=20:=20user,=20purchase=20Repository?= =?UTF-8?q?=20=EC=84=A4=EA=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itamserveradmin/KbdsItamServerAdminApplication.java | 3 ++- .../repository/NewAssetRequestLogRepository.java | 7 +++++++ .../repository/NewAssetRequestRepository.java | 7 +++++++ .../domain/user/repository/AssetAdminRepository.java | 7 +++++++ .../domain/user/repository/NewAssetRequestAdmin.java | 6 ++++++ .../domain/user/repository/UserLogRepository.java | 7 +++++++ .../domain/user/repository/UserRepository.java | 7 +++++++ 7 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestLogRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/repository/AssetAdminRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserLogRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserRepository.java diff --git a/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java b/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java index b91abd3..a7804f0 100644 --- a/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java +++ b/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java @@ -2,8 +2,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -@SpringBootApplication +@SpringBootApplication(exclude = SecurityAutoConfiguration.class) public class KbdsItamServerAdminApplication { public static void main(String[] args) { diff --git a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestLogRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestLogRepository.java new file mode 100644 index 0000000..1c2064d --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestLogRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.purchaseRequest.repository; + +import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequestLog; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface NewAssetRequestLogRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestRepository.java new file mode 100644 index 0000000..9274147 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/repository/NewAssetRequestRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.purchaseRequest.repository; + +import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequest; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface NewAssetRequestRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/repository/AssetAdminRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/AssetAdminRepository.java new file mode 100644 index 0000000..f88190c --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/AssetAdminRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.user.repository; + +import com.kbds.itamserveradmin.domain.user.entity.AssetAdmin; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssetAdminRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java new file mode 100644 index 0000000..0a607d3 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java @@ -0,0 +1,6 @@ +package com.kbds.itamserveradmin.domain.user.repository; + +import org.springframework.data.jpa.repository.JpaRepository; + +public interface NewAssetRequestAdmin extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserLogRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserLogRepository.java new file mode 100644 index 0000000..fe09c2a --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserLogRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.user.repository; + +import com.kbds.itamserveradmin.domain.user.entity.UserLog; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UserLogRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserRepository.java new file mode 100644 index 0000000..7d8305c --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/UserRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.user.repository; + +import com.kbds.itamserveradmin.domain.user.entity.User; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UserRepository extends JpaRepository { +} From 9ddfc1007d5d5d94944f347f96de88ea59d8c25e Mon Sep 17 00:00:00 2001 From: IkHyeon Date: Wed, 7 Feb 2024 21:23:23 +0900 Subject: [PATCH 24/30] =?UTF-8?q?feat=20:=20contract,=20corporation,=20dep?= =?UTF-8?q?artment=20=C3=A3=C2=85=EC=9D=98=20repository=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/contract/controller/ContractController.java | 10 ++++++++++ .../domain/contract/repository/CALKeyRepository.java | 8 ++++++++ .../contract/repository/ContractRecordRepository.java | 8 ++++++++ .../domain/contract/repository/ContractRepository.java | 7 +++++++ .../contract/repository/LicenseKeyRepository.java | 8 ++++++++ .../contract/repository/NumOfUsersTypeRepository.java | 7 +++++++ .../contract/repository/PeriodTypeRepository.java | 8 ++++++++ .../contract/repository/SupplyTypeRepository.java | 8 ++++++++ .../controller/CooperationController.java | 0 .../entity/Corporation.java} | 0 .../repository/CorporationRepository.java} | 0 .../service/CooperationService.java | 0 .../service/CooperationServiceImpl.java | 0 .../repository/DepartmentAssetRepository.java | 8 ++++++++ .../department/repository/DepartmentRepository.java | 9 +++++++++ 15 files changed, 81 insertions(+) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/controller/ContractController.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/CALKeyRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRecordRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/LicenseKeyRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/NumOfUsersTypeRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/PeriodTypeRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/SupplyTypeRepository.java rename src/main/java/com/kbds/itamserveradmin/domain/{cooperation => corperation}/controller/CooperationController.java (100%) rename src/main/java/com/kbds/itamserveradmin/domain/{cooperation/entity/Cooperation.java => corperation/entity/Corporation.java} (100%) rename src/main/java/com/kbds/itamserveradmin/domain/{cooperation/repository/CooperationRepository.java => corperation/repository/CorporationRepository.java} (100%) rename src/main/java/com/kbds/itamserveradmin/domain/{cooperation => corperation}/service/CooperationService.java (100%) rename src/main/java/com/kbds/itamserveradmin/domain/{cooperation => corperation}/service/CooperationServiceImpl.java (100%) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentAssetRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentRepository.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/controller/ContractController.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/controller/ContractController.java new file mode 100644 index 0000000..97a5acf --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/controller/ContractController.java @@ -0,0 +1,10 @@ +package com.kbds.itamserveradmin.domain.contract.controller; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RestController; + +@Slf4j +@RestController + +public class ContractController { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/CALKeyRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/CALKeyRepository.java new file mode 100644 index 0000000..8a56e3b --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/CALKeyRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.contract.repository; + +import com.kbds.itamserveradmin.domain.contract.entity.CALKey; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface CALKeyRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRecordRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRecordRepository.java new file mode 100644 index 0000000..e20b0b8 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRecordRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.contract.repository; + +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.entity.ContractRecord; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ContractRecordRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRepository.java new file mode 100644 index 0000000..4374c00 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/ContractRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.contract.repository; + +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ContractRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/LicenseKeyRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/LicenseKeyRepository.java new file mode 100644 index 0000000..8098da5 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/LicenseKeyRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.contract.repository; + +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.entity.LicenseKey; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface LicenseKeyRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/NumOfUsersTypeRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/NumOfUsersTypeRepository.java new file mode 100644 index 0000000..e6544bb --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/NumOfUsersTypeRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.contract.repository; + +import com.kbds.itamserveradmin.domain.contract.entity.NumOfUsersType; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface NumOfUsersTypeRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/PeriodTypeRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/PeriodTypeRepository.java new file mode 100644 index 0000000..60a7aff --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/PeriodTypeRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.contract.repository; + +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.entity.PeriodType; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface PeriodTypeRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/SupplyTypeRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/SupplyTypeRepository.java new file mode 100644 index 0000000..cbade79 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/SupplyTypeRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.contract.repository; + +import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.entity.SupplyType; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface SupplyTypeRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/controller/CooperationController.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/controller/CooperationController.java similarity index 100% rename from src/main/java/com/kbds/itamserveradmin/domain/cooperation/controller/CooperationController.java rename to src/main/java/com/kbds/itamserveradmin/domain/corperation/controller/CooperationController.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/entity/Corporation.java similarity index 100% rename from src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java rename to src/main/java/com/kbds/itamserveradmin/domain/corperation/entity/Corporation.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/repository/CooperationRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/repository/CorporationRepository.java similarity index 100% rename from src/main/java/com/kbds/itamserveradmin/domain/cooperation/repository/CooperationRepository.java rename to src/main/java/com/kbds/itamserveradmin/domain/corperation/repository/CorporationRepository.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationService.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationService.java similarity index 100% rename from src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationService.java rename to src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationService.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationServiceImpl.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationServiceImpl.java similarity index 100% rename from src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationServiceImpl.java rename to src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationServiceImpl.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentAssetRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentAssetRepository.java new file mode 100644 index 0000000..1d970e2 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentAssetRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.department.repository; + +import com.kbds.itamserveradmin.domain.department.entity.DepartmentAsset; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface DepartmentAssetRepository extends JpaRepository { + +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentRepository.java new file mode 100644 index 0000000..bfada86 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/repository/DepartmentRepository.java @@ -0,0 +1,9 @@ +package com.kbds.itamserveradmin.domain.department.repository; + +import com.kbds.itamserveradmin.domain.department.entity.Department; +import com.kbds.itamserveradmin.domain.department.entity.DepartmentAsset; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface DepartmentRepository extends JpaRepository { + +} From 1779e05689ba51f5e5c73589e2121c6d5a5e8866 Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 21:26:48 +0900 Subject: [PATCH 25/30] =?UTF-8?q?feat:=20Asset=20Repository=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KbdsItamServerAdminApplication.java | 3 ++- .../domain/asset/controller/AssetController.java | 7 +++++++ .../itamserveradmin/domain/asset/dto/AssetReq.java | 7 +++++++ .../itamserveradmin/domain/asset/dto/AssetRes.java | 8 ++++++++ .../itamserveradmin/domain/asset/entity/Asset.java | 2 +- .../domain/asset/repository/AssetNoticeRepository.java | 7 +++++++ .../domain/asset/repository/AssetRepository.java | 7 +++++++ .../domain/asset/repository/ManualLogRepository.java | 7 +++++++ .../domain/asset/service/AssetService.java | 10 ++++++++++ .../repository/AssetRequestLogRepository.java | 7 +++++++ .../repository/AssetRequestManageLogRepository.java | 7 +++++++ .../repository/AssetRequestManageRepository.java | 7 +++++++ .../repository/AssetRequestRepository.java | 7 +++++++ .../repository/UserAssetRequestInfoRepository.java | 8 ++++++++ .../domain/contract/entity/OpStatus.java | 5 ----- .../contract/{ => repository}/entity/CALKey.java | 2 +- .../contract/{ => repository}/entity/Contract.java | 3 +-- .../{ => repository}/entity/ContractRecord.java | 2 +- .../contract/{ => repository}/entity/KeyStatus.java | 2 +- .../contract/{ => repository}/entity/LicenseKey.java | 4 +--- .../domain/contract/repository/entity/OpStatus.java | 5 +++++ .../contract/{ => repository}/entity/RecordType.java | 2 +- .../contract/repository/service/ContractService.java | 7 +++++++ .../domain/cooperation/entity/Cooperation.java | 2 +- .../department/controller/DepartmentController.java | 4 ++++ .../domain/department/service/DepartmentService.java | 8 ++++++++ .../domain/numOfUsersType/entity/NumOfUsersType.java | 2 +- .../domain/supplyType/entity/SupplyType.java | 2 +- .../kbds/itamserveradmin/domain/user/entity/User.java | 2 +- 29 files changed, 126 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/controller/AssetController.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetReq.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetRes.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetNoticeRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/repository/ManualLogRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/asset/service/AssetService.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestLogRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageLogRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/UserAssetRequestInfoRepository.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java rename src/main/java/com/kbds/itamserveradmin/domain/contract/{ => repository}/entity/CALKey.java (86%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{ => repository}/entity/Contract.java (92%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{ => repository}/entity/ContractRecord.java (90%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{ => repository}/entity/KeyStatus.java (79%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{ => repository}/entity/LicenseKey.java (77%) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java rename src/main/java/com/kbds/itamserveradmin/domain/contract/{ => repository}/entity/RecordType.java (91%) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/service/ContractService.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/department/service/DepartmentService.java diff --git a/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java b/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java index b91abd3..a7804f0 100644 --- a/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java +++ b/src/main/java/com/kbds/itamserveradmin/KbdsItamServerAdminApplication.java @@ -2,8 +2,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -@SpringBootApplication +@SpringBootApplication(exclude = SecurityAutoConfiguration.class) public class KbdsItamServerAdminApplication { public static void main(String[] args) { diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/controller/AssetController.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/controller/AssetController.java new file mode 100644 index 0000000..b24a037 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/controller/AssetController.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.asset.controller; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class AssetController { + +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetReq.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetReq.java new file mode 100644 index 0000000..17c657b --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetReq.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.asset.dto; + +import lombok.Data; + +@Data +public class AssetReq { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetRes.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetRes.java new file mode 100644 index 0000000..3554e04 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/dto/AssetRes.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.asset.dto; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class AssetRes { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java index 81be8be..86060e2 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java @@ -20,7 +20,7 @@ public class Asset { @Id - private Long astId; + private String astId; private String astName; private Boolean isAstInternal; private AstTag astTag; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetNoticeRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetNoticeRepository.java new file mode 100644 index 0000000..c086076 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetNoticeRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.asset.repository; + +import com.kbds.itamserveradmin.domain.asset.entity.AssetNotice; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssetNoticeRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetRepository.java new file mode 100644 index 0000000..f2cf2e2 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/AssetRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.asset.repository; + +import com.kbds.itamserveradmin.domain.asset.entity.Asset; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssetRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/ManualLogRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/ManualLogRepository.java new file mode 100644 index 0000000..f8900cf --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/repository/ManualLogRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.asset.repository; + +import com.kbds.itamserveradmin.domain.asset.entity.ManualLog; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ManualLogRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/service/AssetService.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/service/AssetService.java new file mode 100644 index 0000000..701fcc9 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/service/AssetService.java @@ -0,0 +1,10 @@ +package com.kbds.itamserveradmin.domain.asset.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class AssetService { + +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestLogRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestLogRepository.java new file mode 100644 index 0000000..d55ea76 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestLogRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.assetRequest.repository; + +import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequestLog; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssetRequestLogRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageLogRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageLogRepository.java new file mode 100644 index 0000000..90c1045 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageLogRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.assetRequest.repository; + +import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequestManageLog; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssetRequestManageLogRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageRepository.java new file mode 100644 index 0000000..4d6d938 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestManageRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.assetRequest.repository; + +import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequestManage; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssetRequestManageRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestRepository.java new file mode 100644 index 0000000..17b2e6a --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/AssetRequestRepository.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.assetRequest.repository; + +import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequest; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssetRequestRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/UserAssetRequestInfoRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/UserAssetRequestInfoRepository.java new file mode 100644 index 0000000..32241da --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/repository/UserAssetRequestInfoRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.assetRequest.repository; + +import com.kbds.itamserveradmin.domain.assetRequest.entity.UserAssetRequestInfo; +import org.springframework.data.jpa.repository.JpaRepository; + + +public interface UserAssetRequestInfoRepository extends JpaRepository { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java deleted file mode 100644 index cc1dddd..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.kbds.itamserveradmin.domain.contract.entity; - -public enum OpStatus { - IN_OPERATION, IN_DISPOSAL -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/CALKey.java similarity index 86% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/CALKey.java index 64434cd..5ea17c0 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/CALKey.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.entity; +package com.kbds.itamserveradmin.domain.contract.repository.entity; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java similarity index 92% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java index 8f7f693..9186139 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java @@ -1,10 +1,9 @@ -package com.kbds.itamserveradmin.domain.contract.entity; +package com.kbds.itamserveradmin.domain.contract.repository.entity; import com.kbds.itamserveradmin.domain.asset.entity.Asset; import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequest; import com.kbds.itamserveradmin.domain.user.entity.User; -import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/ContractRecord.java similarity index 90% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/ContractRecord.java index 37a7a4f..0a91c17 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/ContractRecord.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.entity; +package com.kbds.itamserveradmin.domain.contract.repository.entity; import com.kbds.itamserveradmin.domain.user.entity.User; import com.kbds.itamserveradmin.global.entity.BaseEntity; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/KeyStatus.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/KeyStatus.java similarity index 79% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/entity/KeyStatus.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/KeyStatus.java index 25833a5..376e1d6 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/KeyStatus.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/KeyStatus.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.entity; +package com.kbds.itamserveradmin.domain.contract.repository.entity; import com.fasterxml.jackson.annotation.JsonValue; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/LicenseKey.java similarity index 77% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/LicenseKey.java index 7ea8b4f..79e8d16 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/LicenseKey.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.entity; +package com.kbds.itamserveradmin.domain.contract.repository.entity; import lombok.AllArgsConstructor; import lombok.Builder; @@ -7,8 +7,6 @@ import javax.persistence.Entity; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; @Entity @Data diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java new file mode 100644 index 0000000..fe697f5 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java @@ -0,0 +1,5 @@ +package com.kbds.itamserveradmin.domain.contract.repository.entity; + +public enum OpStatus { + IN_OPERATION, IN_DISPOSAL +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/RecordType.java similarity index 91% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/RecordType.java index 4082d5e..e4df57c 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/RecordType.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.entity; +package com.kbds.itamserveradmin.domain.contract.repository.entity; import com.kbds.itamserveradmin.global.exception.BaseException; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/service/ContractService.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/service/ContractService.java new file mode 100644 index 0000000..1c4bed8 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/service/ContractService.java @@ -0,0 +1,7 @@ +package com.kbds.itamserveradmin.domain.contract.repository.service; + +import org.springframework.stereotype.Service; + +@Service +public class ContractService { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java index b841ee9..8aba106 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java @@ -1,6 +1,6 @@ package com.kbds.itamserveradmin.domain.cooperation.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.repository.entity.Contract; import com.kbds.itamserveradmin.domain.department.entity.Department; import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/controller/DepartmentController.java b/src/main/java/com/kbds/itamserveradmin/domain/department/controller/DepartmentController.java index 4682ec3..6103941 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/department/controller/DepartmentController.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/controller/DepartmentController.java @@ -1,4 +1,8 @@ package com.kbds.itamserveradmin.domain.department.controller; +import org.springframework.stereotype.Controller; + +@Controller public class DepartmentController { + } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/service/DepartmentService.java b/src/main/java/com/kbds/itamserveradmin/domain/department/service/DepartmentService.java new file mode 100644 index 0000000..430c57e --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/service/DepartmentService.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.department.service; + +import org.springframework.stereotype.Service; + +@Service +public class DepartmentService { + +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java index 0fddd2b..6861a31 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java @@ -1,5 +1,5 @@ package com.kbds.itamserveradmin.domain.numOfUsersType.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.repository.entity.Contract; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java b/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java index 888a8d4..064f642 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java @@ -1,5 +1,5 @@ package com.kbds.itamserveradmin.domain.supplyType.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.repository.entity.Contract; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index b972618..1201215 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -3,7 +3,7 @@ import com.kbds.itamserveradmin.domain.asset.entity.AssetNotice; import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequest; -import com.kbds.itamserveradmin.domain.contract.entity.ContractRecord; +import com.kbds.itamserveradmin.domain.contract.repository.entity.ContractRecord; import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; import com.kbds.itamserveradmin.domain.department.entity.Department; import com.kbds.itamserveradmin.global.entity.BaseEntity; From c71f591fb40099a4b5eded39a5a4d0c63ef085be Mon Sep 17 00:00:00 2001 From: UU_jeong <80961726+oU-Ua@users.noreply.github.com> Date: Wed, 7 Feb 2024 21:27:11 +0900 Subject: [PATCH 26/30] =?UTF-8?q?chore:=20user=20Repository=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/repository/NewAssetRequestAdminRepository.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdminRepository.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdminRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdminRepository.java new file mode 100644 index 0000000..9fb91c6 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdminRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.user.repository; + +import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequest; +import com.kbds.itamserveradmin.domain.user.entity.NewAssetRequestAdmin; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface NewAssetRequestAdminRepository extends JpaRepository { +} From fa599b030fc61aa16786a2755203d09c53615174 Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 21:29:48 +0900 Subject: [PATCH 27/30] =?UTF-8?q?fix:=20=EC=B6=A9=EB=8F=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/asset/entity/Asset.java | 6 +-- .../contract/repository/entity/Contract.java | 4 +- .../controller/CooperationController.java | 4 -- .../repository/CooperationRepository.java | 8 ---- .../service/CooperationService.java | 4 -- .../controller/CooperationController.java | 4 ++ .../entity/Corporation.java} | 4 +- .../repository/CooperationRepository.java | 8 ++++ .../service/CooperationService.java | 4 ++ .../service/CooperationServiceImpl.java | 2 +- .../domain/department/entity/Department.java | 4 +- .../numOfUsersType/entity/NumOfUsersType.java | 37 ------------------- .../domain/supplyType/entity/SupplyType.java | 32 ---------------- .../domain/user/entity/User.java | 4 +- 14 files changed, 27 insertions(+), 98 deletions(-) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/cooperation/controller/CooperationController.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/cooperation/repository/CooperationRepository.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationService.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CooperationController.java rename src/main/java/com/kbds/itamserveradmin/domain/{cooperation/entity/Cooperation.java => corporation/entity/Corporation.java} (94%) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CooperationRepository.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationService.java rename src/main/java/com/kbds/itamserveradmin/domain/{cooperation => corporation}/service/CooperationServiceImpl.java (53%) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java index 86060e2..15ec779 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java @@ -1,6 +1,6 @@ package com.kbds.itamserveradmin.domain.asset.entity; -import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; +import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; import lombok.Builder; @@ -9,8 +9,6 @@ import javax.persistence.*; -import java.util.ArrayList; -import java.util.List; @Entity @Data @@ -27,7 +25,7 @@ public class Asset { @ManyToOne @JoinColumn(name = "corp_id" ) - private Cooperation corp; + private Corporation corp; @ManyToOne @JoinColumn(name = "user_id") diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java index 9186139..8744fe3 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java @@ -1,7 +1,7 @@ package com.kbds.itamserveradmin.domain.contract.repository.entity; import com.kbds.itamserveradmin.domain.asset.entity.Asset; -import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; +import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequest; import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; @@ -29,7 +29,7 @@ public class Contract { @ManyToOne @JoinColumn(name = "corp_id") - private Cooperation corp; + private Corporation corp; @OneToOne private NewAssetRequest newAstReq; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/controller/CooperationController.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/controller/CooperationController.java deleted file mode 100644 index 9ff48eb..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/controller/CooperationController.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.controller; - -public class CooperationController { -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/repository/CooperationRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/repository/CooperationRepository.java deleted file mode 100644 index 8bc2904..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/repository/CooperationRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.repository; - -import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface CooperationRepository extends JpaRepository { - -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationService.java b/src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationService.java deleted file mode 100644 index ce17232..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationService.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.service; - -public interface CooperationService { -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CooperationController.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CooperationController.java new file mode 100644 index 0000000..5702cee --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CooperationController.java @@ -0,0 +1,4 @@ +package com.kbds.itamserveradmin.domain.corporation.controller; + +public class CooperationController { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java similarity index 94% rename from src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java rename to src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java index 8aba106..203ba02 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/entity/Cooperation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.cooperation.entity; +package com.kbds.itamserveradmin.domain.corporation.entity; import com.kbds.itamserveradmin.domain.contract.repository.entity.Contract; import com.kbds.itamserveradmin.domain.department.entity.Department; @@ -17,7 +17,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class Cooperation { +public class Corporation { @Id @Column(name = "corp_id") private String corpId; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CooperationRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CooperationRepository.java new file mode 100644 index 0000000..14ba95b --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CooperationRepository.java @@ -0,0 +1,8 @@ +package com.kbds.itamserveradmin.domain.corporation.repository; + +import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface CooperationRepository extends JpaRepository { + +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationService.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationService.java new file mode 100644 index 0000000..4df041e --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationService.java @@ -0,0 +1,4 @@ +package com.kbds.itamserveradmin.domain.corporation.service; + +public interface CooperationService { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationServiceImpl.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationServiceImpl.java similarity index 53% rename from src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationServiceImpl.java rename to src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationServiceImpl.java index 9eaf94f..2824e1c 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/cooperation/service/CooperationServiceImpl.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationServiceImpl.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.cooperation.service; +package com.kbds.itamserveradmin.domain.corporation.service; public class CooperationServiceImpl implements CooperationService{ } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java index b7f7af1..333ebfb 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java @@ -1,6 +1,6 @@ package com.kbds.itamserveradmin.domain.department.entity; -import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; +import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; import com.kbds.itamserveradmin.domain.purchaseRequest.entity.NewAssetRequest; import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; @@ -29,7 +29,7 @@ public class Department { @ManyToOne @JoinColumn(name = "corp_id") - private Cooperation cooperation; + private Corporation corporation; @OneToMany(mappedBy = "department",fetch = FetchType.LAZY) @Builder.Default diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java deleted file mode 100644 index 6861a31..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.kbds.itamserveradmin.domain.numOfUsersType.entity; -import com.kbds.itamserveradmin.domain.contract.repository.entity.Contract; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.*; -import java.io.Serializable; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class NumOfUsersType implements Serializable { - - @Id - private String NumOfUsersId; - - @OneToOne - @JoinColumn(name = "cont_id") - private Contract cont; - - private Integer maxUsersLimit; - private Integer maxCpuLimit; - private String ipRange; - private Integer currUsers; - private Integer currCpu; - private Integer totalNumPur; - private Integer totalServer; - private Integer totalCal; - - - - -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java b/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java deleted file mode 100644 index 064f642..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.kbds.itamserveradmin.domain.supplyType.entity; -import com.kbds.itamserveradmin.domain.contract.repository.entity.Contract; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToOne; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class SupplyType { - - @Id - private String splyId; - - @OneToOne - @JoinColumn(name = "cont_id") - private Contract cont; - - private String splyInstallFile; - private String splyInstallGuide; - private String acsUrl; - private String splyVer; - private String splyUserGuide; -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index 1201215..23de350 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -4,7 +4,7 @@ import com.kbds.itamserveradmin.domain.asset.entity.AssetNotice; import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequest; import com.kbds.itamserveradmin.domain.contract.repository.entity.ContractRecord; -import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; +import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; import com.kbds.itamserveradmin.domain.department.entity.Department; import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; @@ -50,7 +50,7 @@ public class User extends BaseEntity { @ManyToOne @JoinColumn(name = "corp_id") - private Cooperation cooperation; + private Corporation corporation; @OneToMany(mappedBy = "user",fetch = FetchType.LAZY) @Builder.Default From 1806730e3ff7ed434222e2249d750a1348aac2e8 Mon Sep 17 00:00:00 2001 From: UU_jeong <80961726+oU-Ua@users.noreply.github.com> Date: Wed, 7 Feb 2024 21:33:09 +0900 Subject: [PATCH 28/30] =?UTF-8?q?feat=20:=20Portal=20Main=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .../contract/entity/NumOfUsersType.java | 7 +++- .../numOfUsersType/entity/NumOfUsersType.java | 37 ------------------- .../domain/supplyType/entity/SupplyType.java | 32 ---------------- .../user/controller/UserController.java | 22 +++++++++++ .../domain/user/dto/MainRes.java | 4 ++ .../user/repository/NewAssetRequestAdmin.java | 6 --- .../domain/user/service/UserService.java | 4 ++ .../domain/user/service/UserServiceImpl.java | 16 ++++++++ src/main/resources/application.properties | 1 + src/main/resources/application.yml | 16 ++++---- 11 files changed, 62 insertions(+), 86 deletions(-) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/controller/UserController.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/dto/MainRes.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/service/UserService.java create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/user/service/UserServiceImpl.java diff --git a/.gitignore b/.gitignore index 26fc370..4ae4967 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,5 @@ out/ ### VS Code ### .vscode/ -/src/main/resources/application.yml \ No newline at end of file +/src/main/resources/application.yml +/src/main/resources/db-application.properties \ No newline at end of file diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/NumOfUsersType.java index 998652c..1b2c8e5 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/NumOfUsersType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/NumOfUsersType.java @@ -1,11 +1,14 @@ package com.kbds.itamserveradmin.domain.contract.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.*; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; @Entity @Data diff --git a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java b/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java deleted file mode 100644 index 0fddd2b..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/numOfUsersType/entity/NumOfUsersType.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.kbds.itamserveradmin.domain.numOfUsersType.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.*; -import java.io.Serializable; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class NumOfUsersType implements Serializable { - - @Id - private String NumOfUsersId; - - @OneToOne - @JoinColumn(name = "cont_id") - private Contract cont; - - private Integer maxUsersLimit; - private Integer maxCpuLimit; - private String ipRange; - private Integer currUsers; - private Integer currCpu; - private Integer totalNumPur; - private Integer totalServer; - private Integer totalCal; - - - - -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java b/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java deleted file mode 100644 index 888a8d4..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/supplyType/entity/SupplyType.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.kbds.itamserveradmin.domain.supplyType.entity; -import com.kbds.itamserveradmin.domain.contract.entity.Contract; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToOne; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class SupplyType { - - @Id - private String splyId; - - @OneToOne - @JoinColumn(name = "cont_id") - private Contract cont; - - private String splyInstallFile; - private String splyInstallGuide; - private String acsUrl; - private String splyVer; - private String splyUserGuide; -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/controller/UserController.java b/src/main/java/com/kbds/itamserveradmin/domain/user/controller/UserController.java new file mode 100644 index 0000000..077f32e --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/controller/UserController.java @@ -0,0 +1,22 @@ +package com.kbds.itamserveradmin.domain.user.controller; + +import com.kbds.itamserveradmin.domain.user.dto.MainRes; +import com.kbds.itamserveradmin.domain.user.service.UserService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +@RestController +@Slf4j +@RequiredArgsConstructor +@RequestMapping("/kbitam") +public class UserController { + private final UserService userService; + + @PostMapping("/") + public ResponseEntityGetUserInfo(@RequestBody String userId){ + + return ResponseEntity.ok(null); + } +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/dto/MainRes.java b/src/main/java/com/kbds/itamserveradmin/domain/user/dto/MainRes.java new file mode 100644 index 0000000..8c451a2 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/dto/MainRes.java @@ -0,0 +1,4 @@ +package com.kbds.itamserveradmin.domain.user.dto; + +public class MainRes { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java b/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java deleted file mode 100644 index 0a607d3..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/repository/NewAssetRequestAdmin.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.kbds.itamserveradmin.domain.user.repository; - -import org.springframework.data.jpa.repository.JpaRepository; - -public interface NewAssetRequestAdmin extends JpaRepository { -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/service/UserService.java b/src/main/java/com/kbds/itamserveradmin/domain/user/service/UserService.java new file mode 100644 index 0000000..635f4c3 --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/service/UserService.java @@ -0,0 +1,4 @@ +package com.kbds.itamserveradmin.domain.user.service; + +public interface UserService { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/service/UserServiceImpl.java b/src/main/java/com/kbds/itamserveradmin/domain/user/service/UserServiceImpl.java new file mode 100644 index 0000000..ffe26ee --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/service/UserServiceImpl.java @@ -0,0 +1,16 @@ +package com.kbds.itamserveradmin.domain.user.service; + +import com.kbds.itamserveradmin.domain.user.dto.MainRes; +import com.kbds.itamserveradmin.domain.user.repository.UserRepository; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class UserServiceImpl implements UserService{ + private final UserRepository userRepository; + public MainRes GetUserInfo(String userId){ + return null; + + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8b13789..66dd705 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,2 @@ +spring.config.import=db-application.properties diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 11e8d89..4d47f78 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -11,14 +11,14 @@ spring: application: name : itam-server-admin - - datasource: - platform: mysql - url: jdbc:mysql://localhost:3306/kbds?serverTimezone=Asia/Seoul&characterEncoding=UTF-8 - username: root - password: smilechs5542 - driver-class-name: com.mysql.cj.jdbc.Driver # mysql 8버전 - +# +# datasource: +# platform: mysql +# url: jdbc:mysql://localhost:3306/kbds?serverTimezone=Asia/Seoul&characterEncoding=UTF-8 +# username: root +# password: smilechs5542 +# driver-class-name: com.mysql.cj.jdbc.Driver # mysql 8버전 +# jpa: hibernate: From 288a8254f8e5b69b6da30feb09bf09b54b313aa0 Mon Sep 17 00:00:00 2001 From: leemimi Date: Wed, 7 Feb 2024 21:53:25 +0900 Subject: [PATCH 29/30] =?UTF-8?q?fix:=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/asset/entity/AssetNotice.java | 1 - .../{repository => }/entity/CALKey.java | 2 +- .../{repository => }/entity/Contract.java | 2 +- .../entity/ContractRecord.java | 2 +- .../{repository => }/entity/KeyStatus.java | 2 +- .../{repository => }/entity/LicenseKey.java | 2 +- .../domain/contract/entity/OpStatus.java | 5 ++ .../{repository => }/entity/RecordType.java | 2 +- .../contract/repository/entity/OpStatus.java | 5 -- .../service/ContractService.java | 2 +- .../controller/CooperationController.java | 4 -- .../corperation/entity/Corporation.java | 68 ------------------- .../repository/CorporationRepository.java | 8 --- .../service/CooperationService.java | 4 -- .../service/CooperationServiceImpl.java | 4 -- ...roller.java => CorporationController.java} | 2 +- .../corporation/entity/Corporation.java | 2 +- ...sitory.java => CorporationRepository.java} | 2 +- .../service/CooperationServiceImpl.java | 4 -- ...onService.java => CorporationService.java} | 2 +- .../service/CorporationServiceImpl.java | 4 ++ .../domain/user/entity/User.java | 2 +- 22 files changed, 21 insertions(+), 110 deletions(-) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{repository => }/entity/CALKey.java (86%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{repository => }/entity/Contract.java (95%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{repository => }/entity/ContractRecord.java (90%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{repository => }/entity/KeyStatus.java (79%) rename src/main/java/com/kbds/itamserveradmin/domain/contract/{repository => }/entity/LicenseKey.java (86%) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java rename src/main/java/com/kbds/itamserveradmin/domain/contract/{repository => }/entity/RecordType.java (91%) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java rename src/main/java/com/kbds/itamserveradmin/domain/contract/{repository => }/service/ContractService.java (56%) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corperation/controller/CooperationController.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corperation/entity/Corporation.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corperation/repository/CorporationRepository.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationService.java delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationServiceImpl.java rename src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/{CooperationController.java => CorporationController.java} (64%) rename src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/{CooperationRepository.java => CorporationRepository.java} (77%) delete mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationServiceImpl.java rename src/main/java/com/kbds/itamserveradmin/domain/corporation/service/{CooperationService.java => CorporationService.java} (62%) create mode 100644 src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CorporationServiceImpl.java diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java index 0bd7899..9faef97 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java @@ -5,7 +5,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.apache.tomcat.util.http.parser.ContentRange; import javax.persistence.*; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/CALKey.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java similarity index 86% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/CALKey.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java index 5ea17c0..64434cd 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/CALKey.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.repository.entity; +package com.kbds.itamserveradmin.domain.contract.entity; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java similarity index 95% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java index 8744fe3..515f3eb 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.repository.entity; +package com.kbds.itamserveradmin.domain.contract.entity; import com.kbds.itamserveradmin.domain.asset.entity.Asset; import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/ContractRecord.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java similarity index 90% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/ContractRecord.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java index 0a91c17..37a7a4f 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/ContractRecord.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.repository.entity; +package com.kbds.itamserveradmin.domain.contract.entity; import com.kbds.itamserveradmin.domain.user.entity.User; import com.kbds.itamserveradmin.global.entity.BaseEntity; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/KeyStatus.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/KeyStatus.java similarity index 79% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/KeyStatus.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/entity/KeyStatus.java index 376e1d6..25833a5 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/KeyStatus.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/KeyStatus.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.repository.entity; +package com.kbds.itamserveradmin.domain.contract.entity; import com.fasterxml.jackson.annotation.JsonValue; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/LicenseKey.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java similarity index 86% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/LicenseKey.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java index 79e8d16..0f9e7ea 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/LicenseKey.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.repository.entity; +package com.kbds.itamserveradmin.domain.contract.entity; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java new file mode 100644 index 0000000..cc1dddd --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/OpStatus.java @@ -0,0 +1,5 @@ +package com.kbds.itamserveradmin.domain.contract.entity; + +public enum OpStatus { + IN_OPERATION, IN_DISPOSAL +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/RecordType.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java similarity index 91% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/RecordType.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java index e4df57c..4082d5e 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/RecordType.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/RecordType.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.repository.entity; +package com.kbds.itamserveradmin.domain.contract.entity; import com.kbds.itamserveradmin.global.exception.BaseException; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java deleted file mode 100644 index fe697f5..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/entity/OpStatus.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.kbds.itamserveradmin.domain.contract.repository.entity; - -public enum OpStatus { - IN_OPERATION, IN_DISPOSAL -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/service/ContractService.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/service/ContractService.java similarity index 56% rename from src/main/java/com/kbds/itamserveradmin/domain/contract/repository/service/ContractService.java rename to src/main/java/com/kbds/itamserveradmin/domain/contract/service/ContractService.java index 1c4bed8..0970622 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/repository/service/ContractService.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/service/ContractService.java @@ -1,4 +1,4 @@ -package com.kbds.itamserveradmin.domain.contract.repository.service; +package com.kbds.itamserveradmin.domain.contract.service; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corperation/controller/CooperationController.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/controller/CooperationController.java deleted file mode 100644 index 9ff48eb..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/corperation/controller/CooperationController.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.controller; - -public class CooperationController { -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corperation/entity/Corporation.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/entity/Corporation.java deleted file mode 100644 index b841ee9..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/corperation/entity/Corporation.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.entity; - -import com.kbds.itamserveradmin.domain.contract.entity.Contract; -import com.kbds.itamserveradmin.domain.department.entity.Department; -import com.kbds.itamserveradmin.domain.user.entity.User; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.persistence.*; -import java.util.ArrayList; -import java.util.List; - -@Entity -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class Cooperation { - @Id - @Column(name = "corp_id") - private String corpId; - - @Column(name = "corp_name") - private String corpName; - - @Column(name = "crn") - private String corpNum; - - @Column(name = "corp_contact") - private String corpContact; - - @Column(name = "corp_addr") - private String corpAddr; - - @Column(name = "corp_site") - private String corpSite; - - @Column(name = "corp_head") - private String corpHead; - - @Column(name = "corp_note") - private String corpNote; - - @Column(name = "is_sub_corp") - private boolean isSubCorp; - - //==연관관계==// - @OneToMany(mappedBy = "cooperation",fetch = FetchType.LAZY) - @Builder.Default - private List departments = new ArrayList<>(); - - @OneToMany(mappedBy = "cooperation",fetch = FetchType.LAZY) - @Builder.Default - private List users = new ArrayList<>(); - -// @OneToMany(mappedBy ="cooperation") -// private List assets = new ArrayList<>(); - - @OneToMany(mappedBy = "corp",fetch = FetchType.LAZY) - @Builder.Default - private List contracts = new ArrayList<>(); - - //==연관관계==// - - -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corperation/repository/CorporationRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/repository/CorporationRepository.java deleted file mode 100644 index 8bc2904..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/corperation/repository/CorporationRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.repository; - -import com.kbds.itamserveradmin.domain.cooperation.entity.Cooperation; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface CooperationRepository extends JpaRepository { - -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationService.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationService.java deleted file mode 100644 index ce17232..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationService.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.service; - -public interface CooperationService { -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationServiceImpl.java b/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationServiceImpl.java deleted file mode 100644 index 9eaf94f..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/corperation/service/CooperationServiceImpl.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.kbds.itamserveradmin.domain.cooperation.service; - -public class CooperationServiceImpl implements CooperationService{ -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CooperationController.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CorporationController.java similarity index 64% rename from src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CooperationController.java rename to src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CorporationController.java index 5702cee..b9cd859 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CooperationController.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/controller/CorporationController.java @@ -1,4 +1,4 @@ package com.kbds.itamserveradmin.domain.corporation.controller; -public class CooperationController { +public class CorporationController { } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java index 203ba02..8344f1b 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java @@ -1,6 +1,6 @@ package com.kbds.itamserveradmin.domain.corporation.entity; -import com.kbds.itamserveradmin.domain.contract.repository.entity.Contract; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; import com.kbds.itamserveradmin.domain.department.entity.Department; import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CooperationRepository.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CorporationRepository.java similarity index 77% rename from src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CooperationRepository.java rename to src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CorporationRepository.java index 14ba95b..f3dde0d 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CooperationRepository.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/repository/CorporationRepository.java @@ -3,6 +3,6 @@ import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; import org.springframework.data.jpa.repository.JpaRepository; -public interface CooperationRepository extends JpaRepository { +public interface CorporationRepository extends JpaRepository { } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationServiceImpl.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationServiceImpl.java deleted file mode 100644 index 2824e1c..0000000 --- a/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationServiceImpl.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.kbds.itamserveradmin.domain.corporation.service; - -public class CooperationServiceImpl implements CooperationService{ -} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationService.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CorporationService.java similarity index 62% rename from src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationService.java rename to src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CorporationService.java index 4df041e..e834b07 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CooperationService.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CorporationService.java @@ -1,4 +1,4 @@ package com.kbds.itamserveradmin.domain.corporation.service; -public interface CooperationService { +public interface CorporationService { } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CorporationServiceImpl.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CorporationServiceImpl.java new file mode 100644 index 0000000..6aa20ff --- /dev/null +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/service/CorporationServiceImpl.java @@ -0,0 +1,4 @@ +package com.kbds.itamserveradmin.domain.corporation.service; + +public class CorporationServiceImpl implements CorporationService { +} diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index 23de350..226a373 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -3,7 +3,7 @@ import com.kbds.itamserveradmin.domain.asset.entity.AssetNotice; import com.kbds.itamserveradmin.domain.assetRequest.entity.AssetRequest; -import com.kbds.itamserveradmin.domain.contract.repository.entity.ContractRecord; +import com.kbds.itamserveradmin.domain.contract.entity.ContractRecord; import com.kbds.itamserveradmin.domain.corporation.entity.Corporation; import com.kbds.itamserveradmin.domain.department.entity.Department; import com.kbds.itamserveradmin.global.entity.BaseEntity; From e7dfa8b896527b62914ff79ab066de21887abf1e Mon Sep 17 00:00:00 2001 From: UU_jeong <80961726+oU-Ua@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:34:49 +0900 Subject: [PATCH 30/30] =?UTF-8?q?chore=20:=20entity=20lazy=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/asset/entity/Asset.java | 4 +-- .../domain/asset/entity/AssetNotice.java | 9 ++++--- .../domain/asset/entity/ManualLog.java | 11 +++----- .../assetRequest/entity/AssetRequest.java | 9 ++++--- .../assetRequest/entity/AssetRequestLog.java | 7 +++-- .../entity/AssetRequestManage.java | 9 ++----- .../entity/AssetRequestManageLog.java | 2 +- .../domain/contract/entity/CALKey.java | 9 +++---- .../domain/contract/entity/Contract.java | 9 +++---- .../contract/entity/ContractRecord.java | 4 +-- .../domain/contract/entity/LicenseKey.java | 9 +++---- .../corporation/entity/Corporation.java | 2 -- .../domain/department/entity/Department.java | 13 +-------- .../department/entity/DepartmentAsset.java | 9 ++++--- .../entity/NewAssetRequest.java | 5 +--- .../entity/NewAssetRequestLog.java | 2 +- .../domain/user/entity/AssetAdmin.java | 14 +++++----- .../domain/user/entity/User.java | 27 ++----------------- .../domain/user/entity/UserLog.java | 2 +- 19 files changed, 54 insertions(+), 102 deletions(-) diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java index 15ec779..ad3eae9 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/Asset.java @@ -23,11 +23,11 @@ public class Asset { private Boolean isAstInternal; private AstTag astTag; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "corp_id" ) private Corporation corp; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") private User user; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java index 9faef97..c8e2127 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/AssetNotice.java @@ -1,5 +1,6 @@ package com.kbds.itamserveradmin.domain.asset.entity; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; import com.kbds.itamserveradmin.domain.user.entity.User; import lombok.AllArgsConstructor; import lombok.Builder; @@ -23,11 +24,11 @@ public class AssetNotice { //==연관관계==// -// @ManyToOne -// @JoinColumn(name = "contract_id") -// private Contract contract; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "contract_id") + private Contract contract; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "writer_id") private User writer; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/ManualLog.java b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/ManualLog.java index b70bae2..7c34c04 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/ManualLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/asset/entity/ManualLog.java @@ -5,10 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import javax.persistence.*; @Entity @Data @@ -27,7 +24,7 @@ public class ManualLog { //==연관관계==// -// @ManyToOne -// @JoinColumn(name = "ast_id") -// private Asset asset; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ast_id") + private Asset asset; } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java index 616430c..ffbd248 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequest.java @@ -1,6 +1,7 @@ package com.kbds.itamserveradmin.domain.assetRequest.entity; import com.kbds.itamserveradmin.domain.assetRequest.entity.RequestStatus; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; import com.kbds.itamserveradmin.domain.user.entity.User; import com.kbds.itamserveradmin.global.entity.BaseEntity; import lombok.AllArgsConstructor; @@ -40,13 +41,13 @@ public class AssetRequest { //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ast_req_user_id") private User astRequestUser; -// @ManyToOne -// @JoinColumn(name = "cont_id") -// private Contract contract; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "cont_id") + private Contract contract; //==연관관계==// diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java index 84ad2d5..0e9ebb6 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestLog.java @@ -30,12 +30,15 @@ public class AssetRequestLog { private Long astReqCnt; private LocalDateTime astReqSud; + + //==연관관계==// - @ManyToOne + + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ast_req_id") private AssetRequest assetRequest; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ast_req_user_id") private User assetRequestUser; //==연관관계==// diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java index 06f8580..034e398 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManage.java @@ -33,19 +33,14 @@ public class AssetRequestManage { //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ast_admin_id") private AssetAdmin assetAdmin; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ast_req_id") private AssetRequest assetRequest; - - @OneToMany(mappedBy = "assetRequestManage",fetch = FetchType.LAZY) - @Builder.Default - private List assetRequestManageLogs = new ArrayList<>(); - @PrePersist public void prePersist() { LocalDateTime now = LocalDateTime.now(); diff --git a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java index 6e26c9c..09f5e4f 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/assetRequest/entity/AssetRequestManageLog.java @@ -27,7 +27,7 @@ public class AssetRequestManageLog { //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ast_req_mg_id") private AssetRequestManage assetRequestManage; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java index 64434cd..ccfa591 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/CALKey.java @@ -5,8 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Entity; -import javax.persistence.Id; +import javax.persistence.*; @Entity @Data @@ -20,7 +19,7 @@ public class CALKey { private KeyStatus calKeyStatus; //==연관관계==// -// @ManyToOne -// @JoinColumn(name = "cont_id") -// private Contract contract; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "cont_id") + private Contract contract; } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java index 515f3eb..cb9f00d 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/Contract.java @@ -23,24 +23,21 @@ public class Contract { @Id private String contId; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ast_id") private Asset ast; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "corp_id") private Corporation corp; @OneToOne private NewAssetRequest newAstReq; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "usr_id") private User user; - @OneToMany(mappedBy = "contract", fetch = FetchType.LAZY) - private List records = new ArrayList<>(); - private LocalDateTime contRegDate; private String contLicTag; private int contPrice; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java index 37a7a4f..798bba5 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/ContractRecord.java @@ -19,11 +19,11 @@ public class ContractRecord extends BaseEntity { private RecordType recordType; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(nullable = false, name = "user_Id") private User user; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(nullable = false, name = "contract_id") private Contract contract; } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java index 0f9e7ea..cf00d34 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/contract/entity/LicenseKey.java @@ -5,8 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Entity; -import javax.persistence.Id; +import javax.persistence.*; @Entity @Data @@ -20,7 +19,7 @@ public class LicenseKey { private KeyStatus licKeyStatus; //==연관관계==// -// @ManyToOne -// @JoinColumn(name = "cont_id") -// private Contract contract; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "cont_id") + private Contract contract; } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java b/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java index 8344f1b..c17ae20 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/corporation/entity/Corporation.java @@ -55,8 +55,6 @@ public class Corporation { @Builder.Default private List users = new ArrayList<>(); -// @OneToMany(mappedBy ="cooperation") -// private List assets = new ArrayList<>(); @OneToMany(mappedBy = "corp",fetch = FetchType.LAZY) @Builder.Default diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java index 333ebfb..8b65b28 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/Department.java @@ -27,20 +27,9 @@ public class Department { //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "corp_id") private Corporation corporation; - @OneToMany(mappedBy = "department",fetch = FetchType.LAZY) - @Builder.Default - private List users = new ArrayList<>(); - - @OneToMany(mappedBy = "department",fetch = FetchType.LAZY) - @Builder.Default - private List departmentAssets = new ArrayList<>(); - - @OneToMany(mappedBy = "department",fetch = FetchType.LAZY) - @Builder.Default - private List newAssetRequests = new ArrayList<>(); //==연관관계==// } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/DepartmentAsset.java b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/DepartmentAsset.java index 2fdb23f..8e3033f 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/department/entity/DepartmentAsset.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/department/entity/DepartmentAsset.java @@ -1,5 +1,6 @@ package com.kbds.itamserveradmin.domain.department.entity; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,13 +19,13 @@ public class DepartmentAsset { private String DeptAstId; //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "dept_id") private Department department; -// @ManyToOne -// @JoinColumn(name = "contract_id") -// private Contract contract; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "contract_id") + private Contract contract; //==연관관계==// diff --git a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java index 70aa0ce..a4cd1d2 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequest.java @@ -35,11 +35,8 @@ public class NewAssetRequest { //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "dept_id") private Department department; - @OneToMany(mappedBy = "newAssetRequest",fetch = FetchType.LAZY) - @Builder.Default - private List newAssetRequestAdmins = new ArrayList<>(); } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequestLog.java b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequestLog.java index 60ead96..e4be54f 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequestLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/purchaseRequest/entity/NewAssetRequestLog.java @@ -29,7 +29,7 @@ public class NewAssetRequestLog { private String newAstReqUsePlan; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "dept_id") private Department department; diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/AssetAdmin.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/AssetAdmin.java index 59d231f..5cff2db 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/AssetAdmin.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/AssetAdmin.java @@ -1,14 +1,12 @@ package com.kbds.itamserveradmin.domain.user.entity; +import com.kbds.itamserveradmin.domain.contract.entity.Contract; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import javax.persistence.*; @Entity @Data @@ -21,11 +19,11 @@ public class AssetAdmin { //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "manager_id") private User manager; -// @ManyToOne -// @JoinColumn(name = "cont_id") -// private Contract contract; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "cont_id") + private Contract contract; } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java index 226a373..b4a28e6 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/User.java @@ -44,35 +44,12 @@ public class User extends BaseEntity { //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "dept_id") private Department department; - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "corp_id") private Corporation corporation; - @OneToMany(mappedBy = "user",fetch = FetchType.LAZY) - @Builder.Default - private List userLogs = new ArrayList<>(); - - @OneToMany(mappedBy = "writer",fetch = FetchType.LAZY) - @Builder.Default - private List assetNotices = new ArrayList<>(); - //==연관관계==// - - @OneToMany(mappedBy = "manager",fetch = FetchType.LAZY) - @Builder.Default - private List assetAdmins = new ArrayList<>(); - - @OneToMany(mappedBy = "astRequestUser",fetch = FetchType.LAZY) - @Builder.Default - private List assetRequests = new ArrayList<>(); - - @OneToMany(mappedBy = "user",fetch = FetchType.LAZY) - @Builder.Default - private List newAssetRequestAdmins = new ArrayList<>(); - - @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) - private List records = new ArrayList<>(); } diff --git a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/UserLog.java b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/UserLog.java index 1e1b9b6..b6e1771 100644 --- a/src/main/java/com/kbds/itamserveradmin/domain/user/entity/UserLog.java +++ b/src/main/java/com/kbds/itamserveradmin/domain/user/entity/UserLog.java @@ -22,7 +22,7 @@ public class UserLog { private UserStatus userStatus; //==연관관계==// - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") private User user; }