import request from '../../src/js/request'
import { _HOSPITAL} from '../base-url'

// 家属修改新生儿探视信息(同取消)
export const fhPutModifyVisit = (data,id) =>
  request({
    url: `${_HOSPITAL}/baby-visits/Modify/${id}`,
    method: 'put',
    data
  })

// 获取时间启禁用
export const fhGetTimeState = (params,hospitalId) =>
request({
  url: `${_HOSPITAL}/baby-visits/get/${hospitalId}/opened`,
  method: 'get',
  params
})

// 患者端获取探视规则
export const fhGetRules = (hospitalId) =>
request({
  url: `${_HOSPITAL}/baby-visits/get/${hospitalId}/rules`
})

// 探视状态跟踪
export const fhGetVisitState = (params) =>
request({
  url: `${_HOSPITAL}/baby-visits/state-follow`,
  method: 'get',
  params
})

// 家属预约新生儿探视（创建新生儿探视）
export const fhCreateVisit = (data, hospitalId, memberId) =>
request({
  url: `${_HOSPITAL}/baby-visits/${hospitalId}/${memberId}`,
  method: 'post',
  data
})

// 新生儿探视列表
export const fhGetVisitList = (params,hospitalId) =>
request({
  url: `${_HOSPITAL}/baby-visits/${hospitalId}`,
  method: 'get',
  params
})

// 新生儿探视详情
export const fhGetVisitDetails = (id) =>
request({
  url: `${_HOSPITAL}/baby-visits/detail/${id}`,
  method: 'get'
})

// 探视管理
export const fhGetVisitInfo = (data, phoneNumber) =>
request({
  url: `${_HOSPITAL}/baby-visits/getVisitInfo/${phoneNumber}`,
  method: 'get',
  data
})

// 生成trtc UserSig签名
export const fhGetUserSig = (params) =>
request({
  url: `${_HOSPITAL}/baby-visits/send-user-sig`,
  method: 'post',
  params
})

// 获取探视设置
export const fhGetnewbornSettings = (hospitalId) =>
request({
  url: `${_HOSPITAL}/baby-visits/getSetting/${hospitalId}`
})

// 获取医院信息
export const fhGetHospitalMes = (hospitalId) =>
request({
  url: `/hospital/integration/hospital-info/${hospitalId}`
})


// 获取新生儿预约次数是否超过限制
export const fhGetExceed = (hospitalId,familyPhoneNumber) =>
request({
  url: `/hospital/client/baby-visits/${hospitalId}/${familyPhoneNumber}/exceed`
})