import { request } from '@/utils/http' import type { ResultData } from '@/utils/http' export type ArticleDetailType = { id: number title: string content: string createTime: string readCount: number categoryId: number articleId: number children?: ArticleDetailType[] } export type ArticleDetailMenuType = { level: number text: string children: ArticleDetailMenuType[] } export const getArticleDetail = (id: number): Promise> => request.get(`web/article/${id}`) export const getArticleCount = (id: number): Promise> => request.get(`web/article/count/${id}`) export const getArticleSearch = (keyword: string): Promise> => request.get(`web/search`, { key: keyword }) export const getArticlesByCateId = (cid: number): Promise> => request.get(`web/articleWithCate/${cid}`) export const getNearArticles = (cid: number): Promise> => request.get(`web/article/near/${cid}`)