|
|
@@ -103,4 +103,40 @@ public class SpFileUploadController {
|
|
|
map.put("msg", "操作成功!");
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping("/uploadFaceImage")
|
|
|
+ public Map<String, Object> uploadFaceImage(@RequestBody String image) {
|
|
|
+ JSONObject json = JSONObject.parseObject(image);
|
|
|
+ String imagePath="";
|
|
|
+ try {
|
|
|
+ imagePath = FileUploadUtils.saveImage(json.getString("base64"));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ // SUCCESS(100,"操作成功!"),
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("code", 100);
|
|
|
+ map.put("msg", "操作成功!");
|
|
|
+ map.put("imagePath",imagePath);
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|