|
@ -25,16 +25,8 @@ public class PhotoController { |
|
|
@Operation(summary = "获取上次拍照的照片") |
|
|
@Operation(summary = "获取上次拍照的照片") |
|
|
@GetMapping("/develop") |
|
|
@GetMapping("/develop") |
|
|
public Result<String> develop() { |
|
|
public Result<String> develop() { |
|
|
String filePath = "/home/firefly/Desktop/gd/1.jpg"; |
|
|
|
|
|
try { |
|
|
|
|
|
File file = new File(filePath); |
|
|
|
|
|
byte[] fileBytes = Files.readAllBytes(file.toPath()); |
|
|
|
|
|
String encodedString = Base64.getEncoder().encodeToString(fileBytes); |
|
|
|
|
|
return Result.success(encodedString); |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
log.error("获取上次拍照的照片失败", e); |
|
|
|
|
|
return Result.failed(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
String filePath = "/1.jpg"; |
|
|
|
|
|
return Result.success(filePath); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |