Skip to content

Commit

Permalink
feat: spark 엔티티에 상시 항목 추가 (#47)
Browse files Browse the repository at this point in the history
* refactor: 멤버 호출 로직 리팩토링 (#14)

* feat: 주최내역 - 신청목록 조회 api 구현 (#14)

* feat: 주최내역 - 신청목록 조회 api memberId 추가 (#14)

* feat: 주최내역 - 신청목록 수락/거절 api 구현 (#14)

* feat: 주최 엔티티 상시 항목 추가 (#14)

* refactor: 필요없는 디버그 삭제 (#14)
  • Loading branch information
ympark99 authored Sep 5, 2023
1 parent e628739 commit 3a9c559
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
package com.onna.onnaback.domain.spark.adapter.in.web.request;

import com.onna.onnaback.domain.spark.domain.Always;
import com.onna.onnaback.domain.spark.domain.DurationHour;
import com.onna.onnaback.domain.spark.domain.SparkType;

import lombok.Getter;

@Getter
public class HostDto {

private Long hostId;
Long hostId;

Long placeId;

private Long placeId;
String title;

private String title;
String description;

private String description;
SparkType type;

private SparkType type;
Always always; // 상시, 상시x

private String sparkDate;
String sparkDate; // 주최 일시

private Long price;
Long price;

private Long capacity;
Long capacity;

private DurationHour durationHour;
DurationHour durationHour;

private String hostDetail;
String hostDetail;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.LocalDateTime;

import com.onna.onnaback.domain.spark.domain.Always;
import com.onna.onnaback.domain.spark.domain.DurationHour;
import com.onna.onnaback.domain.spark.domain.RecruitType;

Expand All @@ -14,6 +15,8 @@ public class HostListDto {

String placeName;

Always always;

LocalDateTime sparkDate;

DurationHour durationHour;
Expand All @@ -29,11 +32,12 @@ public class HostListDto {
RecruitType recruitType;

@Builder
public HostListDto(Long sparkId, String placeName, LocalDateTime sparkDate,
public HostListDto(Long sparkId, String placeName, Always always, LocalDateTime sparkDate,
DurationHour durationHour, Long memberCount, Long capacity,
Long price, String title, RecruitType recruitType) {
this.sparkId = sparkId;
this.placeName = placeName;
this.always = always;
this.sparkDate = sparkDate;
this.durationHour = durationHour;
this.memberCount = memberCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public List<HostListDto> getHostList(Member host) {
hostListDtos.add(new HostListDto(
spark.getSparkId(),
spark.getPlace().getName(),
spark.getAlways(),
spark.getSparkDate(),
spark.getDurationHour(),
spark.getMemberCount(),
Expand Down Expand Up @@ -196,6 +197,7 @@ public String saveApply(Member host, Place place, HostDto hostDto) {
.title(hostDto.getTitle())
.description(hostDto.getDescription())
.type(hostDto.getType())
.always(hostDto.getAlways())
.sparkDate(localDateTime)
.price(hostDto.getPrice())
.memberCount(0L)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.onna.onnaback.domain.spark.domain;

public enum Always {
ALWAYS, NOT_ALWAYS
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public class Spark extends BaseEntity {
@Enumerated(value = EnumType.STRING)
private SparkType type;

@Column(name = "always")
@Enumerated(value = EnumType.STRING)
private Always always;

@Column(name = "sparkDate")
private LocalDateTime sparkDate;

Expand Down Expand Up @@ -91,13 +95,14 @@ public class Spark extends BaseEntity {
List<MemberSparkMapping> memberSparkMappingList = new ArrayList<>();

@Builder
public Spark(String title, String description, SparkType type, LocalDateTime sparkDate,
public Spark(String title, String description, SparkType type, Always always, LocalDateTime sparkDate,
Long memberCount, Long price, Long capacity, DurationHour durationHour, String hostDetail,
RecruitType recruitType, Member host, Place place,String img
RecruitType recruitType, Member host, Place place, String img
) {
this.title = title;
this.description = description;
this.type = type;
this.always = always;
this.sparkDate = sparkDate;
this.memberCount = memberCount;
this.price = price;
Expand Down

0 comments on commit 3a9c559

Please sign in to comment.