package com.neusoft.smart.pos.payment.controller;

import com.neusoft.smart.pos.payment.service.XYHFPayNotifyService;
import com.neusoft.smart.pos.payment.utils.HttpClientUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(path = "/xyhfPayNotify")
public class XYHFPayNotifyController {

	@Autowired
	private XYHFPayNotifyService xyhfPayNotifyService;

	/**
	 * 银联商务支付成功回调方法
	 * @return
	 */
	@ApiIgnore
	@RequestMapping(value = "payNotify")
	public String xyhfPayNotify(HttpServletRequest request){
		String requestStr = HttpClientUtils.getStringDataFromRequest(request);
		return xyhfPayNotifyService.xyhfNotifyDataHandle(requestStr);
	}

}
	