package com.muyu.openbusiness.apply;

import com.muyu.common.cache.BasicCacheData;
import com.muyu.openbusiness.domain.SysCar;
import com.muyu.openbusiness.remote.SysCarRemoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 键和值转换 - 车辆数据
 */
@Component
public class SysCarCacheRemoteData implements BasicCacheData<String, SysCar> {


    @Autowired
    private SysCarRemoteService sysCarRemoteService;

    @Override
    public SysCar apply(String key) {
        return sysCarRemoteService.findByVin(key).getData();
    }
}
