package com.cusc.nirvana.user.rnr.project.handler.impl;


import com.cusc.nirvana.common.result.Response;
import com.cusc.nirvana.user.rnr.fp.dto.VinCardInfoDTO;
import com.cusc.nirvana.user.rnr.project.dto.ProjectCardExistResponseDTO;
import com.cusc.nirvana.user.rnr.project.handler.CuscVinCardHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author stayAnd
 * @date 2022/4/8
 */
@Component
public class OpenApiVinCardHandler extends CuscVinCardHandler {

    @Value("${openApiUrl:1}")
    private String openApiUrl;


    @Override
    public VinCardInfoDTO queryCardByVin(String vin) {
        return queryVinCard(openApiUrl + "/vehicle/iccid/rels", vin);
    }

    @Override
    public List<VinCardInfoDTO> queryCardByVinList(List<String> vinList) {
        return queryVinCardList(openApiUrl + "/vehicle/iccid/rels", vinList);
    }

    @Override
    public Response<ProjectCardExistResponseDTO> isCardExist(String iccid) {
        return isCardExist(openApiUrl + "/project/api/v1/sim/is-exist", iccid);
    }
}
