feat:增加博客统计模块
This commit is contained in:
54
src/apis/stats.ts
Normal file
54
src/apis/stats.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { cloudService } from './index'
|
||||
|
||||
import { IStatsChart } from 'vue3-common/types'
|
||||
import { IBlogOverview } from '@/types/blog'
|
||||
|
||||
export const queryOverviewStatsApi = (): Promise<IBlogOverview> =>
|
||||
cloudService({
|
||||
url: '/blog-api/stats/overview',
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
|
||||
export const queryCategoryStatsApi = (): Promise<IStatsChart[]> =>
|
||||
cloudService({
|
||||
url: '/blog-api/stats/category',
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
|
||||
export const queryApprovedMonthlyStatsApi = (year: number): Promise<IStatsChart[]> =>
|
||||
cloudService({
|
||||
url: '/blog-api/stats/approved/monthly',
|
||||
method: 'get',
|
||||
params: { year }
|
||||
})
|
||||
|
||||
|
||||
export const queryVisitMonthlyStatsApi = (year: number): Promise<IStatsChart[]> =>
|
||||
cloudService({
|
||||
url: '/blog-api/stats/visit/monthly',
|
||||
method: 'get',
|
||||
params: { year }
|
||||
})
|
||||
|
||||
|
||||
export const queryVisitRankStatsApi = (): Promise<IStatsChart[]> =>
|
||||
cloudService({
|
||||
url: '/blog-api/stats/visit/rank',
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
|
||||
export const queryReadRankStatsApi = (): Promise<IStatsChart[]> =>
|
||||
cloudService({
|
||||
url: '/blog-api/stats/read/rank',
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
|
||||
export const queryCommentRankStatsApi = (): Promise<IStatsChart[]> =>
|
||||
cloudService({
|
||||
url: '/blog-api/stats/comment/rank',
|
||||
method: 'get'
|
||||
})
|
||||
Reference in New Issue
Block a user