package com.ruoyi.web.controller.api; import com.ruoyi.system.service.TBillService; import com.taxi591.bankapi.dto.CovertPayBackResult; import com.taxi591.bankapi.service.BankService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; @RestController @RequestMapping("open/bank") public class BankOutController { @Autowired BankService bankService; @Autowired TBillService tBillService; @PostMapping(value = "payCallback") public @ResponseBody String payCallback(HttpServletRequest request){ CovertPayBackResult result = bankService.covertPayCallBack(request, (billRequest) -> { tBillService.completePay(billRequest); return true; }); return result.getBack(); } }