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

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

/**
 * 删除企业
 * @param {*} data
 */
const DeleteEnterpriseIdApi = function (id) {
    return request({
        url: `/admin-api/people/enterprise/delete?id=${id}`,
        method: 'delete'
    });
};

/**
 * 创建企业
 * @param {*} data
 */
const createAffiliatedEnterprise = function (data) {
    return request({
        url: '/admin-api/people/enterprise/create',
        method: 'post',
        data: data
    });
};

/**
 * 创建诉求
 * @param {*} data
 */
const createAppealApi = function (data) {
    return request({
        url: '/admin-api/people/appeal/create',
        method: 'post',
        data: data
    });
};

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

/**
 * 获得诉求详情
 * @param {*} data
 */
const getAppealIdApi = function (data) {
    return request({
        url: '/admin-api/people/appeal/get',
        method: 'get',
        data: data
    });
};

/**
 * 获得优质回复
 * @param {*} data
 */
const getPerfectReplyApi = function (data) {
    return request({
        url: '/admin-api/people/appeal/perfect/reply/page',
        method: 'get',
        data: data
    });
};

/**
 * 更新企业
 * @param {*} data
 */
const getEnterpriseApi = function (id) {
    return request({
        url: `/admin-api/people/enterprise/get?id=${id}`,
        method: 'get'
    });
};
export { getEnterpriseListApi, DeleteEnterpriseIdApi, createAffiliatedEnterprise, createAppealApi, getAppealListApi, getAppealIdApi, getPerfectReplyApi, getEnterpriseApi };
