feiyu02
2025-01-09 6c1e7c5ac983301c34f003415cda2ef7c7e176a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.flightfeather.uav.lightshare.service.impl
 
import com.flightfeather.uav.biz.datafetch.ShenXinDataFetch
import com.flightfeather.uav.common.exception.BizException
import com.flightfeather.uav.lightshare.eunm.ThirdPartyLabel
import com.flightfeather.uav.lightshare.service.ThirdPartyService
import com.flightfeather.uav.socket.eunm.UWDeviceType
import org.springframework.stereotype.Service
import java.time.LocalDateTime
 
/**
 *
 * @date 2024/8/26
 * @author feiyu02
 */
@Service
class ThirdPartyServiceImpl(private val shenXinDataFetch: ShenXinDataFetch) : ThirdPartyService {
 
    override fun fetchMissionData(label: String, missionCode: String): Boolean {
        when (label) {
            ThirdPartyLabel.ShenXin.value -> {
                shenXinDataFetch.fetchMissionData(missionCode)
                return true
            }
            else -> throw BizException("第三方接口标识不存在")
        }
    }
 
    override fun fetchLatestData(
        label: String, type: UWDeviceType, deviceCode: String, startTime: LocalDateTime?, endTime: LocalDateTime?,
    ): Boolean {
        when (label) {
            ThirdPartyLabel.ShenXin.value -> {
                shenXinDataFetch.fetchLatestData(type, deviceCode, startTime, endTime)
                return true
            }
            else -> throw BizException("第三方接口标识不存在")
        }
    }
}