index.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import request from '@/config/axios'
  2. export interface ArticleVO {
  3. id: number
  4. categoryId: number
  5. title: string
  6. author: string
  7. picUrl: string
  8. introduction: string
  9. browseCount: string
  10. sort: number
  11. status: number
  12. spuId: number
  13. recommendHot: boolean
  14. recommendBanner: boolean
  15. content: string
  16. }
  17. // 查询文章管理列表
  18. export const getArticlePage = async (params: any) => {
  19. return await request.get({ url: `/promotion/article/page`, params })
  20. }
  21. // 查询文章管理详情
  22. export const getArticle = async (id: number) => {
  23. return await request.get({ url: `/promotion/article/get?id=` + id })
  24. }
  25. // 新增文章管理
  26. export const createArticle = async (data: ArticleVO) => {
  27. return await request.post({ url: `/promotion/article/create`, data })
  28. }
  29. // 修改文章管理
  30. export const updateArticle = async (data: ArticleVO) => {
  31. return await request.put({ url: `/promotion/article/update`, data })
  32. }
  33. // 删除文章管理
  34. export const deleteArticle = async (id: number) => {
  35. return await request.delete({ url: `/promotion/article/delete?id=` + id })
  36. }