package com.zd.system.api.speak;

import com.zd.common.core.constant.ServiceNameConstants;
import com.zd.common.core.domain.R;
import com.zd.system.api.domain.PlayVo;
import com.zd.system.api.speak.factory.RemoteSpeakFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 语音远程调用
 */
@FeignClient(contextId = "remoteSpeakService",value = ServiceNameConstants.SPEAK_SERVICE,fallbackFactory = RemoteSpeakFallbackFactory.class)
public interface RemoteSpeakService {
      @RequestMapping("/speaker/textParseVideo")
      String textParseUrl(@RequestParam("speed") Integer speed, @RequestParam("volume") Integer volume, @RequestParam("text") String text);

      /***
       * 文字转语音播放
       * @return
       */
      @RequestMapping("/speaker/textParseUrlIps")
      R textParseUrlIps(@RequestParam("text") String text, @RequestBody List<PlayVo> playVo);

      /**
       * 获取喇叭列表
       * @param page
       * @param pageSize
       * @param floorId
       * @return
       */
      @RequestMapping("/speaker/getDeviceList")
      R getDeviceList(@RequestParam("page") Integer page, @RequestParam("pageSize") Integer pageSize,@RequestParam("floorId") Long floorId);


      /***
       * 语音播放
       * @return
       */
      @RequestMapping("/speaker/textParseUrlAppIps")
      R textParseUrlAppIps(@RequestParam("text") String text, @RequestBody List<PlayVo> playVo);

      /***
       * 关闭喇叭
       * @return
       */
      @RequestMapping("/speaker/stopPlayMusic")
      R stopPlayMusic(@RequestParam("sn") String sn, @RequestParam("ip") String ip);
}
