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


export const HomeApi = {
  CAR_TYPE_TOTAL: '/admin/index/carTypeTotal',
  TODAY_DUTY: 'admin/index/todayDuty',
}

/**
 * 获取消防车辆统计
 * @returns 
 * {
    "code": 200,
    "msg": "请求成功",
    "data": [
        {
            "carType": "灭火类消防车",
            "total": 181
        },
        {
            "carType": "举高类消防车",
            "total": 161
        },
        {
            "carType": "专勤类消防",
            "total": 186
        },
        {
            "carType": "战勤保障消防车",
            "total": 127
        }
    ]
}
 */
export function getCarTypeTotal() {
  return request<{},ResultData<{
    /**
     * 汽车类型
     */
    carType: string, 
    /**
     * 汽车数量
     */
    total: number}[]>>({
    url: HomeApi.CAR_TYPE_TOTAL,
    method: 'get'
  })
}


/**
 *  获取今日值班类型
 * @returns 
 */
export function getTodayDuty() {
  return request<{},ResultData<{
    /**
     * 值班类型
     */
    zblx: string, 
    /**
     * 值班人员
     */
    yhxm: string
  }[]>>({
    url: HomeApi.TODAY_DUTY,
    method: 'get'
  })
}
