| | |
| | | |
| | | @GetMapping("/idempotency/token") |
| | | @ApiOperation("获取一次性防重复提交 Token") |
| | | public Result<Object> getIdempotencyToken(@RequestParam(required = false) Long userId) { |
| | | public Result<Object> getIdempotencyToken(@RequestParam(required = false) String userId) { |
| | | try { |
| | | String token = tokenService.generateToken(userId); |
| | | return Result.success("token生成",token); |
| | |
| | | @ApiParam("附件地址") @RequestParam @NotBlank String fileUrl, |
| | | @ApiParam("存储桶名称") @RequestParam String bucketName, |
| | | @ApiParam("对象名称") @RequestParam String objectName, |
| | | @ApiParam("上传用户ID") @RequestParam @NotNull Long uploadUserId, |
| | | @ApiParam("上传用户ID") @RequestParam @NotNull String uploadUserId, |
| | | @ApiParam("上传用户名") @RequestParam @NotBlank String uploadUserName, |
| | | @ApiParam("附件类型") @RequestParam String attachmentType, |
| | | @ApiParam("附件描述") @RequestParam String description) { |
| | |
| | | @ApiOperation("添加订单评价") |
| | | public Result<Boolean> addOrderEvaluation( |
| | | @ApiParam("订单ID") @RequestParam @NotBlank String orderId, |
| | | @ApiParam("评价人ID") @RequestParam @NotNull Long evaluatorId, |
| | | @ApiParam("评价人ID") @RequestParam @NotNull String evaluatorId, |
| | | @ApiParam("评价人姓名") @RequestParam @NotBlank String evaluatorName, |
| | | @ApiParam("评价人类型") @RequestParam @NotBlank String evaluatorType, |
| | | @ApiParam("评价内容") @RequestParam @NotBlank String content, |
| | |
| | | return Result.error("取消订单失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/product/{productId}/has-completed-orders") |
| | | @ApiOperation("根据产品ID判断是否存在审核中的关联订单") |
| | | public Result<Boolean> hasCompletedOrdersByProductId( |
| | | @ApiParam("产品ID") @PathVariable @NotBlank String productId) { |
| | | try { |
| | | boolean exists = orderInfoService.existsCompletedNotCancelledOrderByProductId(productId); |
| | | return Result.success(exists); |
| | | } catch (Exception e) { |
| | | log.error("查询产品关联订单存在性失败,产品ID: {}", productId, e); |
| | | return Result.error("查询失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/status/isEvaluate") |
| | | @ApiOperation("更新评价状态") |
| | | public Result<Object> updateOrderInfoIsEvaluate(@ApiParam("订单ID") @RequestParam @NotBlank String orderId){ |
| | | try { |
| | | boolean success = orderInfoService.updateOrderIsEvaluate(orderId); |
| | | return success ? Result.success("评价状态更新成功") : Result.error("评价状态更新失败"); |
| | | } catch (Exception e) { |
| | | log.error("评价状态更新失败", e); |
| | | return Result.error("评价状态更新失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | } |