|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.jingcheng.cms.service.ArticleSerive;
|
|
|
|
|
import com.jingcheng.cms.util.AjaxResult;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@ -16,7 +17,8 @@ import java.util.List;
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/api/article")
|
|
|
|
|
public class ArticleController {
|
|
|
|
|
|
|
|
|
|
@Value("${localFilePath}")
|
|
|
|
|
private String localFilePath;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ArticleSerive articleSerive;
|
|
|
|
|
|
|
|
|
@ -104,7 +106,7 @@ public class ArticleController {
|
|
|
|
|
}
|
|
|
|
|
//文件名称
|
|
|
|
|
String realFileName = file.getOriginalFilename();
|
|
|
|
|
String path ="D:/cktest/";
|
|
|
|
|
String path =localFilePath;
|
|
|
|
|
//检查该路径对应的目录是否存在. 如果不存在则创建目录
|
|
|
|
|
File dir=new File(path);
|
|
|
|
|
if (!dir.exists()) {
|
|
|
|
|