Files
ycc-proxy-admin/apps/web-antd/src/api/promotion/analytics.ts
liangzai 0668eea99b
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
f
2025-11-27 19:08:41 +08:00

46 lines
966 B
TypeScript

import { requestClient } from '#/api/request';
export namespace PromotionAnalyticsApi {
export interface OverviewData {
today_click_count: number;
today_pay_count: number;
today_pay_amount: number;
total_click_count: number;
total_pay_count: number;
total_pay_amount: number;
}
export interface TrendData {
id: number;
link_id: number;
pay_amount: number;
click_count: number;
pay_count: number;
stats_date: string;
}
}
/**
* 获取推广数据概览
*/
async function statsTotal() {
return requestClient.get<PromotionAnalyticsApi.OverviewData>(
'/promotion/stats/total',
);
}
/**
* 获取推广数据趋势
* @param params 日期范围参数
*/
async function statsHistory(params: { end_date: string; start_date: string }) {
return requestClient.get<PromotionAnalyticsApi.TrendData[]>(
'/promotion/stats/history',
{
params,
},
);
}
export { statsHistory, statsTotal };