Browse Source

# 短信即时推送接口开发(api)

zhongwei
haungxing 1 year ago
parent
commit
1722c001c0
  1. 3
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/constants/XxlJobConstants.java
  2. 72
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/SmsImmediatelyPushDTO.java
  3. 10
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
  4. 5
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java

3
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";
}

72
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<String,String> params;
}

10
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<Boolean> sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request);
/**
* 发送即时推送短信消息
* @param smsImmediatelyPushDTO 即时推送短信消息体
* @return
*/
@PostMapping(SEND_SMS_IMMEDIATELY_MSG)
R<Boolean> sendSmsImmediatelyMsg(@RequestBody SmsImmediatelyPushDTO smsImmediatelyPushDTO);
}

5
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<Boolean> sendAppAndWsMsgByUsers(BusinessMessageDTO request) {
return R.fail("调用失败!");
}
@Override
public R<Boolean> sendSmsImmediatelyMsg(SmsImmediatelyPushDTO smsImmediatelyPushDTO) {
return R.fail("调用失败!");
}
}

Loading…
Cancel
Save