-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.fortune.eyesee.controller; | ||
|
||
import com.fortune.eyesee.common.response.BaseResponse; | ||
import com.fortune.eyesee.dto.ExamCodeRequestDTO; | ||
import com.fortune.eyesee.dto.UserInfoRequestDTO; | ||
import com.fortune.eyesee.service.SessionService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequestMapping("/api/sessions") | ||
public class SessionController { | ||
|
||
private final SessionService sessionService; | ||
|
||
@Autowired | ||
public SessionController(SessionService sessionService) { | ||
this.sessionService = sessionService; | ||
} | ||
|
||
// 시험 세션 입장 | ||
@PostMapping("/join") | ||
public ResponseEntity<BaseResponse<String>> joinExam(@RequestBody ExamCodeRequestDTO examCodeRequestDTO) { | ||
sessionService.joinExamSession(examCodeRequestDTO.getExamCode()); | ||
return ResponseEntity.ok(new BaseResponse<>("시험 세션 입장에 성공했습니다.")); | ||
} | ||
|
||
// 사용자 정보 입력 | ||
@PostMapping("/student") | ||
public ResponseEntity<BaseResponse<String>> addUserInfo(@RequestBody UserInfoRequestDTO userInfoRequestDTO) { | ||
sessionService.addUserInfo(userInfoRequestDTO); | ||
return ResponseEntity.ok(new BaseResponse<>("사용자 정보 입력에 성공했습니다.")); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.fortune.eyesee.dto; | ||
|
||
import lombok.Data; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
@Data | ||
public class ExamRequestDTO { | ||
private String examName; | ||
private String examSemester; | ||
private Integer examStudentNumber; | ||
private String examLocation; | ||
private LocalDate examDate; | ||
private LocalTime examStartTime; | ||
private Integer examDuration; | ||
private Integer examQuestionNumber; | ||
private Integer examTotalScore; | ||
private String examNotice; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
package com.fortune.eyesee.dto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class UserInfoRequestDTO { | ||
private String name; // 사용자 이름 | ||
private String department; // 학과 | ||
private Integer userNum; // 학번 | ||
private Integer seatNum; // 좌석 번호 | ||
} |