feat:极光推送
This commit is contained in:
1 parent
122160ba8d
commit
df1eeef0d0
45 files changed
+2157
-90
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.push;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 推送通知类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPushBizTypeEnum {
|
||||
MCH_PUSH("1", "商户用餐提醒推送"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
private final String type;
|
||||
|
||||
private final String description;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.push;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 推送通知类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPushInformTypeEnum {
|
||||
|
||||
DAY(1, "每天"),
|
||||
MONTH(2, "每月");
|
||||
|
||||
@EnumValue
|
||||
private final Integer type;
|
||||
|
||||
private final String description;
|
||||
}
|
||||
|
||||
+2
@@ -13,4 +13,6 @@ public class JgPusDto {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private List<String> tagList;
|
||||
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import com.bsd.pjcloud.thirdparty.constant.push.ThirdPushInformTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 推送配置
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("third_push_conf")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "推送配置")
|
||||
public class ThirdPushConfEntity extends Model<ThirdPushConfEntity> {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "业务id")
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "通知标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "通知内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "是否开启")
|
||||
private String enable;
|
||||
|
||||
@Schema(description = "通知类型:每天、每月")
|
||||
private Integer informType;
|
||||
|
||||
@Schema(description = "通知时间")
|
||||
private LocalTime informTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 生成对应的 cron 表达式(Quartz)
|
||||
* <p>
|
||||
* informType=DAY:每天指定时间触发
|
||||
* informType=MONTH:每月 1 号指定时间触发
|
||||
*/
|
||||
public String buildCron() {
|
||||
if (informType == null || informTime == null) {
|
||||
return null;
|
||||
}
|
||||
int second = informTime.getSecond();
|
||||
int minute = informTime.getMinute();
|
||||
int hour = informTime.getHour();
|
||||
|
||||
if (ThirdPushInformTypeEnum.DAY.getType().equals(informType)) {
|
||||
return String.format("%d %d %d * * ?", second, minute, hour);
|
||||
}
|
||||
if (ThirdPushInformTypeEnum.MONTH.getType().equals(informType)) {
|
||||
return String.format("%d %d %d 1 * ?", second, minute, hour);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 推送通知批次记录
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("third_push_record")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "推送通知批次记录")
|
||||
public class ThirdPushRecordEntity extends Model<ThirdPushRecordEntity> {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "推送配置id")
|
||||
private Long confId;
|
||||
|
||||
@Schema(description = "推送批次号")
|
||||
private String batchNo;
|
||||
|
||||
@Schema(description = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "业务id")
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "通知标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "通知内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "通知类型:每天、每月")
|
||||
private Integer informType;
|
||||
|
||||
@Schema(description = "通知时间")
|
||||
private LocalTime informTime;
|
||||
|
||||
@Schema(description = "接收总人数")
|
||||
private Integer receiverCount;
|
||||
|
||||
@Schema(description = "成功人数")
|
||||
private Integer successCount;
|
||||
|
||||
@Schema(description = "失败人数")
|
||||
private Integer failCount;
|
||||
|
||||
@Schema(description = "发送时间")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@Schema(description = "批次状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "推送结果摘要")
|
||||
private String pushResult;
|
||||
|
||||
@Schema(description = "失败原因")
|
||||
private String errorMsg;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 推送通知用户明细记录
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("third_push_record_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "推送通知用户明细记录")
|
||||
public class ThirdPushRecordUserEntity extends Model<ThirdPushRecordUserEntity> {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "推送批次记录id")
|
||||
private Long recordId;
|
||||
|
||||
@Schema(description = "推送配置id")
|
||||
private Long confId;
|
||||
|
||||
@Schema(description = "推送批次号")
|
||||
private String batchNo;
|
||||
|
||||
@Schema(description = "接收用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "业务id")
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "发送时间")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@Schema(description = "发送状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "失败原因")
|
||||
private String errorMsg;
|
||||
|
||||
@Schema(description = "已读时间")
|
||||
private LocalDateTime readTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user