import request from "@/api/request.js";
// 全领域

// 全领域统计
/**
 * @header token
 * @param {Object} params
 * @param {String} params.startDate - 开始日期
 * @param {String} params.endDate - 结束日期
 */
export function getAllDomainCount(params) {
	return request({
		method: "GET",
		url: `/api/rivalryIndexV2/AllDomainCount`,
		params
	});
}

// 美对华制裁措施数量趋势
/**
 * @header token
 * @param {Object} params
 * @param {String} params.byYOrM - 按月统计或按年统计
 */
export function getDomainContainmentTrend(params) {
	return request({
		method: "GET",
		url: `/api/rivalryIndexV2/DomainContainmentTrend`,
		params
	});
}

// 中美科技博弈分析
export function getTechnologyGameAnalysis(domain = 1) {
	return request({
		method: "GET",
		url: `/api/rivalryIndexV2/TechnologyGameAnalysis?domain=${domain}`
	});
}

// 领域打压遏制排行
/**
 * @param {currentPage, pageSize}
 */
export function getDomainContainmentRanking(ContainmentOrg = "对我打压机构", Domains = "") {
	return request({
		method: "GET",
		url: !!Domains
			? `/api/rivalryIndexV2/DomainContainmentRanking?ContainmentOrg=${ContainmentOrg}&Domains=${Domains}`
			: `/api/rivalryIndexV2/DomainContainmentRanking?ContainmentOrg=${ContainmentOrg}`
	});
}

// 领域打压遏制时间线
/**
 * @param {currentPage, pageSize}
 */
export function getDomainContainmentTimeline(params) {
	return request({
		method: "GET",
		url: `/api/rivalryIndexV2/DomainContainmentTimeline`,
		params
	});
}
