liu
2026-09-30 91491239c5d4611b5b1404a7abeb2bb23d0edad5
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
package cn.iocoder.yudao.module.wxcp.service.push;
 
import cn.iocoder.yudao.module.wxcp.controller.admin.vo.WxCpPushResultVO;
 
/**
 * 企业微信消息推送 Service 接口
 *
 * 抽出来供活动、通知等业务复用,避免各处重复拼装接收者与错误处理
 *
 * @author 超级管理员
 */
public interface WxCpMessagePushService {
 
    /**
     * 推送文本卡片消息
     *
     * @param title       卡片标题
     * @param description 卡片正文
     * @param url         点击按钮跳转地址,textcard 类型必填
     * @param btnTxt      按钮文案
     * @param scope       推送范围,见 {@link cn.iocoder.yudao.module.wxcp.enums.activity.WxCpPushScopeEnum}
     * @param target      推送目标;范围是全员时可传空
     * @return 推送结果(不抛异常,失败信息通过返回值给出)
     */
    WxCpPushResultVO pushCard(String title, String description, String url,
                             String btnTxt, Integer scope, String target);
 
    /**
     * 推送纯文本消息
     *
     * @param content 文本内容
     * @param scope   推送范围
     * @param target  推送目标
     * @return 推送结果
     */
    WxCpPushResultVO pushText(String content, Integer scope, String target);
 
}