package com.imdroid.secapi.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;

@FeignClient(name="BeidouClient",url = "http://localhost:9901/api")
public interface BeidouClient {
    @PostMapping("/config_ack")
    String onConfigAck(@RequestParam(name = "deviceId") String deviceId,
                       @RequestParam(name = "tenantId") Integer tenantId,
                       @RequestParam(name = "configAck") String configAck);

    @PostMapping("/device_online")
    String onLine(@RequestParam(name = "deviceId") String deviceId,
                  @RequestParam(name = "tenantId") Integer tenantId,
                  @RequestParam(name = "lastOnlineTime") LocalDateTime lastOnlineTime);

    @PostMapping("/device_active")
    String onDeviceActive(@RequestParam(name = "deviceId") String deviceId,
                          @RequestParam(name = "tenantId") Integer tenantId);

    @PostMapping("/device_stop")
    String onDeviceStop(@RequestParam(name = "deviceId") String deviceId,
                        @RequestParam(name = "tenantId") Integer tenantId);

    @PostMapping("/gnss_upload")
    String onGnssUpload(@RequestParam(name = "deviceId") String deviceId,
                        @RequestParam(name = "tenantId") Integer tenantId,
                        @RequestParam(name = "uploadTime") LocalDateTime uploadTime,
                        @RequestParam(name = "info") String info);

    @PostMapping("/gnss_upload_pause")
    String onGnssUploadPause(@RequestParam(name = "deviceId") String deviceId,
                             @RequestParam(name = "tenantId") Integer tenantId);

    @PostMapping("/gnss_upload_complete")
    String onGnssUploadComplete(@RequestParam(name = "deviceId") String deviceId,
                                @RequestParam(name = "tenantId") Integer tenantId,
                                @RequestParam(name = "uploadTime") LocalDateTime uploadTime);

}
