| | |
| | | import com.moral.util.FileUtils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.system.ApplicationHome; |
| | | 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; |
| | |
| | | |
| | | @Override |
| | | public Map<String, Object> add(MultipartFile[] files, Supervision supervision) { |
| | | |
| | | String path = null; |
| | | try { |
| | | path = ResourceUtils.getURL("classpath:").getPath() + "static/img/"; |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //获取jar包所在目录 |
| | | ApplicationHome h = new ApplicationHome(getClass()); |
| | | //在jar包所在目录下生成一个upload文件夹用来存储上传的图片 |
| | | String path = h.getSource().getParentFile().toString() + "/static/img/"; |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | |