75 lines
2.3 KiB
Java
75 lines
2.3 KiB
Java
package com.cdzy.operations.controller;
|
||
|
||
import com.cdzy.common.enums.Code;
|
||
import com.cdzy.common.ex.EbikeException;
|
||
import com.cdzy.common.model.response.JsonResult;
|
||
import com.ebike.feign.clients.UserFeignClient;
|
||
import com.ebike.feign.model.dto.FeignEbikeRefundProcessDto;
|
||
import com.ebike.feign.model.dto.FeignEbikeRefundQueryDto;
|
||
import jakarta.annotation.Resource;
|
||
import org.springframework.web.bind.annotation.*;
|
||
|
||
/**
|
||
* 退款审核 控制层。
|
||
*
|
||
* @author yanglei
|
||
* @since 2025-11-14 16:58
|
||
*/
|
||
|
||
@RestController
|
||
@RequestMapping("/ebikeRefundReview")
|
||
public class EbikeRefundReviewController {
|
||
|
||
@Resource
|
||
private UserFeignClient userFeignClient;
|
||
|
||
/**
|
||
* 审核退款申请
|
||
*
|
||
* @param processDto 退款处理信息
|
||
* @return 审核成功返回true,否则返回false
|
||
*/
|
||
@PostMapping("/reviewRefund")
|
||
public JsonResult<?> reviewRefund(@RequestBody FeignEbikeRefundProcessDto processDto) {
|
||
JsonResult<Boolean> jsonResult = userFeignClient.reviewRefund(processDto);
|
||
if (jsonResult.getCode() != Code.SUCCESS) {
|
||
throw new EbikeException("调用审核退款申请失败");
|
||
}
|
||
Boolean result = jsonResult.getData();
|
||
return JsonResult.success(result);
|
||
}
|
||
|
||
|
||
/**
|
||
* 获取用户退款列表
|
||
*
|
||
* @param refundQueryDto 退款查询参数
|
||
* @return 退款列表
|
||
*/
|
||
@PostMapping("/queryRefundList")
|
||
public JsonResult<?> getRefundList(@RequestBody FeignEbikeRefundQueryDto refundQueryDto) {
|
||
JsonResult<?> jsonResult = userFeignClient.getRefundList(refundQueryDto);
|
||
if (jsonResult.getCode() != Code.SUCCESS) {
|
||
throw new EbikeException("获取退款审核列表失败");
|
||
}
|
||
return JsonResult.success(jsonResult.getData());
|
||
}
|
||
|
||
|
||
/**
|
||
* 获取退款订单详情
|
||
*
|
||
* @param refundId 退款主键Id
|
||
* @return 退款订单详情
|
||
*/
|
||
@GetMapping("/refundOrderDetail/{refundId}")
|
||
JsonResult<?> refundOrderDetail(@PathVariable(name = "refundId") Long refundId) {
|
||
JsonResult<?> jsonResult = userFeignClient.refundOrderDetail(refundId);
|
||
if (jsonResult.getCode() != Code.SUCCESS) {
|
||
throw new EbikeException("获取退款详情失败");
|
||
}
|
||
return JsonResult.success(jsonResult.getData());
|
||
}
|
||
|
||
}
|