gaoluyang
2026-06-24 bfdc0e0e6d5e47aa501f9b6fadd143d9c97cf00a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { PageParam, PageResult } from '../../../../packages/effects/request/src';
 
import { requestClient } from '#/api/request';
 
export namespace MallArticleApi {
  /** 文章管理 */
  export interface Article {
    id: number; // 文章编号
    categoryId: number; // 分类编号
    title: string; // 文章标题
    author: string; // 作者
    picUrl: string; // 封面图
    introduction: string; // 文章简介
    browseCount: string; // 浏览数量
    sort: number; // 排序
    status: number; // 状态
    spuId: number; // 商品编号
    recommendHot: boolean; // 是否热门
    recommendBanner: boolean; // 是否轮播图
    content: string; // 文章内容
  }
}
 
/** 查询文章管理列表 */
export function getArticlePage(params: PageParam) {
  return requestClient.get<PageResult<MallArticleApi.Article>>(
    '/promotion/article/page',
    { params },
  );
}
 
/** 查询文章管理详情 */
export function getArticle(id: number) {
  return requestClient.get<MallArticleApi.Article>(
    `/promotion/article/get?id=${id}`,
  );
}
 
/** 新增文章管理 */
export function createArticle(data: MallArticleApi.Article) {
  return requestClient.post('/promotion/article/create', data);
}
 
/** 修改文章管理 */
export function updateArticle(data: MallArticleApi.Article) {
  return requestClient.put('/promotion/article/update', data);
}
 
/** 删除文章管理 */
export function deleteArticle(id: number) {
  return requestClient.delete(`/promotion/article/delete?id=${id}`);
}