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
53
54
55
56
57
58
59
60
import type { PageParam, PageResult } from '../../../packages/effects/request/src';
 
import { MessageType } from '../../../packages/constants/src';
 
import { requestClient } from '#/api/request';
 
export namespace MpMessageApi {
  /** 消息信息 */
  export interface Message {
    id?: number;
    accountId: number;
    type: MessageType | string;
    openid: string;
    content: string;
    mediaId?: string;
    status: number;
    remark?: string;
    createTime?: Date;
    sendFrom?: number;
    userId?: number;
    event?: string;
    eventKey?: string;
    mediaUrl?: string;
    recognition?: string;
    url?: string;
    title?: string;
    label?: string;
    locationX?: number;
    locationY?: number;
    thumbMediaUrl?: string;
    musicUrl?: string;
    hqMusicUrl?: string;
    description?: string;
    articles?: any[];
  }
 
  /** 发送消息请求 */
  export interface MessageSendRequestVO {
    accountId: number;
    openid: string;
    type: MessageType;
    content: string;
    mediaId?: string;
  }
}
 
/** 查询消息列表 */
export function getMessagePage(params: PageParam) {
  return requestClient.get<PageResult<MpMessageApi.Message>>(
    '/mp/message/page',
    {
      params,
    },
  );
}
 
/** 发送消息 */
export function sendMessage(data: MpMessageApi.MessageSendRequestVO) {
  return requestClient.post('/mp/message/send', data);
}