package com.mx.cneeds.server.datashow.client;

import com.mx.cneeds.common.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

/**
 * @ClassName DeviceClient
 * @Author zzrdark
 * @Date 2020-03-18 15:57
 * @Description TODO
 **/
@FeignClient(name = "CNEEDS-SERVER-DEVICE")
public interface DeviceClient {

    @PostMapping("/device/series/list")
    PageDto seriesList(@RequestParam Integer page,
                     @RequestParam("limit") Integer pageSize,
                     @RequestParam("sidx") String orderField,
                     @RequestParam("order") String order);

    @PostMapping("/device/series/listAll")
    List<SeriesDto> seriesListAll();

    @PostMapping("/device/series/save")
    void addSeries(@RequestBody SeriesDto dto);

    @PostMapping("/device/series/querySeriesDto")
    SeriesDto querySeries(@RequestBody String seriesNum);

    @PostMapping("/device/series/update")
    void updateSeries(@RequestBody SeriesDto dto);

    @PostMapping("/device/series/delete")
    void deleteSeries(@RequestBody List<Long> ids);


    @PostMapping("device/info/list")
    PageDto deviceList(@RequestParam Integer page,
                       @RequestParam("limit") Integer pageSize,
                       @RequestParam("sidx") String orderField,
                       @RequestParam("order") String order);

    @PostMapping("/device/info/infoByImei")
    DeviceInfoDto queryDeviceByImei(@RequestBody String imei);

    @PostMapping("/device/info/infoByIds")
    List<DeviceInfoDto> queryDeviceByIds(@RequestBody Set<Long> ids);

    @PostMapping("/device/info/importDevice")
    void importDevice(@RequestBody DevicesDto dto);

    @PostMapping("/device/info/updateDeviceChannelBatch")
    void updateDeviceChannelBatch(@RequestBody DevicesDto dto);

    @PostMapping("/device/info/updateDeviceSeriesBatch")
    void updateDeviceSeriesBatch(@RequestBody DevicesDto dto);

    @PostMapping("/device/info/delete")
    void deleteDevice(@RequestBody List<Long> ids);

    @PostMapping("/device/info/uploadDeivceChannelExcel")
    void uploadDeivceChannelExcel(@RequestBody UploadDeviceChannelExcelDto dto);



    @PostMapping("/device/devicechannel/list")
    PageDto deviceChannelList(@RequestParam Integer page,
                       @RequestParam("limit") Integer pageSize,
                       @RequestParam("sidx") String orderField,
                       @RequestParam("order") String order);
    /**
     * 增加一个渠道号
     * @param dto
     */
    @PostMapping("/device/devicechannel/save")
    void addDeviceChannel(@RequestBody DeviceChannelDto dto);

    @PostMapping("/device/devicechannel/queryDeviceChannel")
    DeviceChannelDto queryDeviceChannel(@RequestBody String channelNum);

    @PostMapping("/device/devicechannel/update")
    void updateDeviceChannel(@RequestBody DeviceChannelDto dto);

    @PostMapping("/device/devicechannel/delete")
    void deleteDeviceChannels(@RequestBody List<Long> ids);

    @PostMapping("/device/devicechannel/queryDeviceChannelAll")
    List<DeviceChannelDto> queryDeviceChannelAll();

    @PostMapping("/device/devicechannel/deleteSettingDeviceChannel")
    void deleteSettingDeviceChannel(@RequestBody Long deviceId);

    @PostMapping("/device/devicechannel/updateSettingDeviceChannel")
    void updateSettingDeviceChannel(@RequestBody DeviceInfoDto dto);

    @PostMapping("/device/devicechannel/queryTotalStatisticsDeviceChannel")
    List<DeviceChannelStatisticsDto> queryTotalStatisticsDeviceChannel(@RequestBody(required = false) List<Long> channelIds);

    @PostMapping("/device/devicechannel/deleteStatisticsDeviceChannel")
    void deleteStatisticsDeviceChannel(@RequestBody StatisticsDeviceChannelDto dto);

    @PostMapping("/device/info/queryDeviceChannelSetting")
    List<String> queryDeviceChannelSetting(List<String> imeis);
}
