Skip to content

Commit

Permalink
feat: 주최 api - 무제한/제한 enum 및 로직 추가 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
ympark99 committed Sep 9, 2023
1 parent 70d8b3a commit 19572cd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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.CapacityType;
import com.onna.onnaback.domain.spark.domain.DurationHour;
import com.onna.onnaback.domain.spark.domain.SparkType;

Expand All @@ -25,6 +26,8 @@ public class HostDto {

Long price;

CapacityType capacityType;

Long capacity;

DurationHour durationHour;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.time.LocalDateTime;

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

Expand All @@ -23,6 +24,8 @@ public class HostListDto {

Long memberCount;

CapacityType capacityType;

Long capacity;

Long price;
Expand All @@ -35,14 +38,15 @@ public class HostListDto {

@Builder
public HostListDto(Long sparkId, String placeName, Always always, LocalDateTime sparkDate,
DurationHour durationHour, Long memberCount, Long capacity,
DurationHour durationHour, Long memberCount, CapacityType capacityType, Long capacity,
Long price, String title, RecruitType recruitType, Long waitingCount) {
this.sparkId = sparkId;
this.placeName = placeName;
this.always = always;
this.sparkDate = sparkDate;
this.durationHour = durationHour;
this.memberCount = memberCount;
this.capacityType = capacityType;
this.capacity = capacity;
this.price = price;
this.title = title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public List<HostListDto> getHostList(Member host) {
spark.getSparkDate(),
spark.getDurationHour(),
spark.getMemberCount(),
spark.getCapacityType(),
spark.getCapacity(),
spark.getPrice(),
spark.getTitle(),
Expand Down Expand Up @@ -211,6 +212,7 @@ public String saveApply(Member host, Place place, HostDto hostDto) {
.sparkDate(localDateTime)
.price(hostDto.getPrice())
.memberCount(0L)
.capacityType(hostDto.getCapacityType())
.capacity(hostDto.getCapacity())
.durationHour(hostDto.getDurationHour())
.hostDetail(hostDto.getHostDetail())
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 CapacityType {
UNLIMITED, LIMIT
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public class Spark extends BaseEntity {
@Column(name = "price")
private Long price;

@Column(name = "capacityType")
@Enumerated(value = EnumType.STRING)
private CapacityType capacityType;

@Column(name = "capacity")
private Long capacity;

Expand Down Expand Up @@ -95,7 +99,8 @@ public class Spark extends BaseEntity {

@Builder
public Spark(String title, String description, SparkType type, Always always, LocalDateTime sparkDate,
Long memberCount, Long price, Long capacity, DurationHour durationHour, String hostDetail,
Long memberCount, Long price, CapacityType capacityType, Long capacity,
DurationHour durationHour, String hostDetail,
RecruitType recruitType, Member host, Place place, String img
) {
this.title = title;
Expand All @@ -105,6 +110,7 @@ public Spark(String title, String description, SparkType type, Always always, Lo
this.sparkDate = sparkDate;
this.memberCount = memberCount;
this.price = price;
this.capacityType = capacityType;
this.capacity = capacity;
this.durationHour = durationHour;
this.hostDetail = hostDetail;
Expand Down

0 comments on commit 19572cd

Please sign in to comment.