package com.nq.controller.protol; import com.nq.common.ServerResponse; import com.nq.pojo.UserRecharge; import com.nq.service.IPayChnnelServices; import com.nq.service.IPayService; import javax.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; @Controller @RequestMapping({"/user/pay/"}) public class UserPayController { private static final Logger log = LoggerFactory.getLogger(UserPayController.class); @Autowired IPayService iPayService; @Autowired IPayChnnelServices iPayChnnelServices; @RequestMapping({"juhe1.do"}) @ResponseBody public ServerResponse juhe1(@RequestParam("payType") String payType, @RequestParam("payAmt") String payAmt, HttpServletRequest request) throws Exception { log.info("发起线上支付 payType = {} payAmt = {}", payType, payAmt); return this.iPayService.juhenewpay(payType, payAmt, request); } @RequestMapping({"juheh5.do"}) @ResponseBody public ServerResponse juheh5(@RequestParam("payType") String payType, @RequestParam("payAmt") String payAmt, HttpServletRequest request) throws Exception { log.info("发起线上支付 payType = {} payAmt = {}", payType, payAmt); return this.iPayService.juheh5pay(payType, payAmt, request); } @RequestMapping({"juhenewpayNotify.do"}) public String juhenewpayNotify(HttpServletRequest request) throws Exception { iPayService.juhe1Notify(request); return "success"; } @RequestMapping({"flyPay.do"}) @ResponseBody public ServerResponse flyPay(@RequestParam("payType") Integer payType, @RequestParam("payAmt") String payAmt, @RequestParam("img") String img, @RequestParam("payId") String payId, HttpServletRequest request) { log.info("发起 fly 线上支付 payType = {} payAmt = {} img = {}", new Object[]{payType, payAmt, img}); return this.iPayService.flyPay(payType, payAmt, img,payId, request); } @RequestMapping({"flyPayAmt.do"}) @ResponseBody public ServerResponse flyPayAmt(HttpServletRequest request, UserRecharge userRecharge) { return this.iPayService.flyPayAmt(request,userRecharge); } @RequestMapping({"editRecharge.do"}) @ResponseBody public ServerResponse editRecharge(UserRecharge userRecharge) { return this.iPayService.editRecharge(userRecharge); } @RequestMapping("queryPayChnnel.do") @ResponseBody public ServerResponse queryPayChnnel(){ return iPayChnnelServices.queryPayChnnel(1); } }