package com.ningdatech.carapi.irs.controller;

import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ningdatech.carapi.irs.manage.IrsDriversLicenseManage;

import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;

/**
 * <p>
 * 驾驶证信息查询
 * </p>
 *
 * @author WendyYang
 * @since 2023/5/16
 **/
@RestController
@RequestMapping("/open/api/irs")
@RequiredArgsConstructor
public class IrsDriversLicensePullController {

    private final IrsDriversLicenseManage irsDriversLicenseManage;

    @ApiOperation("驾驶证信拉取")
    @GetMapping("/driver-license/refresh")
    public void driverLicenseRefresh() {
        irsDriversLicenseManage.submitDriverLicensePullTask();
    }

    @ApiOperation("行驶证信息拉取")
    @GetMapping("/driving-license/refresh")
    public void drivingLicenseRefresh() {
        irsDriversLicenseManage.submitDrivingLicensePullTask();
    }

    @ApiOperation(value = "行驶证查询数据逐个保存", notes = "行驶证查询数据逐个保存")
    @GetMapping("/vehicleLicenseSingleSave")
    public void vehicleLicenseSingleSave(){
        irsDriversLicenseManage.vehicleLicenseSingleSave();
    }

    @ApiOperation(value = "驾驶证查询数据逐个保存", notes = "驾驶证查询数据逐个保存")
    @GetMapping("/drivingLicenseSingleSave")
    public void drivingLicenseSingleSave(){
        irsDriversLicenseManage.drivingLicenseSingleSave();
    }

    @ApiOperation(value = "根据车架号查询行驶证数据", notes = "根据车架号查询行驶证数据")
    @GetMapping("/vehicleLicenseTest")
    public List<String> vehicleLicenseTest(){
        return irsDriversLicenseManage.vehicleLicenseTest();
    }

}
