Skip to content

Commit

Permalink
add :: excel service
Browse files Browse the repository at this point in the history
  • Loading branch information
meltapplee committed Feb 12, 2024
1 parent 2e81ada commit 0165eed
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.xquare.v1userservice.feign.property

import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.ConstructorBinding

@ConfigurationProperties(prefix = "server")
@ConstructorBinding
data class ExcelProperties (
val scheme: String,
val host: String,
val port: Int,
val database: String,
val username: String,
val password: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.xquare.v1userservice.feign.service

import com.xquare.v1userservice.feign.ExcelClient
import com.xquare.v1userservice.feign.property.ExcelProperties
import org.springframework.stereotype.Service
import org.springframework.web.multipart.MultipartFile
import javax.servlet.http.HttpServletResponse


@Service
class ExcelService(
private val excelClient: ExcelClient,
private val properties: ExcelProperties
) {

fun createExcelSheet(httpServletResponse: HttpServletResponse){
excelClient.createExcelSheet(httpServletResponse)
}

fun saveExcelInfo(file: MultipartFile){
excelClient.saveExcelInfo(properties.scheme, properties.host, properties.port, properties.database, properties.username, properties.password, file)
}

fun createExcelSheetAsDB(){
excelClient.createExcelSheetAsDB(properties.scheme, properties.host, properties.port, properties.database, properties.username, properties.password)
}
}

0 comments on commit 0165eed

Please sign in to comment.