|
|
@@ -0,0 +1,92 @@
|
|
|
+package com.nb.app.msg.entity;
|
|
|
+
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
+import com.nb.core.entity.GenericEntity;
|
|
|
+import com.nb.app.msg.enums.MsgEnum;
|
|
|
+import io.swagger.annotations.ApiModel;
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.EqualsAndHashCode;
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
+import lombok.ToString;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author lifang
|
|
|
+ * @version 1.0.0
|
|
|
+ * @ClassName MsgEntity.java
|
|
|
+ * @Description TODO
|
|
|
+ * @createTime 2022年08月12日 09:39:00
|
|
|
+ */
|
|
|
+@EqualsAndHashCode(callSuper = true)
|
|
|
+@Data
|
|
|
+@TableName(value = "app_msg",autoResultMap = true)
|
|
|
+@ApiModel(value="消息表")
|
|
|
+@ToString
|
|
|
+@NoArgsConstructor
|
|
|
+public class AppMsgEntity extends GenericEntity<String> {
|
|
|
+ @ApiModelProperty(value = "消息主题")
|
|
|
+ private String title;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "消息类型")
|
|
|
+ private MsgEnum msgType;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "发送人id")
|
|
|
+ private String sender;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "发送人名称")
|
|
|
+ private String senderName;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "发送人id")
|
|
|
+ @JsonIgnoreProperties
|
|
|
+ private String patientName;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "发送人id")
|
|
|
+ @JsonIgnoreProperties
|
|
|
+ private String patientCode;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = " 患者id")
|
|
|
+ @JsonIgnoreProperties
|
|
|
+ private String patientId;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "负载 即申请id 、咨询id 等")
|
|
|
+ private String payload;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "接收人 即 医生id",required = true)
|
|
|
+ private String receiver;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "接收人名称 ",required = true)
|
|
|
+ private String receiverName;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "是否已读",required = true)
|
|
|
+ private boolean read;
|
|
|
+
|
|
|
+ @ApiModelProperty("扩展内容")
|
|
|
+ private String extend;
|
|
|
+
|
|
|
+ public String getSummary() {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public String getPatient() {
|
|
|
+ return StrUtil.isEmpty(patientName)?patientCode:patientName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getTitle() {
|
|
|
+ switch (msgType){
|
|
|
+ case CONSUL:
|
|
|
+ return getSenderName()+"发起疼痛:"+getExtend()+"咨询";
|
|
|
+ case REGISTER:
|
|
|
+ return "您已注册成功,默认密码为A123456,请及时更改";
|
|
|
+ case PAIN_CALL:
|
|
|
+ return getPatient()+"发起疼痛一键呼叫";
|
|
|
+ case CODE_BIND_NOTIFY:
|
|
|
+ return getSenderName()+"通过邀请码"+extend+"申请绑定";
|
|
|
+ case MANUAL_BIND_NOTIFY:
|
|
|
+ return getSenderName()+"发起用户绑定申请";
|
|
|
+ default: return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|