diff --git a/nw/src/main/java/lab/cherry/nw/controller/FinaldocsController.java b/nw/src/main/java/lab/cherry/nw/controller/FinaldocsController.java
index a320f28..c2b4247 100644
--- a/nw/src/main/java/lab/cherry/nw/controller/FinaldocsController.java
+++ b/nw/src/main/java/lab/cherry/nw/controller/FinaldocsController.java
@@ -1,5 +1,6 @@
package lab.cherry.nw.controller;
+import org.bson.types.ObjectId;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@@ -156,6 +157,28 @@ public ResponseEntity> findById(@PathVariable("id") String id) {
return new ResponseEntity<>(finaldocsService.findById(id), new HttpHeaders(), HttpStatus.OK);
}
+ /**
+ * [FinaldocsController] 특정 최종확인서 조회 함수
+ *
+ * @param id 최종확인서 고유번호를 입력합니다.
+ * @return
+ *
+ * true : 특정 최종확인서 정보를 반환합니다.
+ * false : 에러(400, 404)를 반환합니다.
+ *
+ *
+ * Author : hhhaeri(yhoo0020@gmail.com)
+ */
+ @GetMapping("/user/{userid}")
+ @Operation(summary = "User Id 로 최종확인서 찾기", description = "최종확인서를 조회합니다.")
+ public ResponseEntity> findByUserId(@PathVariable("userid") String userid) {
+
+ log.info("[FinaldocsController] findByFinaldocsId... with userId", userid);
+
+ return new ResponseEntity<>(finaldocsService.findByUserId(userid), new HttpHeaders(), HttpStatus.OK);
+ }
+
+
/**
* [FinaldocsController] 특정 최종확인서 삭제 함수
*
diff --git a/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java b/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java
index 0ef4f54..b6b2916 100644
--- a/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java
+++ b/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java
@@ -18,7 +18,6 @@
import java.io.Serializable;
import java.time.Instant;
import java.util.List;
-import java.util.Map;
/**
*
@@ -40,33 +39,37 @@ public class FinaldocsEntity implements Serializable {
@Schema(title = "최종확인서 고유번호", example = "64ed89aa9e813b5ab16da6de")
private String id;
- @NotNull
- @JsonProperty("finaltempl")
- @Schema(title = "최종확인서 템플릿 정보", example = "64ed89aa9e813b5ab16da6de")
- private FinalTemplEntity finaltempl;
-
- @NotNull
@DBRef
@JsonProperty("user")
- @Schema(title = "사용자 정보", example = "64ed89aa9e813b5ab16da6de")
+ @Schema(title = "유저 정보") // (Long) Tsid
private UserEntity user;
- @NotNull
@DBRef
@JsonProperty("org")
- @Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de")
+ @Schema(title = "조직 정보") // (Long) Tsid
private OrgEntity org;
- @NotNull
- @JsonProperty("finaldocsName")
- @Schema(title = "최종확인서 이름", example = "11시 그랜드 최종 확인서")
- @Size(min = 4, max = 255, message = "Minimum name length: 4 characters")
- private String name;
+ @DBRef
+ @JsonProperty("finaltempl")
+ @Schema(title = "최종확인서 템플릿 정보", example = "64ed89aa9e813b5ab16da6de")
+ private FinalTemplEntity finaltempl;
@JsonProperty("content")
@Schema(title = "최종확인서 내용", example = "")
private List