package com.muyu.web.service.impl;

import com.muyu.common.core.utils.uuid.UUID;
import com.muyu.web.domain.req.VehicleConnectionReq;
import com.muyu.web.service.VehicleInstanceService;
import com.muyu.web.utils.MD5Util;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

@Log4j2
@Service
public class VehicleInstanceServiceImpl implements VehicleInstanceService {
    @Override
    public void vehicleClientStart(String vin) {
        log.info("车辆{},开始上线",vin);
        String timestamp = String.valueOf(System.currentTimeMillis());
        VehicleConnectionReq.builder()
                .vin(vin)
                .timestamp(timestamp)
                .userName(MD5Util.encrypted(vin+timestamp))
                .nonce(MD5Util.encrypted(UUID.randomUUID().toString().replace("-","")))
                .build();
        //
    }
}
