【新增】SYSTEM: 发送微信小程序订阅消息

This commit is contained in:
puhui999
2024-07-23 17:46:41 +08:00
parent 02f4d3824e
commit 63e319e663
6 changed files with 128 additions and 27 deletions

View File

@ -1,9 +1,6 @@
package cn.iocoder.yudao.module.system.api.social;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxJsapiSignatureRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxQrcodeReqDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxSubscribeTemplateRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.*;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
import jakarta.validation.Valid;
@ -59,4 +56,11 @@ public interface SocialClientApi {
*/
List<SocialWxSubscribeTemplateRespDTO> getSubscribeTemplate();
/**
* 发送订阅消息
*
* @param reqDTO 请求
*/
void sendSubscribeMessage(SocialWxSubscribeMessageReqDTO reqDTO);
}

View File

@ -0,0 +1,70 @@
package cn.iocoder.yudao.module.system.api.social.dto;
import cn.iocoder.yudao.framework.common.core.KeyValue;
import lombok.Data;
import java.util.List;
/**
* 微信小程序订阅消息 Request DTO
*
* @author HUIHUI
*/
@Data
public class SocialWxSubscribeMessageReqDTO {
/**
* 接收者(用户)的 openid.
* <pre>
* 参数touser
* 是否必填: 是
* 描述: 接收者(用户)的 openid
* </pre>
*/
private String toUser;
/**
* 所需下发的模板消息的id.
* <pre>
* 参数template_id
* 是否必填: 是
* 描述: 所需下发的模板消息的id
* </pre>
*/
private String templateId;
/**
* 点击模板卡片后的跳转页面,仅限本小程序内的页面.
* <pre>
* 参数page
* 是否必填: 否
* 描述: 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,示例index?foo=bar。该字段不填则模板无跳转。
* </pre>
*/
private String page;
/**
* 跳转小程序类型developer为开发版trial为体验版formal为正式版默认为正式版
*
* 枚举 WxMaConstants.MiniProgramState
*/
private String miniprogramState;
/**
* 进入小程序查看的语言类型支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文)默认为zh_CN
*
* 枚举 WxMaConstants.MiniProgramLang
*/
private String lang;
/**
* 模板内容,不填则下发空模板.
* <pre>
* 参数data
* 是否必填: 是
* 描述: 模板内容,不填则下发空模板
* </pre>
*/
private List<KeyValue<String, String>> data;
}

View File

@ -122,6 +122,7 @@ public interface ErrorCodeConstants {
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_PHONE_CODE_ERROR = new ErrorCode(1_002_018_200, "获得手机号失败");
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_QRCODE_ERROR = new ErrorCode(1_002_018_201, "获得小程序码失败");
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_SUBSCRIBE_TEMPLATE_ERROR = new ErrorCode(1_002_018_202, "获得小程序订阅消息模版失败");
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_SUBSCRIBE_MESSAGE_ERROR = new ErrorCode(1_002_018_203, "发送小程序订阅消息失败");
ErrorCode SOCIAL_CLIENT_NOT_EXISTS = new ErrorCode(1_002_018_210, "社交客户端不存在");
ErrorCode SOCIAL_CLIENT_UNIQUE = new ErrorCode(1_002_018_211, "社交客户端已存在配置");