package com.sikey.wa04.business.infrastructure.adapter.dao;

import com.sikey.wa04.business.domain.adapter.MapTrajectoryLogAdapter;
import com.sikey.wa04.business.domain.entity.MapTrajectoryLog;
import com.sikey.wa04.business.infrastructure.convert.MapTrajectoryLogConvert;
import com.sikey.wa04.business.infrastructure.dto.model.MapTrajectoryLogModel;
import com.sikey.wa04.business.infrastructure.repository.MapTrajectoryLogRepository;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author: qin
 * @Date: 2025/3/11
 * @Description: 定位日志记录
 */
@Slf4j
@Component
public class MapTrajectoryLogAdapterImpl implements MapTrajectoryLogAdapter {

    @Resource
    private MapTrajectoryLogRepository mapTrajectoryLogRepository;

    /**
     * 保存定位日志记录
     *
     * @param mapTrajectoryLog 定位日志记录
     */
    @Override
    public void save(MapTrajectoryLog mapTrajectoryLog) {
        MapTrajectoryLogModel mapTrajectoryModel = MapTrajectoryLogConvert.INSTANCE.convert(mapTrajectoryLog);
        mapTrajectoryLogRepository.save(mapTrajectoryModel);
    }
}
