Skip to content

Commit

Permalink
chore :: request 변수로 빼기
Browse files Browse the repository at this point in the history
  • Loading branch information
ani2689 committed Oct 20, 2023
1 parent f8f6bf3 commit 8cac0d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,43 @@ class AuthController(
) {
@PostMapping("/student")
fun studentSignUp(@RequestBody @Valid webRequest: StudentSignUpWebRequest): ResponseEntity<Void> {
authService.studentSignUp(authRequestMapper.studentSignUpWebRequestToDto(webRequest))
val request = authRequestMapper.studentSignUpWebRequestToDto(webRequest)
authService.studentSignUp(request)
return ResponseEntity.status(HttpStatus.CREATED).build()
}

@PostMapping("/teacher")
fun teacherSignUp(@RequestBody @Valid webRequest: TeacherSignUpWebRequest): ResponseEntity<Void> {
authService.teacherSignUp(authRequestMapper.teacherSignUpWebRequestToDto(webRequest))
val request = authRequestMapper.teacherSignUpWebRequestToDto(webRequest)
authService.teacherSignUp(request)
return ResponseEntity.status(HttpStatus.CREATED).build()
}

@PostMapping("/professor")
fun professorSignUp(@RequestBody @Valid webRequest: ProfessorSignUpWebRequest): ResponseEntity<Void> {
authService.professorSignUp(authRequestMapper.professorSignUpWebRequestToDto(webRequest))
val request = authRequestMapper.professorSignUpWebRequestToDto(webRequest)
authService.professorSignUp(request)
return ResponseEntity.status(HttpStatus.CREATED).build()
}

@PostMapping("/government")
fun governmentSignUp(@RequestBody @Valid webRequest: GovernmentSignUpWebRequest): ResponseEntity<Void> {
authService.governmentSignUp(authRequestMapper.governmentSignUpWebRequestToDto(webRequest))
val request = authRequestMapper.governmentSignUpWebRequestToDto(webRequest)
authService.governmentSignUp(request)
return ResponseEntity.status(HttpStatus.CREATED).build()
}

@PostMapping("/company-instructor")
fun companyInstructorSignUp(@RequestBody @Valid webRequest: CompanyInstructorSignUpWebRequest): ResponseEntity<Void> {
authService.companyInstructorSignUp(authRequestMapper.companyInstructorSignUpWebRequestToDto(webRequest))
val request = authRequestMapper.companyInstructorSignUpWebRequestToDto(webRequest)
authService.companyInstructorSignUp(request)
return ResponseEntity.status(HttpStatus.CREATED).build()
}

@PostMapping("/login")
fun login(@RequestBody @Valid webRequest: LoginWebRequest): ResponseEntity<TokenResponse> {
val response = authService.login(authRequestMapper.loginWebRequestToDto(webRequest))
val request = authRequestMapper.loginWebRequestToDto(webRequest)
val response = authService.login(request)
return ResponseEntity.ok(response)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class LectureController(
) {
@PostMapping
fun createLecture(@Valid @RequestBody webRequest: CreateLectureWebRequest): ResponseEntity<Void> {
lectureService.createLecture(lectureRequestMapper.createLectureWebRequestToDto(webRequest))
val request = lectureRequestMapper.createLectureWebRequestToDto(webRequest)
lectureService.createLecture(request)
return ResponseEntity.status(HttpStatus.CREATED).build()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class StudentActivityController(
) {
@PostMapping
fun createStudentActivity(@RequestBody @Valid webRequest: CreateStudentActivityWebRequest): ResponseEntity<Void> {
studentActivityService.createStudentActivity(studentActivityMapper.createStudentActivityWebRequestToDto(webRequest))
val request = studentActivityMapper.createStudentActivityWebRequestToDto(webRequest)
studentActivityService.createStudentActivity(request)
return ResponseEntity.status(HttpStatus.CREATED).build()
}
}

0 comments on commit 8cac0d9

Please sign in to comment.