import request from '@/utils/request' ; import { Blog } from '@root/src/models/blog' ; export const addBlog = ( params ) => { return request . post < ResponseData < Blog > > ( '/blog' , params , { 'Content-Type' : 'multipart/form-data' } ) ; } ; export const getBlog = ( id ) => { return request . get < ResponseData < Blog > > ( `/blog/${ id }` ) ; } ; export const getBlogs = ( params = { } ) => { return request . get < ResponseList < Blog > > ( '/blogs' , params ) ; } ; export const updateBlog = ( id , params ) => { return request . put < ResponseData < Blog > > ( `/blog/${ id }` , params , { 'Content-Type' : 'multipart/form-data' } ) ; } ; export const deleteBlog = ( id ) => { return request . delete < ResponseData < Blog > > ( `/blog/${ id }` ) ; } ;