diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/constants/XxlJobConstants.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/constants/XxlJobConstants.java index 76a8a92..f87de5d 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/constants/XxlJobConstants.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/constants/XxlJobConstants.java @@ -12,4 +12,7 @@ public interface XxlJobConstants { /**消息中心消息按通知人分时段集中推送**/ String PUSH_MESSAGE_BY_NOTICE = "pushMessageByNotice"; + /**推送APP消息**/ + String PUSH_APP_MESSAGE = "pushAppMessage"; + } diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/SmsImmediatelyPushDTO.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/SmsImmediatelyPushDTO.java new file mode 100644 index 0000000..49e9c6d --- /dev/null +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/SmsImmediatelyPushDTO.java @@ -0,0 +1,72 @@ +package com.hnac.hzims.message.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Map; + +/** + * @ClassName SmsImmediatelyPushDTO + * @description: 短信即时推送请求内容 + * @author: hx + * @create: 2023-08-09 08:46 + * @Version 4.0 + **/ +@Data +@EqualsAndHashCode +@ApiModel("短信即时推送请求内容") +public class SmsImmediatelyPushDTO implements Serializable { + + @ApiModelProperty(value = "机构ID",required = true) + @NotNull(message = "机构ID不能为空") + private Long deptId; + + @ApiModelProperty("机构名称") + private String deptName; + + @ApiModelProperty(value = "业务关键字",required = true) + @NotNull(message = "业务关键字不能为空") + private String businessKey; + + @ApiModelProperty(value = "业务分类。系统通知:system,事务消息:business,日常提醒:dailyRemind,巡检消息:inspect",required = true) + @NotNull(message = "业务分类不能为空") + private String businessClassify; + + @ApiModelProperty("业务任务ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long taskId; + + @NotNull + @ApiModelProperty(value = "内容") + private String content; + + @NotNull + @ApiModelProperty(value = "主题") + private String subject; + + @NotNull + @ApiModelProperty(value = "推送用户") + private String pusher; + + @ApiModelProperty(value = "创建用户") + private Long createUser; + + @ApiModelProperty(value = "租户ID") + private String tenantId; + + @ApiModelProperty("短信推送资源编码") + @NotNull + private String resourceCode; + + @ApiModelProperty("短信推送填充内容") + @NotNull + private Map params; + + +} diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java index 887e97c..604eb39 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java @@ -27,6 +27,7 @@ public interface IMessageClient { String GET_TEMPLATE_BY_ID = API_PREFIX + "/getMsgTemplateById"; String PLAN_SEND_MESSAGE = API_PREFIX + "/planSendMessage"; String SEND_APP_AND_WS_MSG = API_PREFIX + "/sendAppAndWsMsgByUsers"; + String SEND_SMS_IMMEDIATELY_MSG = API_PREFIX + "/sendSmsImmediatelyMsg"; /** * 推送消息(短信) @@ -61,4 +62,13 @@ public interface IMessageClient { */ @PostMapping(value = SEND_APP_AND_WS_MSG,consumes = "application/json; charset=UTF-8") R sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request); + + + /** + * 发送即时推送短信消息 + * @param smsImmediatelyPushDTO 即时推送短信消息体 + * @return + */ + @PostMapping(SEND_SMS_IMMEDIATELY_MSG) + R sendSmsImmediatelyMsg(@RequestBody SmsImmediatelyPushDTO smsImmediatelyPushDTO); } diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java index 37f26e4..1044528 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java @@ -36,4 +36,9 @@ public class MessageClientFallback implements IMessageClient { public R sendAppAndWsMsgByUsers(BusinessMessageDTO request) { return R.fail("调用失败!"); } + + @Override + public R sendSmsImmediatelyMsg(SmsImmediatelyPushDTO smsImmediatelyPushDTO) { + return R.fail("调用失败!"); + } }