Skip to content

Commit

Permalink
feat(core): QnA 상세 조회 Api
Browse files Browse the repository at this point in the history
  • Loading branch information
Woongbin06 committed Dec 29, 2023
1 parent 8445d5e commit 67ef8ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public List<QnAResponse> findAll(@RequestParam(name = "category", required = fal
return queryQnAService.findAllByCategory(category);
}

@GetMapping("/{qna-id}")
public QnAResponse findOne(@PathVariable(name = "qna-id") Long qnAId) {
return queryQnAService.findOne(qnAId);
}

@ResponseStatus(HttpStatus.NO_CONTENT)
@PutMapping("/{qna-id}")
public void updateQnA(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sickgyun.server.core.service.qna;

import com.sickgyun.server.core.presentation.qna.dto.QnAResponse;
import com.sickgyun.server.core.qna.QnA;
import com.sickgyun.server.core.service.qna.implementation.QnAReader;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand All @@ -26,4 +27,9 @@ public List<QnAResponse> findAllByCategory(String category) {
.map(QnAResponse::from)
.toList();
}

public QnAResponse findOne(Long qnAId) {
QnA qna = qnAReader.read(qnAId);
return QnAResponse.from(qna);
}
}

0 comments on commit 67ef8ae

Please sign in to comment.