init: 项目初始化提交
	
		
			
	
		
	
	
		
	
		
			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 (${{ matrix.language }}) (none, 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
				
			
		
		
	
	
				
					
				
			
		
			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 (${{ matrix.language }}) (none, 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
				
			This commit is contained in:
		
							
								
								
									
										45
									
								
								apps/web-antd/src/api/promotion/analytics.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								apps/web-antd/src/api/promotion/analytics.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,45 @@ | ||||
| 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 }; | ||||
							
								
								
									
										2
									
								
								apps/web-antd/src/api/promotion/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								apps/web-antd/src/api/promotion/index.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| export * from './analytics'; | ||||
| export * from './link'; | ||||
							
								
								
									
										67
									
								
								apps/web-antd/src/api/promotion/link.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								apps/web-antd/src/api/promotion/link.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,67 @@ | ||||
| import type { Recordable } from '@vben/types'; | ||||
|  | ||||
| import { requestClient } from '#/api/request'; | ||||
|  | ||||
| export namespace PromotionLinkApi { | ||||
|   export interface PromotionLinkItem { | ||||
|     id: number; | ||||
|     name: string; | ||||
|     url: string; | ||||
|     create_time: string; | ||||
|   } | ||||
|  | ||||
|   export interface PromotionLink { | ||||
|     total: number; | ||||
|     items: PromotionLinkItem[]; | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * 获取推广链接列表数据 | ||||
|  */ | ||||
| async function getPromotionLinkList(params: Recordable<any>) { | ||||
|   return requestClient.get<PromotionLinkApi.PromotionLink>( | ||||
|     '/promotion/link/list', | ||||
|     { | ||||
|       params, | ||||
|     }, | ||||
|   ); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * 创建推广链接 | ||||
|  * @param data 推广链接数据 | ||||
|  */ | ||||
| async function createPromotionLink( | ||||
|   data: Omit<PromotionLinkApi.PromotionLinkItem, 'id'>, | ||||
| ) { | ||||
|   return requestClient.post('/promotion/link/create', data); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * 更新推广链接 | ||||
|  * | ||||
|  * @param id 推广链接 ID | ||||
|  * @param data 推广链接数据 | ||||
|  */ | ||||
| async function updatePromotionLink( | ||||
|   id: string, | ||||
|   data: Omit<PromotionLinkApi.PromotionLinkItem, 'id'>, | ||||
| ) { | ||||
|   return requestClient.put(`/promotion/link/update/${id}`, data); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * 删除推广链接 | ||||
|  * @param id 推广链接 ID | ||||
|  */ | ||||
| async function deletePromotionLink(id: string) { | ||||
|   return requestClient.delete(`/promotion/link/delete/${id}`); | ||||
| } | ||||
|  | ||||
| export { | ||||
|   createPromotionLink, | ||||
|   deletePromotionLink, | ||||
|   getPromotionLinkList, | ||||
|   updatePromotionLink, | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user