package com.cusc.nirvana.user.rnr.fp.controller;

import com.cusc.nirvana.common.result.Response;
import com.cusc.nirvana.user.rnr.fp.dto.*;
import com.cusc.nirvana.user.rnr.fp.service.INewVinCardService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author stayAnd
 * @date 2022/5/16
 */
@RestController
@RequestMapping("/newVinCard")
public class NewVinCardController {

	@Resource
	private INewVinCardService vinCardService;

	@RequestMapping("/queryUnBindCardByVin")
	public Response<VinCardResultDTO> queryUnBindCardByVin(@RequestBody VinCardQueryDTO queryDTO){
		return vinCardService.queryUnBindCardByVin(queryDTO);
	}

	@RequestMapping("/queryBindCardByVin")
	public Response<VinCardResultDTO> queryBindCardByVin(@RequestBody VinCardQueryDTO queryDTO){
		return Response.createSuccess(vinCardService.queryBindCardByVin(queryDTO));
	}

	@RequestMapping("/checkVinCard")
	public Response<VinCardCheckResultDTO> checkVinCard(@RequestBody VinCardCheckDTO vinCardCheckDTO){
		return Response.createSuccess(vinCardService.checkVinCard(vinCardCheckDTO));
	}


	@RequestMapping("/checkVinCardMessage")
	public Response<VinCardCheckMessageResultDTO> checkVinCardMessage(@RequestBody VinCardCheckMessageRequestDTO requestDTO){
		return Response.createSuccess(vinCardService.checkVinCardMessage(requestDTO));
	}

	@PostMapping("/checkVin")
	public Response<VinCheckResultDTO> checkVin(@RequestBody VinCheckRequestDTO requestDTO){
		return Response.createSuccess(vinCardService.checkVin(requestDTO));
	}
}
