import request from './request'

//获取摄像头流地址
export function iotCameraFindByCondition(data) {
  return request({
    url: '/iot/camera/findByCondition',
    method: 'post',
    data: data
  })
}
//获取摄像头流地址
export function iotCameraGetPlaybackURLs(query) {
  return request({
    url: '/iot/camera/getPlaybackURLs',
    method: 'get',
    params: query
  })
}
//根据设备ID获取摄像头流地址
export function iotCameraGetPreviewURLs(query) {
  return request({
    url: '/iot/camera/getPreviewURLs',
    method: 'get',
    params: query
  })
}
//预警记录-非预案详情
export function systemMineWarningNoticeDetail(query) {
  return request({
    url: '/system/mine/warningNoticeDetail',
    method: 'get',
    params: query
  })
}
//获取报警信息
export function laboratoryEventFindByEventId(query) {
  return request({
    url: '/laboratory/event/findByEventId',
    method: 'get',
    params: query
  })
}

//登录
export const login = (data) => {
  return request({
    url: `/auth/appletLogin`,
    method: 'post',
    data: data
  })
};
//查询公共配置
export const configInfo = (query) => {
  return request({
    url: `/auth/configInfo`,
    method: 'get',
    params: query
  })
};
/*                分类获取公共配置
* category        1.系统参数 2.公共配置
* configType      1.基础配置 2.管控一体机 3.化学品终端 4.小程序配置 5.开发配置 6.首页配置
*/
export function getConfigByType(data) {
  return request({
    url: '/system/config/info/getConfigByType',
    method: 'post',
    data: data
  })
}
//查询是否是管理员/安全员
export const systemSubjectCheckIsAdminOrSafeUser = (query) => {
  return request({
    url: `/system/subject/checkIsAdminOrSafeUser`,
    method: 'get',
    params: query
  })
};
//查询人员身份标识
export const securityDataStatisticsGetUserIdentity = (query) => {
  return request({
    url: `/security/dataStatistics/getUserIdentity`,
    method: 'get',
    params: query
  })
};
//查询当前用户下的预案触发数据
export const laboratoryBigViewSelectTriggerInfo = (query) => {
  return request({
    url: `/laboratory/bigView/selectTriggerInfo`,
    method: 'get',
    params: query
  })
};
//应急处置-结束预案
export const laboratoryPlanCloseRiskPlan = (query) => {
  return request({
    url: `/laboratory/plan/closeRiskPlan`,
    method: 'get',
    params: query
  })
};
//实验室-查询喇叭列表
export const iotAppSpeakerFindHorn = (query) => {
  return request({
    url: `/iot/app/speaker/findHorn`,
    method: 'get',
    params: query
  })
};
//实验室-喇叭播放
export const iotAppSpeakerPlayVoice = (query) => {
  return request({
    url: `/iot/app/speaker/playVoice`,
    method: 'get',
    params: query
  })
};

//通用上传接口
export function systemFileUpload(data) {
  return request({
    url: '/system/file/upload',
    method: 'post',
    data: data
  })
}
