Browse Source

fix:添加测试用获取照片接口直接返回url

master
白凤吉 5 months ago
parent
commit
f8b92a3d7e
  1. 12
      src/main/java/com/qyft/gd/controller/PhotoController.java

12
src/main/java/com/qyft/gd/controller/PhotoController.java

@ -25,16 +25,8 @@ public class PhotoController {
@Operation(summary = "获取上次拍照的照片")
@GetMapping("/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);
}
}
Loading…
Cancel
Save