Skip to content

Commit

Permalink
FEAT : Program 상세 뷰 조회 API 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
yummygyudon committed Nov 25, 2023
1 parent ad103fd commit 36aadd5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import java.util.List;
import lombok.RequiredArgsConstructor;
import org.sopt.sopkerton.common.exception.ProgramSuccess;
import org.sopt.sopkerton.program.domain.exception.ProgramSuccess;
import org.sopt.sopkerton.common.response.ApiResponse;
import org.sopt.sopkerton.program.dto.request.ProgramListRequest;
import org.sopt.sopkerton.program.dto.response.ProgramListResponse;
import org.sopt.sopkerton.program.service.ProgramService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -29,4 +27,16 @@ public ResponseEntity<ApiResponse<List<ProgramListResponse>>> programListView(@R
ApiResponse.success(ProgramSuccess.PROGRAM_LIST_VIEW_SUCCESS, programListByProgramType)
);
}

@GetMapping("/detail")
public ResponseEntity<ApiResponse> orderProgramDetail(
@RequestParam("programId") Long programId
) {
Object programDetail = programService.getProgramDetail(1L, programId);
return ResponseEntity
.status(ProgramSuccess.PROGRAM_DETAIL_VIEW_SUCCESS.getHttpStatus())
.body(
ApiResponse.success(ProgramSuccess.PROGRAM_DETAIL_VIEW_SUCCESS, programDetail)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.sopt.sopkerton.program.dto.response;

import com.fasterxml.jackson.annotation.JsonProperty;

public abstract class ProgramDetailResponse {

public record VolunteerDetail(
@JsonProperty("imageUrl")
String imageUrl,
@JsonProperty("content")
String content,
@JsonProperty("organizationName")
String organizationName,
@JsonProperty("registerAt")
String registerAt,
@JsonProperty("hour")
int hour,
@JsonProperty("isApply")
boolean isApply
) {
}

public record EmploymentDetail(
@JsonProperty("imageUrl")
String imageUrl,
@JsonProperty("content")
String content,
@JsonProperty("organizationName")
String organizationName,
@JsonProperty("registerAt")
String registerAt,
@JsonProperty("salary")
int salary,
@JsonProperty("isApply")
boolean isApply
) {
}
}

0 comments on commit 36aadd5

Please sign in to comment.