照片打印,基础

This commit is contained in:
2025-05-21 15:27:53 +08:00
parent 570267fd83
commit aaddbab2ab
7 changed files with 58 additions and 0 deletions

View File

@@ -69,4 +69,19 @@ public class AppPrinterController {
printerService.setPhotoCropped(JwtTokenUtil.getWorker().getUserId(), scenicId, id, url);
return ApiResponse.success(url);
}
@PostMapping("/setQuantity/{scenicId}/{id}")
public ApiResponse<?> setQuantity(@PathVariable("scenicId") Long scenicId, @PathVariable("id") Long id, @RequestParam("quantity") Integer quantity) {
if (quantity == null) {
return ApiResponse.fail("请输入数量");
}
if (quantity < 0) {
return ApiResponse.fail("数量不能小于0");
}
printerService.setPhotoQuantity(JwtTokenUtil.getWorker().getUserId(), scenicId, id, quantity);
return ApiResponse.success(null);
}
@GetMapping("/price/{scenicId}")
public ApiResponse<?> queryPrice(@PathVariable("scenicId") Long scenicId) {
return ApiResponse.success(printerService.queryPrice(JwtTokenUtil.getWorker().getUserId(), scenicId));
}
}