package com.sptg.estate.api.feigns;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.entity.VideoCallAccount;
import com.sptg.estate.api.feigns.fallback.VideoCallAccountFeignFallbackFactory;
import com.sptg.permissions.api.entity.DeviceAdminUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * title: VideoCallAccountFeign
 * package: com.sptg.estate.api.feigns
 * description:
 *
 *                  
 *                
 */
@FeignClient(value = "smart-house-estate",fallbackFactory = VideoCallAccountFeignFallbackFactory.class)
public interface VideoCallAccountFeign {

    /**
     * 创建视频对讲账号,会员与住户绑定成功时调用
     * @param account 账号信息
     */
    @PostMapping(value = "/video/callAccount/addEntityByUser")
    void addEntityByUser(@RequestBody VideoCallAccount account);

    /**
     * 创建视频对讲账号,设备绑定小区单元成功时调用
     * @param account 账号信息
     */
    @PostMapping(value = "/video/callAccount/addEntityByDevice")
    void addEntityByDevice(@RequestBody VideoCallAccount account);

    /**
     * 创建视频对讲账号,创建管理机账号时调用
     * @param user 账号信息
     */
    @PostMapping(value = "/video/callAccount/addEntityByAdminUser")
    void addEntityByAdminUser(@RequestBody DeviceAdminUser user);

    /**
     * 获取房间呼叫组Id
     * @param account 查询条件
     * @return ResultBean<String>
     */
    @PostMapping(value = "/video/callAccount/getRoomCallGroupId")
    ResultBean<Object> getRoomCallGroupId(@RequestBody VideoCallAccount account);

    /**
     * 获取管理机呼叫组Id
     * @param account 查询条件
     * @return ResultBean<String>
     */
    @PostMapping(value = "/video/callAccount/getManageCallGroupId")
    ResultBean<Object> getManageCallGroupId(@RequestBody VideoCallAccount account);

    /**
     * 获取设备的对讲账号Id
     * @param account 查询条件
     * @return ResultBean<String>
     */
    @PostMapping(value = "/video/callAccount/getCallAccountIdBySerialNumber")
    ResultBean<Object> getCallAccountIdBySerialNumber(@RequestBody VideoCallAccount account);

    /**
     * 获取设备对讲账号信息
     * @param serialNumber 设备序列号
     * @return ResultBean<VideoCallAccount>
     */
    @GetMapping(value = "/video/callAccount/getDeviceCallAccount")
    ResultBean<VideoCallAccount> getDeviceCallAccount(@RequestParam(value = "serialNumber")String serialNumber);

    /**
     * 获取住户或管理机账号的对讲账号
     * @param userId 用户Id
     * @return ResultBean<VideoCallAccount>
     */
    @GetMapping(value = "/video/callAccount/getCallAccountByUser")
    VideoCallAccount getCallAccountByUser(@RequestParam(value = "userId")Long userId);

}
