riku
2019-09-29 fb1dc85a9ae6a9b8426ec5e29eb0139933ebe233
src/main/kotlin/com/flightfeather/obd/lightshare/service/impl/ObdDataServiceImpl.kt
@@ -1,8 +1,8 @@
package com.flightfeather.obd.lightshare.service.impl
import com.flightfeather.obd.lightshare.bean.ObdDataVo
import com.flightfeather.obd.lightshare.bean.*
import com.flightfeather.obd.lightshare.service.ObdDataService
import com.flightfeather.obd.repository.ObdDataRepository
import com.flightfeather.obd.repository.*
import org.springframework.stereotype.Service
/**
@@ -10,10 +10,32 @@
 * Date: 2019/8/27
 */
@Service
class ObdDataServiceImpl(val obdDataRepository: ObdDataRepository) : ObdDataService {
class ObdDataServiceImpl(
        val obdDataRepository: ObdDataRepository,
        val carLoginRepository: CarLoginRepository,
        val carLogoutRepository: CarLogoutRepository,
        val obdInfoRepository: ObdInfoRepository,
        val dataStreamRepository: DataStreamRepository
) : ObdDataService {
    override fun getDataByVinCode(vinCode: String, pageNum: Int?, pageSize: Int?): MutableList<ObdDataVo> {
        return obdDataRepository.getDataByVinCode(vinCode, pageNum, pageSize)
    }
    override fun getDataByVinCode(vinCode: String, pageNum: Int?, pageSize: Int?): MutableList<ObdDataVo>
            = obdDataRepository.getDataByVinCode(vinCode, pageNum, pageSize)
    override fun getLoginData(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<CarLoginVo>
            = carLoginRepository.getLoginData(deviceCode, pageNum, pageSize, startTime, endTime)
    override fun getLogoutData(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<CarLogoutVo>
            = carLogoutRepository.getLogoutData(deviceCode, pageNum, pageSize, startTime, endTime)
    override fun getObdInfo(deviceCode: String, pageNum: Int?, pageSize: Int?): List<ObdInfoVo>
            = obdInfoRepository.getObdInfo(deviceCode, pageNum, pageSize)
    override fun getDataStream(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<DataStreamVo>
            = dataStreamRepository.getDataStream(deviceCode, pageNum, pageSize, startTime, endTime)
    override fun getDataStreamCount(deviceCode: String, startTime: String?, endTime: String?): Int
            = dataStreamRepository.getDataStreamCount(deviceCode, startTime, endTime)
    override fun getCoordinate(deviceCode: String): LatLngVo
            = dataStreamRepository.getCoordinate(deviceCode)
}