Skip to content

Commit

Permalink
✨ feat: create read mindmap controller #30
Browse files Browse the repository at this point in the history
  • Loading branch information
noparamin committed Nov 3, 2023
1 parent 7e6d884 commit 0966de1
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.smart.watchboard.common.support.AudioConcatenator;
import com.smart.watchboard.common.support.AwsS3Uploader;
import com.smart.watchboard.dto.KeywordsDto;
import com.smart.watchboard.dto.MindmapDto;
import com.smart.watchboard.service.FileService;
import com.smart.watchboard.service.MindmapService;
import io.swagger.v3.oas.annotations.Operation;
Expand Down Expand Up @@ -32,13 +33,22 @@ public class GraphController {

@PostMapping("/graph/{documentID}")
@Operation(summary = "마인드맵 생성", description = "음성 데이터를 받아 ai 서버에 마인드맵 요청한다.")
public ResponseEntity<?> getMindmap(@PathVariable(value = "documentID") long documentId, @RequestParam("audioFile") MultipartFile audioFile, @RequestParam(value = "fileID", required = false) Long fileId, @RequestHeader("Authorization") String accessToken) {
public ResponseEntity<?> createMindmap(@PathVariable(value = "documentID") long documentId, @RequestParam("audioFile") MultipartFile audioFile, @RequestParam(value = "fileID", required = false) Long fileId, @RequestHeader("Authorization") String accessToken) {
//awsS3Uploader.uploadFile(audioFile, documentId, fileId);
//awsS3Uploader.deleteFile();

return new ResponseEntity<>("{\"root\":1,\"keywords\":[\"나는\",\"eat\",\"food\",\"today\"],\"graph\":{\"1\":[0,2],\"2\":[3]}}", HttpStatus.OK);
}

@GetMapping("/documents/{documentID}/mindmap")
@Operation(summary = "마인드맵 조회", description = "마인드맵 조회")
public ResponseEntity<?> getMindmap(@PathVariable(value = "documentID") long documentId, @RequestHeader("Authorization") String accessToken) {
MindmapDto mindmapDto = mindmapService.getMindmap(documentId);

return new ResponseEntity<>(mindmapDto, HttpStatus.OK);
}


@PutMapping("/documents/{documentID}/mindmap/keyword")
@Operation(summary = "키워드 업데이트", description = "키워드 추가 및 삭제")
public ResponseEntity<?> updateKeywords(@PathVariable(value = "documentID") long documentId, @RequestHeader("Authorization") String accessToken, @RequestBody KeywordsDto keywordsDto) {
Expand Down

0 comments on commit 0966de1

Please sign in to comment.