Browse Source

# 消息推送修改api

zhongwei
haungxing 2 years ago
parent
commit
0977322e80
  1. 20
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java
  2. 5
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/config/MessageTemplateEntity.java
  3. 5
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
  4. 6
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java

20
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java

@ -14,6 +14,7 @@ import org.springblade.core.mp.support.SqlCondition;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Data @Data
@ -22,6 +23,13 @@ import java.time.LocalDateTime;
@EqualsAndHashCode @EqualsAndHashCode
public class MessagePushRecordEntity extends MessageTemplateEntity { public class MessagePushRecordEntity extends MessageTemplateEntity {
@ApiModelProperty("站点编码")
@QueryField(condition = SqlCondition.EQUAL)
private String stationCode;
@ApiModelProperty("站点名称")
private String stationName;
@ApiModelProperty("业务任务ID") @ApiModelProperty("业务任务ID")
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
private Long taskId; private Long taskId;
@ -66,4 +74,16 @@ public class MessagePushRecordEntity extends MessageTemplateEntity {
@ApiModelProperty(value = "响应说明") @ApiModelProperty(value = "响应说明")
private String respondRemark; private String respondRemark;
@ApiModelProperty("查询开始时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@TableField(exist = false)
private LocalDate startTime;
@ApiModelProperty("查询结束时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@TableField(exist = false)
private LocalDate endTime;
} }

5
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/config/MessageTemplateEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzims.message.entity.config; package com.hnac.hzims.message.entity.config;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -51,4 +52,8 @@ public class MessageTemplateEntity extends TenantEntity implements Serializable
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
private String advanceTimeUnit; private String advanceTimeUnit;
@TableField(exist = false)
@ApiModelProperty(value = "创建人名称")
private String creatorName;
} }

5
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java

@ -3,6 +3,7 @@ package com.hnac.hzims.message.fegin;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.PushDto; import com.hnac.hzims.message.dto.PushDto;
import com.hnac.hzims.message.dto.SmsPushDto; import com.hnac.hzims.message.dto.SmsPushDto;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
public interface IMessageClient { public interface IMessageClient {
String API_PREFIX = "/feign/message"; String API_PREFIX = "/feign/message";
String SEND_SMS_MESSAGE = API_PREFIX + "/send-sms-message"; String SEND_SMS_MESSAGE = API_PREFIX + "/send-sms-message";
String SEND_MESSAGE = API_PREFIX + "/sendMessage";
/** /**
* 推送消息短信 * 推送消息短信
* @param pushDto * @param pushDto
@ -25,4 +27,7 @@ public interface IMessageClient {
*/ */
@PostMapping(SEND_SMS_MESSAGE) @PostMapping(SEND_SMS_MESSAGE)
R sendSmsMessage(SmsPushDto pushDto); R sendSmsMessage(SmsPushDto pushDto);
@PostMapping(SEND_MESSAGE)
R<Boolean> sendMessage(@RequestBody MessagePushRecordEntity request);
} }

6
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java

@ -2,6 +2,7 @@ package com.hnac.hzims.message.fegin;
import com.hnac.hzims.message.dto.PushDto; import com.hnac.hzims.message.dto.PushDto;
import com.hnac.hzims.message.dto.SmsPushDto; import com.hnac.hzims.message.dto.SmsPushDto;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -15,4 +16,9 @@ public class MessageClientFallback implements IMessageClient {
public R sendSmsMessage(SmsPushDto pushDto) { public R sendSmsMessage(SmsPushDto pushDto) {
return R.fail("推送失败"); return R.fail("推送失败");
} }
@Override
public R<Boolean> sendMessage(MessagePushRecordEntity request) {
return R.fail("推送失败");
}
} }

Loading…
Cancel
Save