Skip to content

Commit

Permalink
#82 fix : controller 응답 객체 생성, 수정에 대해 GetProjectResponse -> Void
Browse files Browse the repository at this point in the history
  • Loading branch information
rivkode committed Apr 29, 2024
1 parent 95769f0 commit b47ab61
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.seoultech.synergybe.domain.project.Project;
import com.seoultech.synergybe.domain.project.dto.request.CreateProjectRequest;
import com.seoultech.synergybe.domain.project.dto.request.UpdateProjectRequest;
import com.seoultech.synergybe.domain.project.dto.response.GetListProjectResponse;
import com.seoultech.synergybe.domain.project.dto.response.GetProjectResponse;
import com.seoultech.synergybe.domain.project.service.ProjectService;
import com.seoultech.synergybe.domain.user.User;
Expand Down Expand Up @@ -31,7 +32,7 @@ public class ProjectController {

@Operation(summary = "프로젝트 생성", description = "프로젝트가 생성됩니다.")
@PostMapping
public ResponseEntity<String> createProject(@Valid @RequestBody CreateProjectRequest request, @LoginUser String userId) {
public ResponseEntity<GetProjectResponse> createProject(@Valid @RequestBody CreateProjectRequest request, @LoginUser String userId) {

return ResponseEntity.status(HttpStatus.CREATED).body(projectService.createProject(userId, request));
}
Expand All @@ -45,9 +46,10 @@ public ResponseEntity<Void> updateProject(@Valid @RequestBody UpdateProjectReque

@Operation(summary = "프로젝트 삭제", description = "프로젝트가 삭제됩니다.")
@DeleteMapping(value = "/{projectId}")
public ResponseEntity<GetProjectResponse> deleteProject(@PathVariable("projectId") String projectId, @LoginUser String userId) {
public ResponseEntity<Void> deleteProject(@PathVariable("projectId") String projectId, @LoginUser String userId) {
projectService.deleteProject(userId, projectId);

return ResponseEntity.status(HttpStatus.OK).body(projectService.deleteProject(userId, projectId));
return ResponseEntity.noContent().build();
}

@Operation(summary = "프로젝트 조회", description = "프로젝트를 단건 조회합니다.")
Expand All @@ -59,9 +61,9 @@ public ResponseEntity<GetProjectResponse> getProject(@PathVariable("projectId")

@Operation(summary = "프로젝트 목록", description = "최근 프로젝트들의 목록을 반환하며, end값(default로는 long 최대값)으로 마지막 조회된 프로젝트Id를 전달받으며 이후 10개의 post만 반환합니다")
@GetMapping("/recent")
public ResponseEntity<ListResponse<GetProjectResponse>> getProjectList(@RequestParam(value = "end", required = false, defaultValue = "9223372036854775807") Long end) {
public ResponseEntity<GetListProjectResponse> getProjectList(@RequestParam(value = "offset", required = false) Long offset) {

return ResponseEntity.status(HttpStatus.OK).body(projectService.getProjectList(end));
return ResponseEntity.status(HttpStatus.OK).body(projectService.getProjectList(offset));
}

@Operation(summary = "검색어를 포함하는 프로젝트", description = "검색어를 포함하는 프로젝트가 반환됩니다")
Expand Down

0 comments on commit b47ab61

Please sign in to comment.