-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddPostRequest.java
76 lines (57 loc) · 2.62 KB
/
AddPostRequest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.seoultech.sanEseo.post.application.service;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.seoultech.sanEseo.post.domain.Category;
import com.seoultech.sanEseo.public_api.application.service.dto.CoordinateRequest;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
@Getter
public class AddPostRequest {
@NotNull(message = "카테고리는 필수입니다.")
private Category category;
@NotBlank(message = "제목은 필수입니다.")
private String title;
@NotBlank(message = "부제목은 필수입니다.")
private String subTitle;
@NotBlank(message = "코스설명은 필수입니다.")
private String description;
@NotBlank(message = "난이도는 필수입니다.")
private String level;
@NotBlank(message = "소요시간은 필수입니다.")
private String time;
@NotBlank(message = "거리는 0보다 커야합니다.")
private String distance;
@NotBlank(message = "코스 상세는 필수입니다.")
private String courseDetail;
@NotBlank(message = "교통수단은 필수입니다.")
private String transportation;
@NotNull(message = "자치구 ID는 필수입니다.")
private Long districtId;
@NotNull(message = "좌표 정보는 필수입니다.")
private CoordinateRequest geometry;
// 생성자, 게터, 세터 등 추가 필요
// 생성자에 @JsonProperty 어노테이션 추가
public AddPostRequest(@JsonProperty("category") Category category,
@JsonProperty("title") String title,
@JsonProperty("subTitle") String subTitle,
@JsonProperty("description") String description,
@JsonProperty("level") String level,
@JsonProperty("time") String time,
@JsonProperty("distance") String distance,
@JsonProperty("courseDetail") String courseDetail,
@JsonProperty("transportation") String transportation,
@JsonProperty("districtId") Long districtId,
@JsonProperty("geometry") CoordinateRequest geometry) {
this.category = category;
this.title = title;
this.subTitle = subTitle;
this.description = description;
this.level = level;
this.time = time;
this.distance = distance;
this.courseDetail = courseDetail;
this.transportation = transportation;
this.districtId = districtId;
this.geometry = geometry;
}
}