Skip to content

Commit

Permalink
Merge pull request #60 from potenday-project/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
oU-Ua authored Jan 5, 2024
2 parents e022cc7 + 91986f6 commit da9cad8
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
package mvc.promiseme.calendar.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import mvc.promiseme.calendar.dto.CalendarAndTodoAllByRoleDto;
import mvc.promiseme.calendar.dto.CalendarResponseDTO;
import mvc.promiseme.calendar.service.CalendarService;
import mvc.promiseme.common.exception.ErrorResponse;
import mvc.promiseme.project.dto.ProjectResponseDTO;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -19,6 +27,7 @@
@Slf4j
@Controller
@RequiredArgsConstructor
@Tag(name = "Calendar", description = "일정 API")
@RequestMapping("/calendar")
public class CalendarController {
private final CalendarService calendarService;
Expand All @@ -29,6 +38,12 @@ public class CalendarController {
//
// }

@Operation(summary = "메인페이지", description = "프로젝트에 관련된 일정, todo 모두 조회한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = CalendarAndTodoAllByRoleDto.class))),
@ApiResponse(responseCode = "401", description = "프로젝트를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))

})
@GetMapping("/todoAll")
public ResponseEntity<List<CalendarAndTodoAllByRoleDto>> calendarTodoAll(
@RequestParam(name = "projectId") Long projectId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package mvc.promiseme.meeting.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import mvc.promiseme.common.exception.ErrorResponse;
import mvc.promiseme.meeting.dto.MeetingResponseDTO;
import mvc.promiseme.meeting.dto.SummaryRequestDTO;
import mvc.promiseme.meeting.service.MeetingService;
Expand All @@ -14,22 +21,43 @@
@Slf4j
@RestController
@CrossOrigin(origins ="*", allowedHeaders = "*")
@Tag(name = "Meeting", description = "회의 API")
@RequestMapping("/meeting")
@RequiredArgsConstructor
public class MeetingController {

private final MeetingService meetingService;
@Operation(summary = "회의 조회", description = "해당 프로젝트의 회의를 조회한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = MeetingResponseDTO.class))),
@ApiResponse(responseCode = "401", description = "해당 프로젝트를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))


})
@GetMapping("/")
public ResponseEntity<List<MeetingResponseDTO>> meetingAll(@RequestParam(name="projectId") Long projectId){
return ResponseEntity.ok(meetingService.meetingAll(projectId));
}

@Operation(summary = "음성 텍스트 변환", description = "음성을 텍스트로 변환한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "401", description = "해당 프로젝트를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))

})
@PostMapping("/transfer")
public ResponseEntity<String> transferVoice(@RequestParam("voiceFile") MultipartFile multipartFile, @RequestParam("projectId") Long projectId){
return ResponseEntity.ok(meetingService.voiceToMeeting(multipartFile, projectId));
}
@Operation(summary = "회의 요약", description = "회의 내용을 clova studio를 이용하여 요약한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "401", description = "해당 프로젝트를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "401", description = "해당 회의를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "501", description = "알수 없는 에러로 투두를 생성할 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))


})
@PostMapping("/summary")
public ResponseEntity<String> summaryText(@RequestBody SummaryRequestDTO summaryRequestDTO) {
return ResponseEntity.ok(meetingService.textToMeeting(summaryRequestDTO.getMeetingContent(), summaryRequestDTO.getProjectId()));
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/mvc/promiseme/todo/controller/TodoController.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package mvc.promiseme.todo.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import mvc.promiseme.common.exception.ErrorResponse;
import mvc.promiseme.project.dto.ProjectResponseDTO;
import mvc.promiseme.todo.dto.TodoRequestDTO;
import mvc.promiseme.todo.dto.TodoResponseDTO;
import mvc.promiseme.todo.service.TodoService;
Expand All @@ -15,27 +23,59 @@

@Slf4j
@RestController
@Tag(name = "Todo", description = "투두 API")
@RequiredArgsConstructor
@RequestMapping("/todo")
public class TodoController {
private final TodoService todoService;

@Operation(summary = "투두생성", description = "projectId, userId, 내용, 날짜를 입력 받아 Todo 생성한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "401", description = "해당 프로젝트를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "401", description = "해당 사용자를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "501", description = "알수 없는 에러로 투두를 생성할 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))


})
@PostMapping("/")
public ResponseEntity<String> insertTodo(@RequestBody TodoRequestDTO todoRequestDTO){
return ResponseEntity.ok(todoService.insert(todoRequestDTO));
}
@Operation(summary = "투두 조회", description = "projectId, userId, 날짜를 입력 받아 해당하는 TODO를 조회한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = TodoResponseDTO.class))),
@ApiResponse(responseCode = "401", description = "해당 프로젝트를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "401", description = "해당 사용자를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),

})
@GetMapping("/")
public ResponseEntity<List<TodoResponseDTO>> todoAll(@RequestParam(name = "projectId") Long projectId
, @RequestParam(name = "userId") Long userId, @RequestParam(name = "todoDate") String todoDate){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate localDate = LocalDate.parse(todoDate, formatter);
return ResponseEntity.ok(todoService.todoAll(projectId, userId, localDate));
}
@Operation(summary = "투두 수정", description = "projectId, userId, 내용, 날짜를 입력 받아 Todo 수정한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "401", description = "해당 프로젝트를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "401", description = "해당 사용자를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "501", description = "알수 없는 에러로 투두를 생성할 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))


})
@PostMapping("/edit")
public ResponseEntity<String> editTodo(@RequestBody TodoRequestDTO todoRequestDTO){
return ResponseEntity.ok(todoService.edit(todoRequestDTO));
}

@Operation(summary = "투두생성", description = "해당 Todo 완료여부를 체크한다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "401", description = "해당 TODO를 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),

})
@PostMapping("/check")
public ResponseEntity<String> checkTodo(@RequestBody Map<String, Object> requestBody){
Integer tmp = (Integer) requestBody.get("todoId");
Expand Down

0 comments on commit da9cad8

Please sign in to comment.