feiyu02
2024-08-13 b8cc591541b88dd2bb93f111f8e8075842dce7ca
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt
@@ -13,11 +13,16 @@
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)
@@ -117,7 +122,7 @@
        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()
        }