/**
 * @name 公共接口API
 * @description 请求示例
 * @param {Object} data        请求参数
 * @param {String} url         请求地址
 * @param {String} method      请求类型 可以不设置,默认GET
 */
import request from '../utils/request';

/**
 * 获得banner图分页
 * @param {*} data
 */
const getBannerApi = function (data) {
    return request({
        url: '/admin-api/people/banner/page',
        method: 'get',
        data: data
    });
};

/**
 * 获得字典类型的分页列表
 * @param {*} data
 */
const getDictDataApi = function (data) {
    return request({
        url: '/admin-api/system/dict-data/page',
        method: 'get',
        data: data
    });
};

/**
 * 上传文件
 * @param {*} data
 */
const uploadApi = function (data) {
    return request({
        url: '/admin-api/infra/file/upload',
        method: 'post',
        data: data
    });
};

/**
 * 分类树--查询下级分类
 * @param {*} data
 * @param {*} data.bannerType // 字典TabBar模块 1民生、2生活...
 * @param {*} data.parentId // 根据上级列表id查询下级列表
 */
const recursionApi = function (data) {
    return request(
        {
            url: '/admin-api/people/category/recursion',
            method: 'get',
            data: data
        },
        false
    );
};

/**
 * 创建点赞
 * @param {*} data
 */
const praiseCreateApi = function (data) {
    return request({
        url: '/admin-api/people/praise/create',
        method: 'post',
        data: data
    });
};

/**
 * 取消点赞
 * @param {*} data
 */
const praiseCancelApi = function (data) {
    return request({
        url: '/admin-api/people/praise/cancel',
        method: 'post',
        data: data
    });
};

/**
 * 创建分享
 * @param {*} data
 */
const shareCreateApi = function (data) {
    return request({
        url: '/admin-api/people/share/create',
        method: 'post',
        data: data
    });
};

/**
 * 创建用户收藏
 * @param {*} data
 */
const collectionCreateApi = function (data) {
    return request({
        url: '/admin-api/people/collection/create',
        method: 'post',
        data: data
    });
};
/**
 * 取消用户收藏
 * @param {*} data
 */
const collectionCancelApi = function (data) {
    return request({
        url: '/admin-api/people/collection/cancel',
        method: 'post',
        data: data
    });
};

/**
 * 获得案件处理过程分页
 * @param {*} data
 */
const casesProcessPageApi = function (data) {
    return request({
        url: '/admin-api/people/cases-process/page',
        method: 'get',
        data: data
    });
};

/**
 * 获取部门树
 * @param {*} data
 */
const deptTreeApi = function (data) {
    return request({
        url: '/admin-api/system/dept/tree',
        method: 'get',
        data: data
    });
};

/**
 * 获得服务记录详情
 * @param {*} data
 */
const serveRecordGetApi = function (data) {
    return request({
        url: '/admin-api/people/serve-record/get',
        method: 'get',
        data: data
    });
};

/**
 * 获得服务记录分页
 * @param {*} data
 */
const serveRecordPageApi = function (data) {
    return request({
        url: '/admin-api/people/serve-record/page',
        method: 'get',
        data: data
    });
};

/**
 * 获得线上问诊分页
 * @param {*} data
 */
const inquiriesOnlinePageApi = function (data) {
    return request({
        url: '/admin-api/people/inquiries-online/page',
        method: 'get',
        data: data
    });
};

/**
 * 获得线上问诊详情
 * @param {*} data
 */
const inquiriesOnlineGetApi = function (data) {
    return request({
        url: '/admin-api/people/inquiries-online/get',
        method: 'get',
        data: data
    });
};
export {
    getBannerApi,
    getDictDataApi,
    uploadApi,
    recursionApi,
    praiseCreateApi,
    praiseCancelApi,
    shareCreateApi,
    collectionCreateApi,
    collectionCancelApi,
    casesProcessPageApi,
    deptTreeApi,
    serveRecordGetApi,
    serveRecordPageApi,
    inquiriesOnlineGetApi,
    inquiriesOnlinePageApi
};
