|
@@ -26,7 +26,7 @@ import java.util.List;
|
|
|
|
|
|
@Api(tags = "图片、简历相关接口")
|
|
|
@RestController
|
|
|
-public class ImageUploadController {
|
|
|
+ public class ImageUploadController {
|
|
|
@Autowired
|
|
|
private PhotoService photoService;
|
|
|
@Autowired
|
|
@@ -76,15 +76,6 @@ public class ImageUploadController {
|
|
|
Date date = new Date();
|
|
|
DateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
File dest = new File(path + "/" + getpathtype(type) + id + type + sdf.format(date) + newName);
|
|
|
- if (!dest.exists()) {
|
|
|
- dest.getParentFile().mkdir();
|
|
|
- try {
|
|
|
- dest.mkdir();
|
|
|
- dest.createNewFile();
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
try {
|
|
|
file.transferTo(dest); //保存文件
|