import http from '../utils/http/http.js'

const login = (data) => {
    return http.post("/admin/login", data);
};
const getCaptcha = (data) => {
    return http.get("/admin/captcha", data);

 }
const getItemList = (data) => {//获取列表-分页
    return http.get("/admin/project/page", data);
};
const getPlatformList=(data)=>{
    return http.get("/admin/project/platform/page",data);
}
const getAllPlatformList=(data)=>{
    return http.get("/admin/platform/list",data);
}
const getHospitalList = (data) => {//获取医院列表
    return http.get("/admin/white/hospital/page", data);
 }
 const searchHospital = (data) => {//搜索医院
     return http.get("/admin/white/hospital/search", data);
}
const searchDoctor = (data) => {//搜索医院
    return http.get("/admin/white/doctor/search", data);
}

 const getDoctorList = (data) => {//获取医院列表
    return http.get("/admin/white/doctor/page", data);
 }
 const getDynamicList = (data) => {//获取医院列表
    return http.get("/admin/white/dynamic",data);
 }
 const getCaseList = (data) => {//获取医院列表
    return http.post("/admin/case/page", data,'application/json');
 }
 const getStaticPlatformList = (data) => {//统计病例平台
    return http.get("/admin/stats/platform/page", data);
 }
 const getStaticUserList = (data) => {//统计病例用户
    return http.get("/admin/stats/user/page", data);
 }
 const getCommentList = (data) => {//获取医院列表
    return http.get("/admin/case/comment/page", data);
}
 const getUserList = (data) => {//用户列表
    return http.get("/admin/user/admin", data);
 }
 const getProvinceList = () => {//获取省份列表
    return http.get("/admin/basic/area");
}
const getLevelList = () => {//获取医院等级
    return http.get("/admin/basic/level");
}
const getTitleList = () => {//获取获取医生职称
    return http.get("/admin/basic/title");
}
const getDepartmentList = () => {//获取医院科室
    return http.get("/admin/basic/department");
}
const getProjectDetail = (id) => {
    return http.get("/admin/project/"+id,{});
};
const getPlatformDetail = (id) => {
    return http.get("/admin/project/platform/"+id,{});
};
const getCaseDetail = (id) => {
    return http.get("/admin/case/"+id,{});
};
const getUserDetail = (id) => {
    return http.get("/admin/user/admin/"+id,{});
};

const updateItemStatus = (id,data) => {
    return http.put("/admin/project/status/"+id, data);
};
const updateHospitalStatus = (id,data) => {
    return http.put("/admin/white/hospital/status/"+id, data);
};

const updateCommentStatus = (id,data) => {
    return http.put("/admin/case/comment/status/"+id, data);
};
const updateCommentQualityStatus = (id,data) => {
    return http.post("/admin/case/comment/high/"+id, data);
};
const updatePlatformStatus = (id,data) => {
    return http.put("/admin/project/platform/status/"+id, data);
};
const updateDoctorStatus = (id,data) => {
    return http.put("/admin/white/doctor/status/"+id, data);
};
const updateCaseStatus = (id,data) => {
    return http.put("/admin/case/status/"+id,data);
};
const updateUserStatus = (id,data) => {
    return http.put("/admin/user/admin/status/"+id,data);
};
const updateUserDisableStatus = (id,data) => {
    return http.put("/admin/user/admin/disabled/"+id,data);
};
const updatePwd = (id,data) => {
    return http.put("/admin/user/admin/password/"+id,data);
};
const addItem = (data) => {
    return http.post("/admin/project", data);
};
const addHospital = (data) => {
    return http.post("/admin/white/hospital", data);
};

const addPlatform = (data) => {
    return http.post("/admin/project/platform", data);
};
const addDoctor = (data) => {
    return http.post("/admin/white/doctor", data);
};
const addDynamic=(data) => {
    return http.post("/admin/white/dynamic",data,'application/json');
};
const addCase=(data) => {
    return http.post("/admin/case", data);
};
const addCaseItem=(data) => {
    return http.post("/admin/case/item", data,'application/json');
};
const addUser=(data) => {
    return http.post("/admin/user/admin", data);
};
const updateItem = (id,data) => {
    return http.put("/admin/project/"+id, data);
};
const updatePlatform = (id,data) => {
    return http.put("/admin/project/platform/"+id, data);
};
const updateDynamic= (id,data) => {
    return http.put("/admin/white/dynamic/"+id, data,'application/json');
};
const updateCase= (id,data) => {
    return http.put("/admin/case/"+id, data);
};
const updateCaseItem= (id,data) => {
    return http.put("/admin/case/item/"+id, data,'application/json');
};
const updateUser= (id,data) => {
    return http.put("/admin/user/admin/"+id, data);
};
const updateComment= (id,data) => {
    return http.put("/admin/case/comment/content/"+id, data);
};
const delHospital = (id) => {
    return http.del("/admin/white/hospital/"+id);
};
const delDoctor = (id) => {
    return http.del("/admin/white/doctor/"+id);
};
const delCaseItem = (id) => {
    return http.del("/admin/case/item/"+id);
};

const delUser = (id) => {
    return http.del("/admin/user/admin"+id);
};

const exportHospital = (data) => {
    return http.post("/admin/white/hospital/export", data);
};
const exportDoctor = (data) => {
    return http.post("/admin/white/doctor/export", data);
};
const exportJoin = (data) => {
    return http.post("/admin/stats/user/export", data);
};
const getOssSign=(data)=>{
    return http.get('/admin/sign/oss', data);
}
const ossUpload=(url,data)=>{
    return http.post(url,data,'multipart/form-data')
}

export default {
    login,
    searchHospital,
    searchDoctor,
    getPlatformList,
    getPlatformDetail,
    updatePlatformStatus,
    addPlatform,
    updatePlatform,
    getCaptcha,
    getItemList,
    getAllPlatformList,
    getProjectDetail,
    addItem,
    updateItem,
    updateItemStatus,
    getHospitalList,
    updateHospitalStatus,
    addHospital,
    delHospital,
    getDoctorList,
    updateDoctorStatus,
    addDoctor,
    delDoctor,
    getDynamicList,
    addDynamic,
    updateDynamic,
    getCaseList,
    getCaseDetail,
    updateCaseStatus,
    updateCommentQualityStatus,
    addCase,
    updateCase,
    getStaticPlatformList,
    getStaticUserList,
    getUserList,
    getUserDetail,
    updateUser,
    updateComment,
    getCommentList,
    updateCommentStatus,
    updateUserStatus,
    updateUserDisableStatus,
    updatePwd,
    delUser,
    addUser,
    getLevelList,
    getTitleList,
    getProvinceList,
    getDepartmentList,
    getOssSign,
    ossUpload,
    addCaseItem,
    delCaseItem,
    updateCaseItem,
    exportHospital,
    exportDoctor,
    exportJoin
}