-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'weekly/11' of https://github.com/kakao-tech-campus-2nd-…
…step3/Team28_BE into week11-haegyeong
- Loading branch information
Showing
31 changed files
with
1,147 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/com/devcard/devcard/mypage/controller/rest/QnAController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.devcard.devcard.mypage.controller.rest; | ||
|
||
import com.devcard.devcard.mypage.dto.NoticeRequest; | ||
import com.devcard.devcard.mypage.dto.NoticeResponse; | ||
import com.devcard.devcard.mypage.dto.NoticeUpdateRequest; | ||
import com.devcard.devcard.mypage.dto.QnAListResponse; | ||
import com.devcard.devcard.mypage.dto.QnARequest; | ||
import com.devcard.devcard.mypage.dto.QnAResponse; | ||
import com.devcard.devcard.mypage.dto.QnAUpdateRequest; | ||
import com.devcard.devcard.mypage.service.QnAService; | ||
import java.util.List; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/qna") | ||
public class QnAController { | ||
|
||
private final QnAService qnAService; | ||
|
||
public QnAController(QnAService qnAService) { | ||
this.qnAService = qnAService; | ||
} | ||
|
||
@GetMapping | ||
public ResponseEntity<List<QnAListResponse>> getAllQnA(){ | ||
return ResponseEntity.status(201).body(qnAService.getQnAList()); | ||
} | ||
|
||
@GetMapping("/{id}") | ||
public ResponseEntity<QnAResponse> getQnA(@PathVariable("id") Long id){ | ||
return ResponseEntity.ok(qnAService.getQnA(id)); | ||
} | ||
|
||
@PostMapping("") | ||
public ResponseEntity<QnAResponse> addQnA(@RequestBody QnARequest qnARequest){ | ||
return ResponseEntity.ok(qnAService.addQnA(qnARequest)); | ||
} | ||
|
||
@PutMapping("") | ||
public ResponseEntity<QnAResponse> updateQnA(@RequestBody QnAUpdateRequest qnAUpdateRequest){ | ||
return ResponseEntity.ok(qnAService.updateQnA(qnAUpdateRequest)); | ||
} | ||
|
||
@DeleteMapping("/{id}") | ||
public ResponseEntity<QnAResponse> deleteQnA(@PathVariable("id") Long id){ | ||
return ResponseEntity.ok(qnAService.deleteQnA(id)); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/devcard/devcard/mypage/dto/QnAAnswerDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.devcard.devcard.mypage.dto; | ||
|
||
public record QnAAnswerDTO(Long id, String answer) { | ||
|
||
} |
Oops, something went wrong.