-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/pknu-wap/WABI-BE into de…
…velop
- Loading branch information
Showing
18 changed files
with
366 additions
and
206 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
77 changes: 77 additions & 0 deletions
77
wabi/src/main/kotlin/com/wap/wabi/band/controller/BandCommandController.kt
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,77 @@ | ||
package com.wap.wabi.band.controller | ||
|
||
import com.wap.wabi.band.payload.BandStudentDto | ||
import com.wap.wabi.band.payload.request.BandStudentEnrollRequest | ||
import com.wap.wabi.band.service.BandCommandService | ||
import com.wap.wabi.common.payload.response.Response | ||
import io.swagger.v3.oas.annotations.Operation | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.ResponseEntity | ||
import org.springframework.web.bind.annotation.DeleteMapping | ||
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.RequestParam | ||
import org.springframework.web.bind.annotation.RestController | ||
import org.springframework.web.multipart.MultipartFile | ||
|
||
@RestController | ||
@RequestMapping("/api/bands/") | ||
class BandCommandController( | ||
private val bandCommandService: BandCommandService, | ||
) { | ||
@PostMapping("{bandId}/members/enrollments/file") | ||
@Operation( | ||
summary = "밴드 학생 추가(excel, csv)" | ||
) | ||
fun enrollByFile( | ||
@PathVariable bandId: Long, | ||
@RequestParam("file") file: MultipartFile | ||
): ResponseEntity<Response> { | ||
val response = Response.ok(data = "bandId : " + bandCommandService.enrollByFile(bandId = bandId, file = file)) | ||
return ResponseEntity(response, HttpStatus.OK) | ||
} | ||
|
||
@PostMapping("{bandId}/members/enrollments/manual") | ||
@Operation( | ||
summary = "밴드 학생 추가", | ||
description = "밴드에 학생들을 추가 가능합니다." | ||
) | ||
fun enrollByManual( | ||
@PathVariable bandId: Long, | ||
@RequestBody request: BandStudentEnrollRequest | ||
): ResponseEntity<Response> { | ||
val response = | ||
Response.ok(data = "bandId : " + bandCommandService.enrollBandStudent(bandId = bandId, request = request)) | ||
return ResponseEntity(response, HttpStatus.OK) | ||
} | ||
|
||
@PutMapping("{bandId}") | ||
@Operation( | ||
summary = "밴드 학생 정보 수정" | ||
) | ||
fun deleteBandStudent( | ||
@PathVariable bandId: Long, | ||
@RequestBody request: BandStudentDto | ||
): ResponseEntity<Response> { | ||
val response = | ||
Response.ok(data = "bandId : " + bandCommandService.updateBandStudent(bandId = bandId, request = request)) | ||
return ResponseEntity(response, HttpStatus.OK) | ||
} | ||
|
||
@DeleteMapping("{bandId}/{studentId}") | ||
@Operation( | ||
summary = "밴드 학생 삭제" | ||
) | ||
fun deleteBandStudent( | ||
@PathVariable bandId: Long, | ||
@PathVariable studentId: String | ||
): ResponseEntity<Response> { | ||
bandCommandService.deleteBandStudent(bandId = bandId, studentId = studentId) | ||
|
||
val response = Response.ok(message = "success delete band student") | ||
return ResponseEntity(response, HttpStatus.OK) | ||
} | ||
} |
44 changes: 0 additions & 44 deletions
44
wabi/src/main/kotlin/com/wap/wabi/band/controller/BandEnrollController.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.