Skip to content

Commit

Permalink
refactor :: projectImages -> projectImgae 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
4mjeo committed Feb 25, 2024
1 parent 7ceb541 commit 3a3d4c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class ProjectController(
@PathVariable("projectId") projectId: UUID,
@RequestPart(value = "logo", required = true) logo: MultipartFile,
@RequestPart("project") project: String,
@RequestPart("projectImages") projectImages: List<MultipartFile>?
@RequestPart("projectImage") projectImage: List<MultipartFile>?
): ProjectDetailResponse {
val request: UpdateProjectRequest = objectMapper.readValue(project, UpdateProjectRequest::class.java)
return projectService.update(projectId, request, logo, projectImages)
return projectService.update(projectId, request, logo, projectImage)
}

@GetMapping("/detail")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.util.*
interface ProjectService {

fun register(req: RegisterProjectRequest, logo: MultipartFile, projectImage: List<MultipartFile>?): ProjectDetailResponse
fun update(projectId: UUID, req: UpdateProjectRequest, logo: MultipartFile, projectImages: List<MultipartFile>?): ProjectDetailResponse
fun update(projectId: UUID, req: UpdateProjectRequest, logo: MultipartFile, projectImage: List<MultipartFile>?): ProjectDetailResponse
fun getDetail(id: UUID): ProjectDetailResponse
fun getProject(email: String): List<ProjectListResponse>
fun getList(): List<ProjectListResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ class ProjectServiceImpl (


@Transactional
override fun update(projectId: UUID, req: UpdateProjectRequest, logo: MultipartFile, projectImages: List<MultipartFile>?): ProjectDetailResponse {
override fun update(projectId: UUID, req: UpdateProjectRequest, logo: MultipartFile, projectImage: List<MultipartFile>?): ProjectDetailResponse {

val user = userFacade.getCurrentUser()
val project = projectRepository.findByIdOrNull(projectId)
?: throw ProjectNotFoundException

val logoUrl = fileService.upload(logo, project.projectNameEn).url

val projectImageUrl = projectImages?.let {
val projectImageUrl = projectImage?.let {
fileService.uploads(it, project.projectNameEn).files.map {fileUrlResponse -> fileUrlResponse.url }
} ?: project.projectImage

Expand Down

0 comments on commit 3a3d4c5

Please sign in to comment.