import { http } from '@/utils/http'
import { platform } from '@/utils/platform'
let API = ''
if (process.env.NODE_ENV == 'development' && platform == 'h5') {
  API = '/api'
} else {
  API = ''
}
export interface IFooItem {
  id: string
  name: string
}

/** GET 请求 事件列表 */
export interface IConfigSys {
  option_name: string
}
export const getConfigSys = (data: IConfigSys) => {
  return http.get<IConfigSys>(`${API}/api/v1/config/system/base/config/options`, data)
}

/** POST 发病 请求 */
export interface modelForm {
  eventType: Number
  meta: any
  cowId: Number
  timestamp: string
  backup: string
  eventSource: Number // 1小程序 2pc
}
export const postModel = (data: modelForm) => {
  return http.post<modelForm>(`${API}/api/v1/event/submit`, data)
}
