[개발] - Spring/Thymeleaf
요구사항 (또) 추가
완벽한 장면
2023. 11. 30. 01:37
요구사항 추가
타임리프를 사용해서 폼에서 체크박스, 라디오 버튼, 셀렉트 박스를 편리하게 사용하는 방법을 학습하기 위한 작업
내용
이미지 예시
ItemType
public enum ItemType {
BOOK("도서"), FOOD("음식"), ETC("기타");
private final String description; // 설명
ItemType(String description) { // 생성자
this.description = description;
}
public String getDescription() {
return description;
}
}
DeliveryCode
/**
* FAST : 빠른 배송
* NORMAL : 일반 배송
* SLOW : 느린 배송
*/
@Data
@AllArgsConstructor
public class DeliveryCode {
private String code;
private String displayName;
}
Item
@Data
@NoArgsConstructor
public class Item {
private Long id;
private String itemName;
private Integer price;
private Integer quantity;
// 추가
private boolean open; // 판매 여부
private List<String> regions; // 등록 지역
private ItemType itemType; // 상품 종류
private String deliveryCode; // 배송 방식
public Item(String itemName, Integer price, Integer quantity) {
this.itemName = itemName;
this.price = price;
this.quantity = quantity;
}
}
728x90
반응형