import request from '@/utils/request' ; import { Blog , BlogSub } from '@root/src/models/blog' ; export const getBlogSubPage = ( params ? ) => { return request . get < ResponseList < BlogSub > > ( '/blog/blogSub/page' , params ) ; } ; export const getHotBlogSubPage = ( params ? ) => { return request . get < ResponseList < BlogSub > > ( '/blog/hotBlogSubs' , params ) ; } ; export const getLatestBlogSubPage = ( params ? ) => { return request . get < ResponseList < BlogSub > > ( '/blog/latestBlogSubs' , params ) ; } ; export const getBlogSubPageBySearch = ( params ? ) => { return request . get < ResponseList < BlogSub > > ( '/blog/blogSub/search' , params ) ; } ; export const getBlogInfo = ( id ) => { return request . get < ResponseData < Blog > > ( '/blog/' + id ) ; } ; export const updateLikeByBlog = ( id ) => { return request . put < ResponseData < number > > ( `/blog/${ id }/like` ) ; } ; export const getArchiveTimes = ( ) => { return request . get < ResponseData < Record < number , number [ ] > > > ( '/blogs/archive/times' ) ; } ; export const getArchiveBlogs = ( params ) => { return request . get < ResponseList < BlogSub > > ( '/blogs/archive/blogs' , params ) ; } ;