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


import com.neusoft.smart.pos.dto.trade.request.*;
import com.neusoft.smart.pos.dto.trade.response.*;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import com.neusoft.smart.pos.gateway.service.FacePayService;
import com.neusoft.smart.pos.gateway.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(value = "人脸支付管理使用rest接口", description = "人脸支付管理使用rest接口")
@RestController
@RequestMapping(path = "/unionService/facePay")
@Validated
public class FacePayController {

	@Autowired
	private FacePayService facePayService;
	
	@ApiOperation(value = "人脸支付初始化接口", notes = "人脸支付初始化方法")
	@PostMapping("/initFacePay")
	public ResponseData<PostInitFacePayResponse> initFacePay(@Valid @RequestBody PostInitFacePayRequest initFacePayRequest, BindingResult bindingResult) {
		return new ResponseData<>(facePayService.initFacePay(initFacePayRequest));
	}
	
	@ApiOperation(value = "刷脸生活初始化接口", notes = "刷脸生活初始化方法")
	@PostMapping("/initFaceLive")
	public ResponseData<PostInitFacePayResponse> initFaceLive(@Valid @RequestBody PostInitFacePayRequest initFacePayRequest, BindingResult bindingResult) {
		return new ResponseData<>(facePayService.initFaceLive(initFacePayRequest));
	}
}
	