Skip to content

Commit

Permalink
feat: 이미지 업로드 안하면, 스파크 장소 이미지 리턴하도록 구현 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
ympark99 committed Oct 17, 2023
1 parent 9ec45c1 commit 0b34d15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.onna.onnaback.domain.spark.domain.CapacityType;
import com.onna.onnaback.domain.spark.domain.DurationHour;
import com.onna.onnaback.domain.spark.domain.SortType;
import com.onna.onnaback.domain.spark.domain.Spark;
import com.onna.onnaback.domain.spark.domain.SparkType;

import io.swagger.v3.oas.annotations.Operation;
Expand Down Expand Up @@ -75,8 +76,10 @@ public ResponseEntity<SparkHostResponse> host(@AuthenticationPrincipal CustomUse
capacity, durationHour, hostDetail, chatUrl);

Member host = customUserDetails.getMember();
Spark spark = this.sparkUseCase.uploadSpark(host, hostDto);
return ResponseEntity.ok().body(
new SparkHostResponse(this.sparkUseCase.uploadSpark(host, hostDto).getSparkId())
new SparkHostResponse(spark.getSparkId(),
img == null ? spark.getPlace().getImg() : spark.getImg())
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
public class SparkHostResponse {
Long sparkId;

public SparkHostResponse(Long sparkId) {
String img;

public SparkHostResponse(Long sparkId, String img) {
this.sparkId = sparkId;
this.img = img;
}
}

0 comments on commit 0b34d15

Please sign in to comment.