|
|
@ -0,0 +1,83 @@ |
|
|
|
|
|
package com.example.demo.controller.cash; |
|
|
|
|
|
|
|
|
|
|
|
import com.example.demo.config.interfac.Log; |
|
|
|
|
|
import com.example.demo.domain.DTO.BankDTO; |
|
|
|
|
|
import com.example.demo.domain.vo.cash.BankVO; |
|
|
|
|
|
import com.example.demo.domain.vo.coin.Result; |
|
|
|
|
|
import com.example.demo.service.cash.BankService; |
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @program: gold-java |
|
|
|
|
|
* @ClassName Bank |
|
|
|
|
|
* @description: |
|
|
|
|
|
* @author: Double |
|
|
|
|
|
* @create: 2025−11-17 13:31 |
|
|
|
|
|
* @Version 1.0 |
|
|
|
|
|
**/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RestController |
|
|
|
|
|
@RequestMapping("/bank") |
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
|
@Slf4j |
|
|
|
|
|
@CrossOrigin |
|
|
|
|
|
public class BankController { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BankService bankService; |
|
|
|
|
|
|
|
|
|
|
|
//payment银行接口(批量) |
|
|
|
|
|
@Log("payment银行接口(批量)") |
|
|
|
|
|
@PostMapping("/paymentAuto") |
|
|
|
|
|
public Result paymentAuto(@RequestBody BankDTO bankDTO) { |
|
|
|
|
|
try { |
|
|
|
|
|
return Result.success(bankService.paymentAuto(bankDTO)); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
return Result.error(e.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//payment银行接口(单个) |
|
|
|
|
|
@Log("payment银行接口(单个)") |
|
|
|
|
|
@PostMapping("/getPayment") |
|
|
|
|
|
public Result getPayment(@RequestBody BankDTO bankDTO) { |
|
|
|
|
|
try { |
|
|
|
|
|
if (bankDTO.getTime().isEmpty() || bankDTO.getOrderNo().isEmpty()) { |
|
|
|
|
|
return Result.error("时间或订单号为空"); |
|
|
|
|
|
} |
|
|
|
|
|
return bankService.getPayment(bankDTO); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
return Result.error(e.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//stripe银行接口(批量) |
|
|
|
|
|
@Log("stripe银行接口(批量)") |
|
|
|
|
|
@PostMapping("/stripeAuto") |
|
|
|
|
|
public Result stripeAuto(@RequestBody BankDTO bankDTO) { |
|
|
|
|
|
try { |
|
|
|
|
|
return Result.success(bankService.stripeAuto(bankDTO)); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
return Result.error(e.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//stripe银行接口(单个) |
|
|
|
|
|
@Log("stripe银行接口(单个)") |
|
|
|
|
|
@PostMapping("/getStripe") |
|
|
|
|
|
public Result getStripe(@RequestBody BankDTO bankDTO) { |
|
|
|
|
|
try { |
|
|
|
|
|
if (bankDTO.getTime().isEmpty() || bankDTO.getOrderNo().isEmpty()) { |
|
|
|
|
|
return Result.error("时间或订单号为空"); |
|
|
|
|
|
} |
|
|
|
|
|
return bankService.getStripe(bankDTO); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
return Result.error(e.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |