Skip to content

Commit

Permalink
fix: admissions 프론트에 맞게 협의
Browse files Browse the repository at this point in the history
  • Loading branch information
skfotakf committed Sep 5, 2023
1 parent a3e803f commit 2079186
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Binary file added files/1693921307331_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/1693921307940_pdf하나.pdf.pdf
Binary file not shown.
Binary file added files/1693921308012_pdf둘.pdf.pdf
Binary file not shown.
Binary file added files/thumbnail_1693921307331_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import org.springframework.web.bind.annotation.RestController
class AdmissionsController(
private val admissionsService: AdmissionsService
) {
@PostMapping("/undergraduate")
@PostMapping("/undergraduate/{postType}")
fun createUndergraduateAdmissions(
@RequestParam postType: String,
@PathVariable postType: String,
@Valid @RequestBody request: AdmissionsDto
) : AdmissionsDto {
return admissionsService.createUndergraduateAdmissions(postType, request)
Expand All @@ -32,9 +32,9 @@ class AdmissionsController(
return admissionsService.createGraduateAdmissions(request)
}

@GetMapping("/undergraduate")
@GetMapping("/undergraduate/{postType}")
fun readUndergraduateAdmissions(
@RequestParam postType: String
@PathVariable postType: String
) : ResponseEntity<AdmissionsDto> {
return ResponseEntity.ok(admissionsService.readUndergraduateAdmissions(postType))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import jakarta.persistence.Enumerated
class AdmissionsEntity(
@Enumerated(EnumType.STRING)
val postType: AdmissionsPostType,
val title: String,
val pageName: String,
val description: String,
): BaseTimeEntity() {
companion object {
fun of(postType: AdmissionsPostType, admissionsDto: AdmissionsDto) : AdmissionsEntity {
return AdmissionsEntity(
postType = postType,
title = admissionsDto.title,
pageName = admissionsDto.pageName,
description = admissionsDto.description,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.time.LocalDateTime

data class AdmissionsDto(
val id: Long,
val title: String,
val pageName: String,
val description: String,
val createdAt: LocalDateTime?,
val modifiedAt: LocalDateTime?,
Expand All @@ -14,7 +14,7 @@ data class AdmissionsDto(
fun of(entity: AdmissionsEntity) : AdmissionsDto = entity.run {
AdmissionsDto(
id = this.id,
title = this.title,
pageName = this.pageName,
description = this.description,
createdAt = this.createdAt,
modifiedAt = this.modifiedAt,
Expand Down

0 comments on commit 2079186

Please sign in to comment.