From 159956f02435f3ca062276667b85360f3bc04bde Mon Sep 17 00:00:00 2001 From: haeri Date: Tue, 7 Nov 2023 02:57:24 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Chore=20:=20=EC=8A=A4=EC=BC=80=EC=A4=84?= =?UTF-8?q?=ED=91=9C,=EC=B5=9C=EC=A2=85=ED=99=95=EC=9D=B8=EC=84=9C=20?= =?UTF-8?q?=ED=85=9C=ED=94=8C=EB=A6=BF=20=EC=83=9D=EC=84=B1=20api=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nw/controller/ScheduleController.java | 87 ++++++++++----- .../lab/cherry/nw/model/FinalTemplEntity.java | 40 ++++--- .../lab/cherry/nw/model/ScheduleEntity.java | 82 +++++++++----- .../nw/repository/ScheduleRepository.java | 4 +- .../service/Impl/FinalTemplServiceImpl.java | 17 +-- .../nw/service/Impl/ScheduleServiceImpl.java | 100 ++++++++++++------ .../cherry/nw/service/ScheduleService.java | 6 +- 7 files changed, 219 insertions(+), 117 deletions(-) diff --git a/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java b/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java index cf4a770..7fe8335 100644 --- a/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java +++ b/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java @@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lab.cherry.nw.error.ErrorResponse; +import lab.cherry.nw.model.FinalTemplEntity; import lab.cherry.nw.model.ScheduleEntity; import lab.cherry.nw.service.ScheduleService; import lab.cherry.nw.util.Common; @@ -120,38 +121,68 @@ public ResponseEntity fianlToSchedule(@Valid @RequestBody(required = false) S } - /** - * [ScheduleController] 스케줄표 날짜 기준 조회 - * - * @param 날짜 기준으로 스케줄표를 조회합니다. - * @return - *
-	 * true  : 성공(200)을 반환합니다.
-	 * false : 에러(400)를 반환합니다.
-	 * 
- * - * Author : hhhaeri(yhoo0020@gmail.com) - */ - @PostMapping("/date/{start}/{end}") - @Operation(summary = "스케줄표 날짜 조회", description = "최종확인서에 있는 날짜 기준 조회") - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "날짜 기준으로 조회를 완료되었습니다.", content = @Content(schema = @Schema(implementation = ResponseEntity.class))), - @ApiResponse(responseCode = "400", description = "입력 값이 잘못되었습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) - }) - public ResponseEntity fianlToDateSchedule(@Valid @PathVariable("start") String start, @PathVariable("end") String end) { + /** + * [ScheduleController] 스케줄표 생성 함수 + * + * @param ScheduleCreateDto 생성에 필요한 스케줄표 정보를 담고 있는 객체입니다. + * @return + *
+     * true  : 성공(200)을 반환합니다.
+     * false : 에러(400)를 반환합니다.
+     * 
+ * + * Author : hhhaeri(yhoo0020@gmail.com) + */ + @PostMapping("") + @Operation(summary = "스케줄표 생성", description = "스케줄표를 생성합니다.") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "스케줄표 생성이 완료되었습니다.", content = @Content(schema = @Schema(implementation = ResponseEntity.class))), + @ApiResponse(responseCode = "400", description = "입력 값이 잘못되었습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + }) + public ResponseEntity createFinalTemplate(@Valid @RequestBody(required = false) ScheduleEntity.ScheduleCreateDto scheduleCreateDto) { - log.info("[ScheduleController] fianlToDateSchedule...!"); + log.info("[ScheduleController] createSchedule...!"); - LocalDate localStartDate = LocalDate.parse(start); - LocalDate localEndDate = LocalDate.parse(end); + ScheduleEntity scheduleEntity = scheduleService.createSchedule(scheduleCreateDto); - // LocalDate를 Instant로 변환 (00:00:00 시간으로 설정) - Instant startDate = localStartDate.atStartOfDay(ZoneId.systemDefault()).toInstant(); - Instant endDate = localEndDate.atStartOfDay(ZoneId.systemDefault()).toInstant(); + return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK); + } - ScheduleEntity scheduleEntity = scheduleService.scheduleByDate(startDate,endDate); - return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK); - } + + + // /** + // * [ScheduleController] 스케줄표 날짜 기준 조회 + // * + // * @param 날짜 기준으로 스케줄표를 조회합니다. + // * @return + // *
+	//  * true  : 성공(200)을 반환합니다.
+	//  * false : 에러(400)를 반환합니다.
+	//  * 
+ // * + // * Author : hhhaeri(yhoo0020@gmail.com) + // */ + // @PostMapping("/date/{start}/{end}") + // @Operation(summary = "스케줄표 날짜 조회", description = "최종확인서에 있는 날짜 기준 조회") + // @ApiResponses(value = { + // @ApiResponse(responseCode = "200", description = "날짜 기준으로 조회를 완료되었습니다.", content = @Content(schema = @Schema(implementation = ResponseEntity.class))), + // @ApiResponse(responseCode = "400", description = "입력 값이 잘못되었습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + // }) + // public ResponseEntity fianlToDateSchedule(@Valid @PathVariable("start") String start, @PathVariable("end") String end) { + + // log.info("[ScheduleController] fianlToDateSchedule...!"); + + // LocalDate localStartDate = LocalDate.parse(start); + // LocalDate localEndDate = LocalDate.parse(end); + + // // LocalDate를 Instant로 변환 (00:00:00 시간으로 설정) + // Instant startDate = localStartDate.atStartOfDay(ZoneId.systemDefault()).toInstant(); + // Instant endDate = localEndDate.atStartOfDay(ZoneId.systemDefault()).toInstant(); + + // ScheduleEntity scheduleEntity = scheduleService.scheduleByDate(startDate,endDate); + + // return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK); + // } } diff --git a/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java b/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java index 4af3d08..a9c8cda 100644 --- a/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java +++ b/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java @@ -31,7 +31,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor @Document(collection = "finaltempl") -@JsonPropertyOrder({ "id", "finaltemplName","content","user","org","updated_at", "created_at"}) +@JsonPropertyOrder({ "id", "finaltemplName", "content","user", "org", "usercard", "updated_at", "created_at"}) public class FinalTemplEntity implements Serializable { @Id @@ -51,16 +51,21 @@ public class FinalTemplEntity implements Serializable { @Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de") private OrgEntity org; + + @NotNull + @JsonProperty("usercard") + @Schema(title = "고객카드 정보", example = "문서 내용") + private UserCardEntity usercard; + @NotNull @JsonProperty("finaltemplName") @Schema(title = "최종확인서 템플릿 이름", example = "예식장 최종 확인서 양식") @Size(min = 4, max = 255, message = "Minimum name length: 4 characters") private String name; - @NotNull @JsonProperty("content") @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") - private Map content; + private Map content; @JsonProperty("updated_at") @@ -87,19 +92,20 @@ public static class FinalTemplCreateDto { private String name; @NotBlank - @JsonProperty("userid") - @Schema(title = "사용자 정보", example = "64ed89aa9e813b5ab16da6de") - private String user; + @Schema(title = "사용자 고유번호", example = "64ed89aa9e813b5ab16da6de") + private String userSeq; @NotBlank - @JsonProperty("orgid") - @Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de") - private String org; + @Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de") + private String orgId; + + @NotBlank + @Schema(title = "고객카드 고유 번호", example = "문서 내용") + private String usercardId; + - @NotBlank - @JsonProperty("content") @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") - private Map content; + private Map content; } @@ -110,18 +116,18 @@ public static class FinalTemplCreateDto { @NoArgsConstructor @AllArgsConstructor public static class FinalTemplUpdateDto { - @Schema(title = "사용자 정보", example = "64ed89aa9e813b5ab16da6de") - private String user; + @Schema(title = "사용자 고유 번호", example = "64ed89aa9e813b5ab16da6de") + private String userSeq; - @Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de") - private String org; + @Schema(title = "조직 고유 번호", example = "64ed89aa9e813b5ab16da6de") + private String orgId; @Schema(title = "최종확인서 템플릿 이름", example = "예식장 최종 확인서 양식") @Size(min = 4, max = 255, message = "Minimum name length: 4 characters") private String name; @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") - private Map content; + private Map content; } diff --git a/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java b/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java index 710856d..c3c6164 100644 --- a/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java +++ b/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java @@ -1,14 +1,17 @@ package lab.cherry.nw.model; import java.io.Serializable; +import java.time.Instant; import java.util.List; import java.util.Map; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.DBRef; import org.springframework.data.mongodb.core.mapping.Document; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.AllArgsConstructor; import lombok.Builder; @@ -30,7 +33,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor @Document(collection = "schedule") -@JsonPropertyOrder({ "id", "scheduleSeq","user","org","finaltempl","scheduleName", "scheduleContent", "column"}) +@JsonPropertyOrder({ "id", "scheduleSeq","user","org","finaltempl", "scheduleContent", "column", "created_at"}) public class ScheduleEntity implements Serializable { @Id @@ -48,49 +51,72 @@ public class ScheduleEntity implements Serializable { @Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de") private OrgEntity org; - @JsonProperty("finaltemplid") + @JsonProperty("finaltempl") @Schema(title = "최종확인서 템플릿 정보", example = "64ed89aa9e813b5ab16da6de") private FinalTemplEntity finaltempl; - @JsonProperty("scheduleName") - @Schema(title = "스케줄표 이름", example = "문서1") - @Size(min = 4, max = 255, message = "Minimum name length: 4 characters") - private String name; - @JsonProperty("scheduleContent") @Schema(title = "스케줄표 내용", example = "[]") - private List content; + private Map content; @JsonProperty("column") @Schema(title = "스케줄표 컬럼", example = "") - private Map column; + private Map column; + + @JsonProperty("created_at") + @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss", locale = "ko_KR", timezone = "Asia/Seoul") + private Instant created_at; + + ////////////////////////////////////////////////////////////////////////// + + @Getter + @Builder + @NoArgsConstructor @AllArgsConstructor + public static class ScheduleCreateDto { + + + @NotBlank + @Schema(title = "사용자 고유번호", example = "64ed89aa9e813b5ab16da6de") + private String userSeq; + + @NotBlank + @Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de") + private String orgId; + + @NotBlank + @Schema(title = "최종확인서 템플릿 고유번호", example = "문서 내용") + private String finaltemplId; + + + @Schema(title = "스케줄표 템플릿 내용", example = "문서 내용") + private Map content; + + } -////////////////////////////////////////////////////////////////////////// - @Getter - @Setter - @Builder - @NoArgsConstructor @AllArgsConstructor - public static class transDto { + ////////////////////////////////////////////////////////////////////////// - @Schema(title = "사용자 정보", example = "64ed89aa9e813b5ab16da6de") - private String user; + @Getter + @Setter + @Builder + @NoArgsConstructor @AllArgsConstructor + public static class transDto { - @Schema(title = "스케줄표 정보", example = "64ed89aa9e813b5ab16da6de") - private String finalTempl; + @Schema(title = "사용자 고유번호", example = "64ed89aa9e813b5ab16da6de") + private String userId; - @Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de") - private String org; + @Schema(title = "스케줄표 고유번호", example = "64ed89aa9e813b5ab16da6de") + private String finalTemplId; - @Schema(title = "스케줄표 이름", example = "문서1") - @Size(min = 4, max = 255, message = "Minimum name length: 4 characters") - private String name; + @Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de") + private String orgId; + - @JsonProperty("scheduleContent") - @Schema(title = "스케줄표 내용", example = "[]") - private Map content; + @JsonProperty("scheduleContent") + @Schema(title = "스케줄표 내용", example = "[]") + private Map content; - } + } } \ No newline at end of file diff --git a/nw/src/main/java/lab/cherry/nw/repository/ScheduleRepository.java b/nw/src/main/java/lab/cherry/nw/repository/ScheduleRepository.java index 3a5fdf7..0902565 100644 --- a/nw/src/main/java/lab/cherry/nw/repository/ScheduleRepository.java +++ b/nw/src/main/java/lab/cherry/nw/repository/ScheduleRepository.java @@ -21,13 +21,13 @@ public interface ScheduleRepository extends MongoRepository findAll(Pageable pageable); - Page findPageByName(String scheduleName, Pageable pageable); + // Page findPageByName(String scheduleName, Pageable pageable); Page findPageById(String id, Pageable pageable); Optional findById(String id); - Optional findByName(String scheduleName); + // Optional findByName(String scheduleName); List findAllById(List scheduleIds); } \ No newline at end of file diff --git a/nw/src/main/java/lab/cherry/nw/service/Impl/FinalTemplServiceImpl.java b/nw/src/main/java/lab/cherry/nw/service/Impl/FinalTemplServiceImpl.java index 9659e85..c42f2d1 100644 --- a/nw/src/main/java/lab/cherry/nw/service/Impl/FinalTemplServiceImpl.java +++ b/nw/src/main/java/lab/cherry/nw/service/Impl/FinalTemplServiceImpl.java @@ -5,10 +5,12 @@ import lab.cherry.nw.error.exception.EntityNotFoundException; import lab.cherry.nw.model.FinalTemplEntity; import lab.cherry.nw.model.OrgEntity; +import lab.cherry.nw.model.UserCardEntity; import lab.cherry.nw.model.UserEntity; import lab.cherry.nw.repository.FinalTemplRepository; import lab.cherry.nw.service.FinalTemplService; import lab.cherry.nw.service.OrgService; +import lab.cherry.nw.service.UserCardService; import lab.cherry.nw.service.UserService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -36,6 +38,7 @@ public class FinalTemplServiceImpl implements FinalTemplService { private final FinalTemplRepository finalTemplRepository; private final UserService userService; private final OrgService orgService; + private final UserCardService userCardService; /** * [FinalTemplServiceImpl] 최종확인서 템플릿 조회 함수 @@ -70,18 +73,20 @@ public FinalTemplEntity createFinalTemplate(FinalTemplEntity.FinalTemplCreateDto Instant instant = Instant.now(); - UserEntity userEntity = userService.findById(finalTemplCreateDto.getUser()); - OrgEntity orgEntity = orgService.findById(finalTemplCreateDto.getOrg()); + UserEntity userEntity = userService.findById(finalTemplCreateDto.getUserSeq()); + OrgEntity orgEntity = orgService.findById(finalTemplCreateDto.getOrgId()); + UserCardEntity usercard = userCardService.findById(finalTemplCreateDto.getUsercardId()); - FinalTemplEntity finaldocsEntity = FinalTemplEntity.builder() + FinalTemplEntity finaltemplEntity = FinalTemplEntity.builder() .name(finalTemplCreateDto.getName()) .content(finalTemplCreateDto.getContent()) .user(userEntity) + .usercard(usercard) .org(orgEntity) .created_at(instant) .build(); - return finalTemplRepository.save(finaldocsEntity); + return finalTemplRepository.save(finaltemplEntity); } /** @@ -98,8 +103,8 @@ public FinalTemplEntity createFinalTemplate(FinalTemplEntity.FinalTemplCreateDto public void updateById(String id, FinalTemplEntity.FinalTemplUpdateDto finalTempl) { FinalTemplEntity finalTemplEntity = findById(id); - UserEntity userEntity = userService.findById(finalTempl.getUser()); - OrgEntity orgEntity = orgService.findById(finalTempl.getOrg()); + UserEntity userEntity = userService.findById(finalTempl.getUserSeq()); + OrgEntity orgEntity = orgService.findById(finalTempl.getOrgId()); Instant instant = Instant.now(); if (finalTempl.getContent() != null) { diff --git a/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java b/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java index c5aba39..98f6424 100644 --- a/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java +++ b/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java @@ -37,7 +37,7 @@ public class ScheduleServiceImpl implements ScheduleService { private final FinalTemplService finalTemplService; private final UserService userService; private final OrgService orgService; - private final FinaldocsRepository finaldocsRepository; + /** * [scheduleServiceImpl] 스케줄표 조회 함수 @@ -56,29 +56,62 @@ public Page getSchedule(Pageable pageable) { return scheduleRepository.findAll(pageable); } - /** - * [scheduleServiceImpl] 스케줄표 날짜 기준 조회 함수 - * - * @return DB에서 스케줄표 정보 목록을 날짜 기준으로 리턴합니다. - * @throws EntityNotFoundException 스케줄표 정보가 없을 경우 예외 처리 발생 - *
-	 * 전체 스케줄표 조회하여, 날짜에 맞는 스케줄표목록을 반환합니다.
-	 * 
- * - * Author : hhhaeri(yhoo0020@gmail.com) - */ - @Transactional(readOnly = true) - @Override - public ScheduleEntity scheduleByDate(Instant start, Instant end) { + // /** + // * [scheduleServiceImpl] 스케줄표 날짜 기준 조회 함수 + // * + // * @return DB에서 스케줄표 정보 목록을 날짜 기준으로 리턴합니다. + // * @throws EntityNotFoundException 스케줄표 정보가 없을 경우 예외 처리 발생 + // *
+	//  * 전체 스케줄표 조회하여, 날짜에 맞는 스케줄표목록을 반환합니다.
+	//  * 
+ // * + // * Author : hhhaeri(yhoo0020@gmail.com) + // */ + // @Transactional(readOnly = true) + // @Override + // public ScheduleEntity scheduleByDate(Instant start, Instant end) { - List finaldocsEntity = finaldocsRepository.findAllBycreatedAtBetween(start,end); + // List finaldocsEntity = finaldocsRepository.findAllBycreatedAtBetween(start,end); + + // ScheduleEntity scheduleEntity = ScheduleEntity.builder() + // .content(finaldocsEntity) + // .build(); + + // return scheduleEntity; + // } + + + /** + * [scheduleServiceImpl] 스케줄표 생성 함수 + * + * @param scheduleCreateDto 스케줄표 생성에 필요한 조직 등록 정보를 담은 개체입니다. + * @return 스케줄표정보를 리턴합니다. + *
+     * 스케줄표를 등록합니다.
+     * 
+ * + * Author : hhhaeri(yhoo0020@gmail.com) + */ + public ScheduleEntity createSchedule(ScheduleEntity.ScheduleCreateDto scheduleCreateDto) { + + Instant instant = Instant.now(); + + UserEntity userEntity = userService.findById(scheduleCreateDto.getUserSeq()); + OrgEntity orgEntity = orgService.findById(scheduleCreateDto.getOrgId()); + FinalTemplEntity finaltempl = finalTemplService.findById(scheduleCreateDto.getFinaltemplId()); + + ScheduleEntity scheduleEntity = ScheduleEntity.builder() + .content(scheduleCreateDto.getContent()) + .user(userEntity) + .finaltempl(finaltempl) + .org(orgEntity) + .created_at(instant) + .build(); + + return scheduleRepository.save(scheduleEntity); + } - ScheduleEntity scheduleEntity = ScheduleEntity.builder() - .content(finaldocsEntity) - .build(); - return scheduleEntity; - } /** * [scheduleServiceImpl] 스케줄표 생성 함수 @@ -99,19 +132,18 @@ public ScheduleEntity transColumn(ScheduleEntity.transDto scheduleTransDto) { OrgEntity orgEntity = orgService.findById(scheduleTransDto.getOrg()); FinalTemplEntity finalTemplEntity = finalTemplService.findById(scheduleTransDto.getFinalTempl()); - Map content = finalTemplEntity.getContent(); + Map content = finalTemplEntity.getContent(); // Null 값을 가진 값만 가져오기 - Map nullEntries = new HashMap<>(); + Map nullEntries = new HashMap<>(); - for (Map.Entry entry : content.entrySet()) { + for (Map.Entry entry : content.entrySet()) { if (!entry.getValue().equals("")) { nullEntries.put(entry.getKey(), entry.getValue()); } } ScheduleEntity scheduleEntity = ScheduleEntity.builder() - .name(scheduleTransDto.getName()) .column(nullEntries) .user(userEntity) .org(orgEntity) @@ -167,15 +199,15 @@ public ScheduleEntity findById(String id) { * * Author : hhhaeri(yhoo0020@gmail.com) */ - @Transactional(readOnly = true) - public ScheduleEntity findByName(String name) { - return scheduleRepository.findByName(name).orElseThrow(() -> new EntityNotFoundException("Schedule with Name " + name + " Not Found.")); - } - - @Transactional(readOnly = true) - public Page findPageByName(String name, Pageable pageable) { - return scheduleRepository.findPageByName(name, pageable); - } + // @Transactional(readOnly = true) + // public ScheduleEntity findByName(String name) { + // return scheduleRepository.findByName(name).orElseThrow(() -> new EntityNotFoundException("Schedule with Name " + name + " Not Found.")); + // } + + // @Transactional(readOnly = true) + // public Page findPageByName(String name, Pageable pageable) { + // return scheduleRepository.findPageByName(name, pageable); + // } @Transactional(readOnly = true) public Page findPageById(String id, Pageable pageable) { diff --git a/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java b/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java index a0612e6..3f56c9c 100644 --- a/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java +++ b/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java @@ -4,6 +4,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; +import lab.cherry.nw.model.FinalTemplEntity; import lab.cherry.nw.model.ScheduleEntity; /** @@ -18,10 +19,11 @@ public interface ScheduleService { Page getSchedule(Pageable pageable); ScheduleEntity scheduleByDate(Instant fromDate, Instant toDate); + ScheduleEntity createSchedule(ScheduleEntity.ScheduleCreateDto scheduleCreateDto); ScheduleEntity transColumn(ScheduleEntity.transDto scheduleTransDto); ScheduleEntity findById(String id); - ScheduleEntity findByName(String name); + // ScheduleEntity findByName(String name); void deleteById(String id); - Page findPageByName(String name, Pageable pageable); + // Page findPageByName(String name, Pageable pageable); Page findPageById(String id, Pageable pageable); } From c9cbc4638ca3539cedaac74613d7cec3e2c7e627 Mon Sep 17 00:00:00 2001 From: haeri Date: Tue, 7 Nov 2023 03:07:13 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Chore=20:=20=EC=8A=A4=EC=BC=80=EC=A4=84?= =?UTF-8?q?=ED=91=9C,=EC=B5=9C=EC=A2=85=ED=99=95=EC=9D=B8=EC=84=9C=20?= =?UTF-8?q?=ED=85=9C=ED=94=8C=EB=A6=BF=20=EC=B6=94=EA=B0=80=20api=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lab/cherry/nw/service/Impl/ScheduleServiceImpl.java | 6 +++--- nw/src/main/java/lab/cherry/nw/service/ScheduleService.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java b/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java index 98f6424..0717ac0 100644 --- a/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java +++ b/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java @@ -128,9 +128,9 @@ public ScheduleEntity createSchedule(ScheduleEntity.ScheduleCreateDto scheduleCr @Override public ScheduleEntity transColumn(ScheduleEntity.transDto scheduleTransDto) { - UserEntity userEntity = userService.findById(scheduleTransDto.getUser()); - OrgEntity orgEntity = orgService.findById(scheduleTransDto.getOrg()); - FinalTemplEntity finalTemplEntity = finalTemplService.findById(scheduleTransDto.getFinalTempl()); + UserEntity userEntity = userService.findById(scheduleTransDto.getUserId()); + OrgEntity orgEntity = orgService.findById(scheduleTransDto.getOrgId()); + FinalTemplEntity finalTemplEntity = finalTemplService.findById(scheduleTransDto.getFinalTemplId()); Map content = finalTemplEntity.getContent(); diff --git a/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java b/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java index 3f56c9c..e90ab99 100644 --- a/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java +++ b/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java @@ -18,7 +18,7 @@ @Component public interface ScheduleService { Page getSchedule(Pageable pageable); - ScheduleEntity scheduleByDate(Instant fromDate, Instant toDate); + // ScheduleEntity scheduleByDate(Instant fromDate, Instant toDate); ScheduleEntity createSchedule(ScheduleEntity.ScheduleCreateDto scheduleCreateDto); ScheduleEntity transColumn(ScheduleEntity.transDto scheduleTransDto); ScheduleEntity findById(String id);