jinpengyong
2022-01-14 cfe961da5a7497e905ad0291b1793b685f30688c
screen-api/src/main/java/com/moral/api/service/impl/SupervisionServiceImpl.java
@@ -14,8 +14,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ResourceUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -42,9 +44,13 @@
    @Override
    public Map<String, Object> add(MultipartFile[] files, Supervision supervision) {
        String path = this.getClass().getClassLoader()
                .getResource("").getFile() + "static/img/";
        System.out.println("image path=>" + path);
        String path = null;
        try {
            path = ResourceUtils.getURL("classpath:").getPath() + "static/img/";
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        Map<String, Object> result = new HashMap<>();