/*
 * @Author: zc
 * @description 随手拍-邀请码管理
 */
import request from '@/utils/request';
/**
 * @description 获取邀请码基础数据
 * @param {object} params
 */
export const getInviteCodeBaseData = (params?: object) => {
	return request({
		url: `/api/v1/InviteCode/basedata`,
		method: 'get',
		params,
	});
};
/**
 * @description 获取邀请码列表
 * @param {object} params
 */
export const getInviteCodeList = (params?: object) => {
	return request({
		url: `/api/v1/InviteCode`,
		method: 'get',
		params,
	});
};
/**
 * @description 添加部门邀请码
 * @param {object} data
 */
export const addInviteCode = (data: object) => {
	return request({
		url: `/api/v1/InviteCode`,
		method: 'post',
		data,
	});
};
/**
 * @description 获取邀请码列表
 * @param {string} id
 */
export const getInviteCodeDetail = (id: string) => {
	return request({
		url: `/api/v1/InviteCode/${id}`,
		method: 'get',
	});
};
/**
 * @description 修改部门邀请码
 * @param {object} data
 */
export const updateInviteCode = (data: object) => {
	return request({
		url: `/api/v1/InviteCode`,
		method: 'put',
		data,
	});
};
/**
 * @description 删除部门邀请码
 * @param {object} data
 */
export const deleteInviteCode = (data: object) => {
	return request({
		url: `/api/v1/InviteCode`,
		method: 'delete',
		data,
	});
};
/**
 * @description 邀请码统计
 * @param {object} params
 */
export const getInviteCodeStatistics = (params?: object) => {
	return request({
		url: `/api/v1/InviteCode/statistic`,
		method: 'get',
		params,
	});
};
/**
 * @description 邀请码统计导出
 * @param {object} data
 */
export const getInviteCodeStatisticsExport = (data: object) => {
	return request(
		{
			url: `/api/v1/InviteCode/statistic/export_excel`,
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 邀请码统计明细
 * @param {object} params
 */
export const getInviteCodeStatisticsDetail = (params?: object) => {
	return request({
		url: `/api/v1/InviteCode/statistic/detail`,
		method: 'get',
		params,
	});
};
/**
 * @description 邀请码统计明细导出
 * @param {object} data
 */
export const getInviteCodeStatisticsDetailExport = (data: object) => {
	return request(
		{
			url: `/api/v1/InviteCode/statistic/detail/export_excel`,
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
