|
|
@@ -48,7 +48,7 @@ public class SpFileUploadController {
|
|
|
|
|
|
/**
|
|
|
* 文件上传
|
|
|
- *
|
|
|
+ *
|
|
|
* @param spUploadVO
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -112,7 +112,7 @@ public class SpFileUploadController {
|
|
|
JSONObject json = JSONObject.parseObject(image);
|
|
|
String imagePath="";
|
|
|
try {
|
|
|
- imagePath = FileUploadUtils.saveImage(json.getString("base64"));
|
|
|
+ imagePath = FileUploadUtils.saveFaceImage(json.getString("base64"));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -124,47 +124,4 @@ public class SpFileUploadController {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping("/getPreview")
|
|
|
- public Map<String,Object> getPreview(@RequestBody String fileKey){
|
|
|
- JSONObject json = JSONObject.parseObject(fileKey);
|
|
|
- String imagePath="";
|
|
|
- try {
|
|
|
- imagePath = FileUploadUtils.getPreviewUrl(json.getString("fileKey"));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- // SUCCESS(100,"操作成功!"),
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("code", 100);
|
|
|
- map.put("msg", "操作成功!");
|
|
|
- map.put("url",imagePath);
|
|
|
- return map;
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping("/getFile")
|
|
|
- public Map<String,Object> getFile(@RequestBody String fileKey){
|
|
|
- JSONObject json = JSONObject.parseObject(fileKey);
|
|
|
- File file = null;
|
|
|
- try {
|
|
|
- file = FileUploadUtils.getFileWithPath(json.getString("fileKey"));
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- ObjectMapper mapper = new ObjectMapper();
|
|
|
- String s = null;
|
|
|
- try {
|
|
|
- s = mapper.writeValueAsString(file);
|
|
|
- } catch (JsonProcessingException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("code", 100);
|
|
|
- map.put("msg", "操作成功!");
|
|
|
- map.put("file",s);
|
|
|
- return map;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|