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

import com.cusc.nirvana.common.result.PageResult;
import com.cusc.nirvana.common.result.Response;
import com.cusc.nirvana.user.rnr.fp.dto.RnrOrderDetailDTO;
import com.cusc.nirvana.user.rnr.fp.dto.RnrOrderListQueryDTO;
import com.cusc.nirvana.user.rnr.fp.dto.RnrOrderListResponseDTO;
import com.cusc.nirvana.user.rnr.fp.dto.VinCardDTO;
import com.cusc.nirvana.user.rnr.fp.service.IRnrOrderService;
import com.cusc.nirvana.user.rnr.mg.dto.LocalVerifyListDTO;
import com.cusc.nirvana.user.rnr.mg.dto.LocalVerifyListRqDTO;
import com.cusc.nirvana.user.rnr.mg.dto.MgRnrCardInfoDTO;
import com.cusc.nirvana.user.rnr.mg.dto.RnrRelationDTO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author stayAnd
 * @date 2022/7/28
 */
@RestController
@RequestMapping("/rnr/order")
public class FpRnrOrderController {

	@Resource
	private IRnrOrderService rnrOrderService;



	@PostMapping("/pageListQuery")
	public Response<PageResult<RnrOrderListResponseDTO>> pageListQuery(@Valid @RequestBody RnrOrderListQueryDTO dto){
		return Response.createSuccess(rnrOrderService.pageListQuery(dto));
	}


	@PostMapping("/queryCardPageByOrderId")
	public Response<PageResult<VinCardDTO>> queryCardPageByOrderId(@RequestBody MgRnrCardInfoDTO dto){
		return Response.createSuccess(rnrOrderService.queryCardPageByOrderId(dto));
	}

	@GetMapping("/queryOrderDetail")
	public Response<RnrOrderDetailDTO> queryOrderDetail(@RequestParam("orderId") String orderId){
		return Response.createSuccess(rnrOrderService.queryOrderDetail(orderId));
	}



	@PostMapping("/localverifyList")
	public Response<PageResult<LocalVerifyListDTO>> localverifyList(@RequestBody RnrOrderListQueryDTO dto){
		return Response.createSuccess(rnrOrderService.localverifyList(dto));
	}


}
