gaoluyang
2026-06-29 27cd042df9aca0383a49f3514bc21958dd890912
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import type { PageParam, PageResult } from '..\..\..\..\..\packages\effects\request\src';
 
import { requestClient } from '#/api/request';
 
export namespace ImManagerChannelMaterialApi {
  /** 频道素材 */
  export interface Material {
    id: number;
    channelId: number;
    channelName?: string;
    type: number;
    title: string;
    coverUrl?: string;
    summary?: string;
    content?: string;
    url?: string;
    createTime?: Date;
  }
}
 
 
/** 获得素材分页 */
export function getManagerChannelMaterialPage(params: PageParam) {
  return requestClient.get<PageResult<ImManagerChannelMaterialApi.Material>>(
    '/im/manager/channel-material/page',
    { params },
  );
}
 
/** 获得指定频道下的素材精简列表 */
export function getSimpleManagerChannelMaterialList(channelId: number) {
  return requestClient.get<ImManagerChannelMaterialApi.Material[]>(
    '/im/manager/channel-material/simple-list',
    { params: { channelId } },
  );
}
 
/** 获得素材详情 */
export function getManagerChannelMaterial(id: number) {
  return requestClient.get<ImManagerChannelMaterialApi.Material>(
    '/im/manager/channel-material/get',
    { params: { id } },
  );
}
 
/** 新增素材 */
export function createManagerChannelMaterial(
  data: ImManagerChannelMaterialApi.Material,
) {
  return requestClient.post<number>('/im/manager/channel-material/create', data);
}
 
/** 修改素材 */
export function updateManagerChannelMaterial(
  data: ImManagerChannelMaterialApi.Material,
) {
  return requestClient.put<boolean>(
    '/im/manager/channel-material/update',
    data,
  );
}
 
/** 删除素材 */
export function deleteManagerChannelMaterial(id: number) {
  return requestClient.delete<boolean>('/im/manager/channel-material/delete', {
    params: { id },
  });
}