package com.sptg.statistics.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.statistics.api.dto.SysDeviceLogDto;
import com.sptg.statistics.api.entity.SysDeviceLog;
import com.sptg.statistics.api.feigns.fallback.SysDeviceLogFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * title: SysDeviceLogFeign
 * package: com.sptg.statistics.api.feigns
 * description: 机器事件日志接口
 *
 *                
 *                
 */
@FeignClient(value = "smart-house-statistics",fallbackFactory = SysDeviceLogFeignFallbackFactory.class)
public interface SysDeviceLogFeign {

    /**
     * 功能描述:机器事件日志列表
     * @param solDto
     * @return ResultBean<Page<SysOperationLog>>
     *                
     *                      
     */
    @PostMapping(value = "/statistics/sysDeviceLog/showSysDeviceLogList")
    ResultBean<Page<SysDeviceLog>> showSysDeviceLogList(@RequestBody(required = false) SysDeviceLogDto solDto);

    /**
     * 功能描述: 插入机器事件日志
     * @param  deviceLog 日志信息
     * @return com.sptg.common.core.beans.ResultBean<java.lang.Boolean>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/sysDeviceLog/addSysDeviceLog")
    ResultBean<Boolean> addSysDeviceLog(@RequestBody SysDeviceLog deviceLog);

    /**
     * 功能描述:批量输入机器事件日志
     * @param sysDeviceLogs
     * @return com.sptg.common.core.beans.ResultBean<java.lang.Boolean>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/sysDeviceLog/sysDeviceLogsInfo")
    ResultBean<Boolean> info(@RequestBody List<SysDeviceLog> sysDeviceLogs);

    /**
     * 功能描述:输入机器事件日志
     * @param sysDeviceLog
     * @return com.sptg.common.core.beans.ResultBean<java.lang.Boolean>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/sysDeviceLog/sysDeviceLogInfo")
    ResultBean<Boolean> info(@RequestBody SysDeviceLog sysDeviceLog);

    /**
     * 功能描述:统计月新增设备(按月分组)
     * @param sysDeviceLogDto
     * @return com.sptg.common.core.beans.ResultBean<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     *                
     *                       
     */
    @PostMapping("/statistics/sysDeviceLog/statisticsDeviceMalfunction")
    ResultBean<List<Map<String,Object>>> statisticsDeviceMalfunction(@RequestBody SysDeviceLogDto sysDeviceLogDto);
    
    /**
     * 功能描述:统计设备故障
     * @param sysDeviceLogDto
     * @return ResultBean<List<Map<String,Object>>>
     *             
     *                      
     */
    @PostMapping("/statistics/sysDeviceLog/getDeviceFaultCountList")
    ResultBean<List<Map<String,Object>>> getDeviceFaultCountList(@RequestBody SysDeviceLogDto sysDeviceLogDto);
    
    /**
     * 功能描述:统计设备故障省份排名
     * @param sysDeviceLogDto
     * @return ResultBean<List<Map<String,Object>>>
     *             
     *                      
     */
    @PostMapping("/statistics/sysDeviceLog/deviceRankForArea")
    ResultBean<List<Map<String,Object>>> deviceRankForArea(@RequestBody SysDeviceLogDto sysDeviceLogDto);
}
