Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into taking
Browse files Browse the repository at this point in the history
  • Loading branch information
taking committed Nov 9, 2023
2 parents 372c4c4 + 8a7062d commit 93a4af8
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 303 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import java.io.IOException;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

@Slf4j
Expand All @@ -27,10 +29,20 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
}

private void logRequestDetails(HttpServletRequest request) {
log.info("RestAPI Call Log\n---\nTimestamp: {}\nIP: {}\nMethod: {}\nRequestURI: {}\n---",
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")),

Instant currentTime = Instant.now();
String PATTERN_FORMAT = "yyyy/MM/dd HH:mm:ss";
String formattedInstant = DateTimeFormatter
.ofPattern(PATTERN_FORMAT)
.withZone(ZoneId.of("Asia/Seoul"))
.format(currentTime);

log.info("RestAPI Call Log\n---\nTimestamp: {}\nIP: {}\nMethod: {}\nRequestURI: {}\nContent-Type: {}\n" + //
"---",
formattedInstant,
request.getRemoteAddr(),
request.getMethod(),
request.getRequestURI());
request.getRequestURI(),
request.getContentType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public ResponseEntity<?> findById(@PathVariable("id") String id) {
@Operation(summary = "최종 확인서 템플릿 삭제", description = "최종 확인서 템플릿을 삭제합니다.")
public ResponseEntity<?> deleteFinalTemplate(@PathVariable("id") String id) {

log.info("[FinaldocsController] deleteFinalTempl...!");
log.info("[FinalTemplController] deleteFinalTempl...!");

finalTemplService.deleteById(id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;
import java.util.Map;
import org.bson.types.ObjectId;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -108,10 +109,11 @@ public ResponseEntity<?> findAllQsheets(
public ResponseEntity<?> createQsheet(@RequestPart QsheetEntity.QsheetCreateDto qsheetCreateDto, @RequestPart(name = "files", required = false) List<MultipartFile> files) {
log.info("[QsheetController] createQsheet...!");

qsheetService.createQsheet(qsheetCreateDto, files);
QsheetEntity qsheetEntity = qsheetService.createQsheet(qsheetCreateDto, files);

final ResultResponse response = ResultResponse.of(SuccessCode.OK);
return new ResponseEntity<>(response, new HttpHeaders(), HttpStatus.OK);
// final ResultResponse response = ResultResponse.of(SuccessCode.OK);
ResultResponse result = ResultResponse.of(SuccessCode.OK, qsheetEntity.getId().toString());
return new ResponseEntity<>(result ,new HttpHeaders(), HttpStatus.OK);
}
/**
* [QsheetController] 큐시트 수정 함수
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
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;
Expand All @@ -23,9 +22,6 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;

/**
* <pre>
Expand Down Expand Up @@ -93,34 +89,7 @@ public ResponseEntity<?> findByScheduleId(@PathVariable("id") String id) {
return new ResponseEntity<>(scheduleService.findById(id), new HttpHeaders(), HttpStatus.OK);
}

/**
* [ScheduleController] 스케줄표 컬럼 변경 함수
*
* @param tranClounm 최종확인서에서 스케줄표에 필요한 컬럼만 담고 있는 객체입니다.
* @return
* <pre>
* true : 성공(200)을 반환합니다.
* false : 에러(400)를 반환합니다.
* </pre>
*
* Author : hhhaeri(yhoo0020@gmail.com)
*/
@PostMapping("/column")
@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<?> fianlToSchedule(@Valid @RequestBody(required = false) ScheduleEntity.transDto scheduleTransDto) {

log.info("[ScheduleController] fianlToSchedule...!");

ScheduleEntity scheduleEntity = scheduleService.transColumn(scheduleTransDto);

return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK);
}



/**
* [ScheduleController] 스케줄표 생성 함수
*
Expand Down Expand Up @@ -148,41 +117,4 @@ public ResponseEntity<?> createFinalTemplate(@Valid @RequestBody(required = fals
return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK);
}




// /**
// * [ScheduleController] 스케줄표 날짜 기준 조회
// *
// * @param 날짜 기준으로 스케줄표를 조회합니다.
// * @return
// * <pre>
// * true : 성공(200)을 반환합니다.
// * false : 에러(400)를 반환합니다.
// * </pre>
// *
// * 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);
// }

}
54 changes: 13 additions & 41 deletions nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.Serializable;
import java.time.Instant;
import java.util.List;
import java.util.Map;

/**
Expand All @@ -31,7 +32,7 @@
@Builder
@NoArgsConstructor @AllArgsConstructor
@Document(collection = "finaltempl")
@JsonPropertyOrder({ "id", "finaltemplName", "content","user", "org", "usercard", "updated_at", "created_at"})
@JsonPropertyOrder({ "id", "content", "user", "org", "updated_at", "created_at"})
public class FinalTemplEntity implements Serializable {

@Id
Expand All @@ -51,22 +52,11 @@ 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;

@JsonProperty("content")
@Schema(title = "최종확인서 템플릿 내용", example = "문서 내용")
private Map<String,Object> content;

// private Map<String, Object> content;
private List<Object> content;


@JsonProperty("updated_at")
@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss", locale = "ko_KR", timezone = "Asia/Seoul")
Expand All @@ -78,19 +68,13 @@ public class FinalTemplEntity implements Serializable {
@Schema(title = "최종확인서 템플릿 생성 시간", example = "2023-07-04 12:00:00")
private Instant created_at;


//////////////////////////////////////////////////////////////////////////

@Getter
@Builder
@NoArgsConstructor @AllArgsConstructor
public static class FinalTemplCreateDto {

@NotBlank
@Schema(title = "최종확인서 템플릿 이름", example = "예식장 최종 확인서 양식")
@Size(min = 4, max = 255, message = "Minimum name length: 4 characters")
private String name;

@NotBlank
@Schema(title = "사용자 고유번호", example = "64ed89aa9e813b5ab16da6de")
private String userSeq;
Expand All @@ -99,36 +83,24 @@ public static class FinalTemplCreateDto {
@Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de")
private String orgId;

@NotBlank
@Schema(title = "고객카드 고유 번호", example = "문서 내용")
private String usercardId;


@Schema(title = "최종확인서 템플릿 내용", example = "문서 내용")
private Map<String,Object> content;


private List<Object> content;

}


@Getter
@Builder
@NoArgsConstructor @AllArgsConstructor
public static class FinalTemplUpdateDto {

@Schema(title = "사용자 고유 번호", example = "64ed89aa9e813b5ab16da6de")
private String userSeq;

@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 = "64ed89aa9e813b5ab16da6de")
private String userSeq;

@Schema(title = "최종확인서 템플릿 내용", example = "문서 내용")
private Map<String, Object> content;
@Schema(title = "조직 고유 번호", example = "64ed89aa9e813b5ab16da6de")
private String orgId;

@Schema(title = "최종확인서 템플릿 내용", example = "문서 내용")
private List<Object> content;

}

Expand Down
8 changes: 4 additions & 4 deletions nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.Serializable;
import java.time.Instant;
import java.util.List;
import java.util.Map;

/**
Expand Down Expand Up @@ -64,8 +65,7 @@ public class FinaldocsEntity implements Serializable {

@JsonProperty("content")
@Schema(title = "최종확인서 내용", example = "")
private Map<String,String> content;

private List<Object> content;


@JsonProperty("updated_at")
Expand Down Expand Up @@ -109,7 +109,7 @@ public static class FinaldocsCreateDto {
// @NotBlank
@JsonProperty("content")
@Schema(title = "최종확인서 내용", example = "")
private Map<String,String> content;
private List<Object> content;


}
Expand All @@ -133,7 +133,7 @@ public static class FinaldocsUpdateDto {
private String org;

@Schema(title = "최종확인서 내용", example = "")
private Map<String,String> content;
private List<Object> content;


}
Expand Down
20 changes: 16 additions & 4 deletions nw/src/main/java/lab/cherry/nw/model/QsheetEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.aggregation.VariableOperators.Map;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
Expand Down Expand Up @@ -52,7 +53,6 @@ public class QsheetEntity implements Serializable {

@JsonProperty("name")
@Schema(title = "큐시트 이름", type="String",example = "최해리_230824")
@Size(min = 4, max = 255, message = "Minimum name length: 4 characters")
private String name;

@JsonProperty("data")
Expand Down Expand Up @@ -102,14 +102,26 @@ public static class ItemData {
private String actor;
@Schema(title = "비고", example = "신부가 노래를 못함")
private String note;
@Schema(title = "파일위치", example = "./")
private String filePath;
@Schema(title = "파일 이름", example = "[축가.mp3, 축하영상.mp4]")
private List<String> fileName;
@Schema(title = "파일 정보")
private List<FileInfo> fileInfo;
}

@Getter
@Builder
@NoArgsConstructor @AllArgsConstructor
public static class FileInfo {
@Schema(title = "파일 이름", example = "축가.mp3")
private String name;
@Schema(title = "다운로드 링크", type= "String", example = "/api/v1/38352658567418867")
private String link;
}
@Getter
@Builder
@NoArgsConstructor @AllArgsConstructor
public static class FinalConfirm {
@Schema(title = "업체 확인자 정보",type="String",example = "38352658567418867")
@Schema(title = "업체 확인자 정보", type="String", example = "38352658567418867")
private String org_approver;
@Schema(title = "업체 확인", type="Boolean", example = "false")
private boolean org_confirm;
Expand Down
Loading

0 comments on commit 93a4af8

Please sign in to comment.