package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.system.api.domain.*;
import com.ruoyi.system.api.factory.RemoteRevenueConfigFallbackFactory;
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.RequestHeader;

import java.util.List;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteRevenueConfigService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteRevenueConfigFallbackFactory.class)
public interface RemoteRevenueConfigService
{
    /**
     * 保存流量数据
     * @param queryParam 流量数据列表
     * @return 操作结果
     */
    @PostMapping("/revenueConfig/autoSaveServiceTrafficData")
    public R<String> autoSaveServiceTrafficData(@RequestBody EpsInitialTrafficDataRemote queryParam, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    /**
     * 保存交换机流量数据
     * @param queryParam 交换机流量数据列表
     * @return 操作结果
     */
    @PostMapping("/switchInfoDetails/autoSaveSwitchTraffic")
    public R<String> autoSaveSwitchTraffic(@RequestBody InitialSwitchInfoDetailsRemote queryParam, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 监控资源信息，如果检测到心跳异常，修改资源表在线状态
     * @param queryParam
     * @param source
     * @return
     */
    @PostMapping("/registration/updateStatusByResource")
    public R<String> updateStatusByResource(@RequestBody RmResourceRegistrationRemote queryParam, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 根据客户端id查询设备其他信息
     * @param queryParam
     * @param source
     * @return
     */
    @PostMapping("/interfaceName/getMsgByClientId")
    public R<AllInterfaceNameRemote> getMsgByClientId(@RequestBody AllInterfaceNameRemote queryParam, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 根据资源组id查询资源组名称
     * @param id
     * @param source
     * @return
     */
    @PostMapping("/group/getResourceGroupMsgById")
    public R<RmResourceGroupRemote> getResourceGroupMsgById(@RequestBody Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 根据id查询资源信息
     * @param ids
     * @param source
     * @return
     */
    @PostMapping("/registration/getRegistrationByIds")
    public R<List<RmResourceRegistrationRemote>> getRegistrationByIds(@RequestBody String[] ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获取资源注册列表
     * @param rmResourceRegistrationRemote
     * @param source
     * @return
     */
    @PostMapping("/registration/list")
    public R<TableDataInfo> getRegistrationList(@RequestBody RmResourceRegistrationRemote rmResourceRegistrationRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    /**
     * 根据硬件SN查询资源信息
     * @param rmResourceRegistrationRemote
     * @param source
     * @return
     */
    @PostMapping("/registration/getListByHardwareSn")
    public R<RmResourceRegistrationRemote> getListByHardwareSn(@RequestBody RmResourceRegistrationRemote rmResourceRegistrationRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 根据clientId获取交换机名称信息
     * @param rmSwitchManagementRemote
     * @param source
     * @return
     */
    @PostMapping("/switchManagement/getSwitchNameByClientId")
    public R<List<RmSwitchManagementRemote>> getSwitchNameByClientId(@RequestBody RmSwitchManagementRemote rmSwitchManagementRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    /**
     * 根据clientId修改交换机在线状态
     * @param rmSwitchManagementRemote
     * @param source
     * @return
     */
    @PostMapping("/switchManagement/updateSwitchMsgByClientId")
    public R<Integer> updateSwitchMsgByClientId(@RequestBody RmSwitchManagementRemote rmSwitchManagementRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 自动注册
     * @param rmRegisterMsgRemote
     * @param source
     * @return
     */
    @PostMapping("/registration/innerAddRegist")
    public R<Integer> innerAddRegist(@RequestBody RmRegisterMsgRemote rmRegisterMsgRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    /**
     * 添加节点标识
     * @param rmResourceRegistrationRemote
     * @param source
     * @return
     */
    @PostMapping("/registration/innerUpdateRegist")
    public R<Integer> innerUpdateRegist(@RequestBody RmResourceRegistrationRemote rmResourceRegistrationRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获取95值列表
     * @param epsNodeBandwidthRemote
     * @param source
     * @return
     */
    @PostMapping("/bandwidth/getEpsNodeBandWidthList")
    public R<List<EpsNodeBandwidthRemote>> getEpsNodeBandWidthList(@RequestBody EpsNodeBandwidthRemote epsNodeBandwidthRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
