jinpengyong
2022-01-18 4b1358aa1acf1da5b9f0791dee0c9149b4162963
图片删除测试
2 files modified
11 ■■■■■ changed files
.gitignore 8 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/SupervisionServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
.gitignore
@@ -22,3 +22,11 @@
/screen-job/screen-job.iml
/screen-common/screen-common.iml
/screen-manage/screen-manage.iml
/screen-manage/src/main/resources/application-local.yml
/screen-job/src/main/resources/application-local.yml
/screen-api/src/main/resources/application-dev.yml
/**/*.iml
/myBatisPlusGenerator/src/main/java/com/moral/CodeGenerator.java
/**/target
/screen.iml
screen-api/src/main/java/com/moral/api/service/impl/SupervisionServiceImpl.java
@@ -11,6 +11,7 @@
import com.moral.constant.ResponseCodeEnum;
import com.moral.util.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.stereotype.Service;
@@ -36,6 +37,7 @@
 * @since 2022-01-12
 */
@Service
@Slf4j
public class SupervisionServiceImpl extends ServiceImpl<SupervisionMapper, Supervision> implements SupervisionService {
    @Autowired
@@ -181,6 +183,7 @@
        for (String image : images) {
            String realPath = path + File.separator + image;
            File file = new File(realPath);
            log.info(realPath);
            if (file.exists() && file.isFile()) {
                file.delete();
            }