| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper |
| | | import org.slf4j.Logger |
| | | import org.slf4j.LoggerFactory |
| | | import org.springframework.beans.factory.annotation.Value |
| | | import java.io.File |
| | | |
| | | |
| | | @Service |
| | | class MediafileServiceImpl(val mediafileMapper: MediafileMapper) : MediafileService { |
| | | class MediafileServiceImpl( |
| | | val mediafileMapper: MediafileMapper, |
| | | @Value("\${filePath}") var filePath: String, |
| | | @Value("\${imgPath}") var imgPath: String, |
| | | ) : MediafileService { |
| | | |
| | | private val logging: Logger = LoggerFactory.getLogger(MediafileServiceImpl::class.java) |
| | | |
| | |
| | | val path = mediafile.extension1 |
| | | //File("/Users/liwei/images/${path}/${id}.jpg").delete() |
| | | //先删图片 |
| | | val f = File("${Constant.DEFAULT_FILE_PATH}/images/$path/$id.jpg") |
| | | val f = File("${Constant.DEFAULT_FILE_PATH}/images/$path/$id.jpg") |
| | | if (f.exists()) { |
| | | f.delete() |
| | | } |