File tree Expand file tree Collapse file tree
src/main/java/com/closetnangam/be/global/external/naver/dto Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .closetnangam .be .global .external .naver .dto ;
2+
3+ import jakarta .validation .constraints .NotBlank ;
4+ import jakarta .validation .constraints .Size ;
5+ import lombok .AllArgsConstructor ;
6+ import lombok .Getter ;
7+ import lombok .NoArgsConstructor ;
8+
9+ @ Getter
10+ @ NoArgsConstructor
11+ @ AllArgsConstructor
12+ public class NaverItemRequest {
13+
14+ @ NotBlank (message = "상품명은 필수입니다" )
15+ @ Size (max = 255 , message = "상품명은 255자 이하여야 합니다" )
16+ private String title ;
17+
18+ @ NotBlank (message = "상품 링크는 필수입니다" )
19+ @ Size (max = 500 , message = "링크는 500자 이하여야 합니다" )
20+ private String link ;
21+
22+ @ NotBlank (message = "이미지 URL은 필수입니다" )
23+ @ Size (max = 500 , message = "이미지 URL은 500자 이하여야 합니다" )
24+ private String image ;
25+
26+ @ Size (max = 100 )
27+ private String brand ;
28+
29+ @ NotBlank (message = "상품 ID는 필수입니다" )
30+ private String productId ;
31+
32+ @ Size (max = 100 )
33+ private String category1 ;
34+
35+ @ Size (max = 100 )
36+ private String category3 ;
37+
38+ public String getCleanTitle () {
39+ if (this .title == null ) {
40+ return "" ;
41+ }
42+ return this .title .replaceAll ("<[^>]*>" , "" ).trim ();
43+ }
44+ }
Original file line number Diff line number Diff line change 1+ package com .closetnangam .be .global .external .naver .dto .record ;
2+
3+
4+ import com .closetnangam .be .global .external .naver .dto .request .ClothesStyleDto ;
5+ import com .closetnangam .be .global .external .naver .dto .request .ClothingColorDto ;
6+ import com .fasterxml .jackson .annotation .JsonProperty ;
7+ import jakarta .validation .Valid ;
8+ import jakarta .validation .constraints .NotBlank ;
9+ import jakarta .validation .constraints .Size ;
10+
11+ import java .util .List ;
12+
13+ public record NaverProductCreateRequest (
14+ @ NotBlank (message = "상품 ID는 필수입니다." )
15+ String productId ,
16+
17+ String brand ,
18+
19+ String category3 ,
20+
21+ @ JsonProperty ("title" )
22+ @ NotBlank (message = "상품명은 필수입니다." )
23+ @ Size (max = 255 , message = "상품명은 255자 이내여야 합니다." )
24+ String cleanTitle ,
25+
26+ @ NotBlank (message = "이미지 URL은 필수입니다." )
27+ @ Size (max = 500 , message = "이미지 URL이 너무 깁니다." )
28+ String image ,
29+
30+ @ NotBlank (message = "상품 링크는 필수입니다." )
31+ @ Size (max = 500 , message = "링크 주소가 너무 깁니다." )
32+ String link ,
33+
34+ @ JsonProperty ("colors" )
35+ @ Valid
36+ List <ClothingColorDto > colors ,
37+
38+ @ JsonProperty ("styles" )
39+ @ Valid
40+ List <ClothesStyleDto > styles
41+ ) {}
Original file line number Diff line number Diff line change 1+ package com .closetnangam .be .global .external .naver .dto .response ;
2+
3+
4+ public record SaveNaverProductResponse (Long clothesId ) {
5+ }
You can’t perform that action at this time.
0 commit comments