Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
meltapplee committed Mar 5, 2024
1 parent c94e34c commit afc92b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.xaquare.xquarebackoffice.infrastructure.excel.controller

import com.xaquare.xquarebackoffice.infrastructure.excel.service.CreateExcelSheetAsDB
import com.xaquare.xquarebackoffice.infrastructure.excel.service.CreateExcelSheetService
import com.xaquare.xquarebackoffice.infrastructure.excel.service.GetUserInfo
import com.xaquare.xquarebackoffice.infrastructure.excel.service.SaveUserInfo
import com.xaquare.xquarebackoffice.infrastructure.excel.service.GetExcelSheetService

import org.springframework.web.bind.annotation.GetMapping
Expand All @@ -14,19 +14,21 @@ import javax.servlet.http.HttpServletResponse
@RestController
@RequestMapping("/excel")
class ExcelController(
private val createExcelSheetService: CreateExcelSheetService,
private val saveUserInfo: SaveUserInfo,
private val getExcelSheetService: GetExcelSheetService,
private val createExcelSheetAsDB: CreateExcelSheetAsDB
private val getUserInfo: GetUserInfo
) {
@GetMapping
fun createExcelSheet(httpServletResponse: HttpServletResponse) =
createExcelSheetService.execute(httpServletResponse)
saveUserInfo.execute(httpServletResponse)

@PostMapping
fun saveExcelInfo(file: MultipartFile) =
getExcelSheetService.execute(file)

@GetMapping("/userInfo")
fun createExcelSheetAsDD(httpServletResponse: HttpServletResponse) =
createExcelSheetAsDB.execute(httpServletResponse)
fun getUserInfo(httpServletResponse: HttpServletResponse) =
getUserInfo.execute(httpServletResponse)


}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import org.apache.poi.ss.usermodel.Workbook
import org.springframework.transaction.annotation.Transactional

@Service
class CreateExcelSheetAsDB(
class GetUserInfo(
private val userPersistenceAdapter: UserPersistenceAdapter
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.apache.poi.ss.usermodel.Sheet
import org.apache.poi.ss.usermodel.Workbook

@Service
class CreateExcelSheetService {
class SaveUserInfo {

fun execute(response: HttpServletResponse) {
val workbook: Workbook = XSSFWorkbook()
Expand Down

0 comments on commit afc92b3

Please sign in to comment.