package com.tashow.cloud.payapi.api.transfer;

import com.tashow.cloud.common.pojo.CommonResult;
import com.tashow.cloud.payapi.api.transfer.dto.PayTransferCreateReqDTO;
import com.tashow.cloud.payapi.enums.ApiConstants;
import com.tashow.cloud.sdk.payment.dto.transfer.PayTransferRespDTO;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * RPC 服务 - 转账单
 */
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
public interface PayTransferApi {

    String PREFIX = ApiConstants.PREFIX + "/transfer";

    /**
     * 创建转账单
     * @param reqDTO
     * @return
     */
    @PostMapping(PREFIX + "/create")
    CommonResult<Long> createTransfer(@Valid @RequestBody PayTransferCreateReqDTO reqDTO);

    /**
     * 获得转账单
     * @param id 转账单编号
     * @return
     */
    @GetMapping(PREFIX + "/get")
    CommonResult<PayTransferRespDTO> getTransfer(@RequestParam("id") Long id);

}
