import { param } from '@/utils';
import request from '@/utils/request';

// 详情信息
export const deviceDeatil = (id: string) => {
    return request({
        url: `/api/hby100j/device/${id}`,
        method: 'get',
    });
};
// 警示灯爆闪模式
export const strobeMode = (data: any) => {
    return request({
        url: `/api/hby100j/device/strobeMode`,
        method: 'post',
        data: data
    });
};


// 灯光亮度
function lightModeSettings (data: any) {
    return request({
        url: `/api/hby100j/device/lightAdjustment`,
        method: 'post',
        data: data
    });
};
//频率调节
function staticPowerSetting  (data: any)  {
    return request({
        url: `/api/hby100j/device/strobeFrequency`,
        method: 'post',
        data: data
    });
};
// 修改音量
function settingUpdateVolume  (data: any)  {
    return request({
        url: `/api/hby100j/device/updateVolume`,
        method: 'post',
        data: data
    });       
};

// 强制报警
function SosSetting  (data: any) {
    return request({
        url: `/api/hby100j/device/forceAlarmActivation`,
        method: 'post',
        data: data
    });
};
// 语音列表
function queryAudioFileList (params: any) {
    return request({
        url: `/api/video/queryAudioFileList`,
        method: 'get',
       params: params
    });
}
// 提取文本内容
function extractText (data: any) {
    return request({
        url: `/api/video/extract`,
        method: 'post',
        data: data
    });
}
// 上传音频文件
function uploadAudioToOss (data: any) {
    return request({
        url: `/api/video/uploadAudioToOss`,
        method: 'post',
        data: data
    });
}
// 文本转语音
export function videTtsToOss(data:any) {
  return request({
    url: `/api/video/ttsToOss`,
    method: 'post',
	data:data
  })
}
// 重命名
export function videRenameAudioFile(data:any) {
  return request({
    url: `/api/video/renameAudioFile`,
    method: 'post',
	data:data
  })
}
// 删除语音文件列表
export function deviceDeleteAudioFile(params:any) {
  return request({
    url: `/api/video/deleteAudioFile`,
    method: 'get',
	params:params
  })
}

// 更新语音,使用语音
export function deviceUpdateVoice(data:any) {
  return request({
    url: `/api/hby100j/device/updateVoice`,
    method: 'post',
	data:data
  })
}
// 语音播放
export function deviceVoiceBroadcast(data:any) {
  return request({
    url: `/api/hby100j/device/voiceBroadcast`,
    method: 'post',
	data:data
  })
}

export default {
    deviceDeatil,
   lightModeSettings:lightModeSettings,
   SosSetting:SosSetting,
   staticPowerSetting:staticPowerSetting,
   settingUpdateVolume:settingUpdateVolume,
   queryAudioFileList,
   videRenameAudioFile,
   deviceDeleteAudioFile,
   deviceUpdateVoice,
   videTtsToOss,
   uploadAudioToOss,
   extractText,
   strobeMode,
   deviceVoiceBroadcast
};