feat:重构模块
This commit is contained in:
@@ -4,7 +4,7 @@ import { IBlog, IBlogCategory, IBlogComment, IBlogStats, IBlogVisit, INewBlog, I
|
||||
import qs from 'qs'
|
||||
import { IPageRecord } from '@/types'
|
||||
|
||||
export const queryBlogApi = (currentPage: number, pageSize: number): Promise<any> =>
|
||||
export const queryBlogApi = (currentPage: number, pageSize: number): Promise<IPageRecord<IBlog>> =>
|
||||
cloudService({
|
||||
url: '/blog-api/blog/page',
|
||||
method: 'get',
|
||||
@@ -58,50 +58,30 @@ export const addBlogCommentApi = (blogComment: IBlogComment): Promise<boolean> =
|
||||
data: blogComment
|
||||
})
|
||||
|
||||
export const queryAdminBlogApi = (currentPage: number,
|
||||
pageSize: number): Promise<IPageRecord<IBlog>> =>
|
||||
cloudService({
|
||||
url: '/admin-service/blog-manage/page',
|
||||
method: 'get',
|
||||
params: { currentPage, pageSize }
|
||||
})
|
||||
|
||||
export const queryAdminBlogByIdApi = (id: number): Promise<IBlog> =>
|
||||
cloudService({
|
||||
url: `/admin-service/blog-manage/content/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
export const queryAdminBlogCategoryApi = (): Promise<IBlogCategory[]> =>
|
||||
cloudService({
|
||||
url: '/admin-service/blog-manage/category',
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
export const addBlogApi = (blog: INewBlog): Promise<boolean> =>
|
||||
cloudService({
|
||||
url: '/admin-service/blog-manage',
|
||||
url: '/blog-api/blog',
|
||||
method: 'post',
|
||||
data: blog
|
||||
})
|
||||
|
||||
export const updateBlogApi = (id: number, blog: INewBlog): Promise<boolean> =>
|
||||
cloudService({
|
||||
url: `/admin-service/blog-manage/${id}`,
|
||||
url: `/blog-api/blog/${id}`,
|
||||
method: 'put',
|
||||
data: blog
|
||||
})
|
||||
|
||||
export const deleteBlogApi = (id: number): Promise<boolean> =>
|
||||
cloudService({
|
||||
url: `/admin-service/blog-manage/${id}`,
|
||||
url: `/blog-api/blog/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
|
||||
export const queryBlogVisitApi = (currentPage: number,
|
||||
pageSize: number): Promise<IPageRecord<IBlogVisit>> =>
|
||||
cloudService({
|
||||
url: '/admin-service/blog-manage/visit',
|
||||
url: '/blog-api/blog/visit',
|
||||
method: 'get',
|
||||
params: { currentPage, pageSize }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user