|
@@ -1,10 +1,15 @@
|
1
|
1
|
package com.oqpo.api.web.dto.response.oper.ntice;
|
2
|
2
|
|
3
|
3
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
4
|
+import com.oqpo.api.entity.oper.FileEntity;
|
4
|
5
|
import com.oqpo.api.entity.oper.NticeEntity;
|
|
6
|
+import com.oqpo.api.web.dto.response.session.SessionResponse;
|
5
|
7
|
import io.swagger.annotations.ApiModelProperty;
|
6
|
8
|
import lombok.*;
|
7
|
9
|
|
|
10
|
+import java.util.List;
|
|
11
|
+import java.util.stream.Collectors;
|
|
12
|
+
|
8
|
13
|
@Getter
|
9
|
14
|
@Setter
|
10
|
15
|
@Builder
|
|
@@ -63,7 +68,10 @@ public class NticeResponse {
|
63
|
68
|
@ApiModelProperty(value = "공급사대상여부")
|
64
|
69
|
private String supplyChk;
|
65
|
70
|
|
66
|
|
- public static NticeResponse toDTO(NticeEntity entity) {
|
|
71
|
+ @ApiModelProperty(value = "파일번호")
|
|
72
|
+ private List<FileInfo> fileNoList;
|
|
73
|
+
|
|
74
|
+ public static NticeResponse toDTO(NticeEntity entity, List<FileEntity> fileInfoList) {
|
67
|
75
|
if (entity == null) return null;
|
68
|
76
|
return NticeResponse.builder()
|
69
|
77
|
.nticeNo(entity.getNticeNo())
|
|
@@ -79,10 +87,40 @@ public class NticeResponse {
|
79
|
87
|
.notiStDay(entity.getNotiStDay())
|
80
|
88
|
.notiEdDay(entity.getNotiEdDay())
|
81
|
89
|
.fileNo(entity.getFileNo() == null ? "" : entity.getFileNo())
|
|
90
|
+ .fileNoList(fileInfoList.stream()
|
|
91
|
+ .map(m -> FileInfo.builder()
|
|
92
|
+ .fileNo(m.getFileNo())
|
|
93
|
+ .fileSeq(m.getFileSeq())
|
|
94
|
+ .filePath(m.getFilePath())
|
|
95
|
+ .fileNm(m.getFileNm())
|
|
96
|
+ .fileOrgNm(m.getFileOrgNm())
|
|
97
|
+ .build())
|
|
98
|
+ .collect(Collectors.toList()))
|
82
|
99
|
.viewCnt(entity.getViewCnt())
|
83
|
100
|
.brandChk(entity.getBrandChk() == null ? "N" : entity.getBrandChk())
|
84
|
101
|
.shopChk(entity.getShopChk() == null ? "N" : entity.getShopChk())
|
85
|
102
|
.supplyChk(entity.getSupplyChk() == null ? "N" : entity.getSupplyChk())
|
86
|
103
|
.build();
|
87
|
104
|
}
|
|
105
|
+
|
|
106
|
+ @Getter
|
|
107
|
+ @Builder
|
|
108
|
+ @AllArgsConstructor(access = AccessLevel.PROTECTED)
|
|
109
|
+ static class FileInfo {
|
|
110
|
+ @ApiModelProperty(value = "파일번호")
|
|
111
|
+ private String fileNo;
|
|
112
|
+
|
|
113
|
+ @ApiModelProperty(value = "파일순번")
|
|
114
|
+ private Integer fileSeq;
|
|
115
|
+
|
|
116
|
+ @ApiModelProperty(value = "파일경로")
|
|
117
|
+ private String filePath;
|
|
118
|
+
|
|
119
|
+ @ApiModelProperty(value = "파일명")
|
|
120
|
+ private String fileNm;
|
|
121
|
+
|
|
122
|
+ @ApiModelProperty(value = "원파일명")
|
|
123
|
+ private String fileOrgNm;
|
|
124
|
+ }
|
88
|
125
|
}
|
|
126
|
+
|