记得上下班打卡 | git大法好,push需谨慎

Commit aca96511 authored by jiangxiulong's avatar jiangxiulong

优化发送订阅消息接口;演出时间状态判断提出来;演出数据参数提出来;

parent d23e8361
package com.liquidnet.service.sweet.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.sweet.entity.SweetAppletSubMsg;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
......@@ -16,7 +16,7 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> {
ResponseDto sendMsg(Integer type, String targetId);
ResponseDto sendOfMid(Integer type, String midList, String targetId);
ResponseDto sendOfMid(String midList, String targetId, Integer timeType);
ResponseDto<Boolean> create(String openId, String templateId, String targetId, Integer appletType, Integer activityType);
......
......@@ -2,11 +2,12 @@ package com.liquidnet.service.sweet.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 小程序订阅消息记录表
......@@ -17,7 +18,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class SweetAppletSubMsg implements Serializable {
public class SweetAppletSubMsg implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
......@@ -69,5 +70,14 @@ public class SweetAppletSubMsg implements Serializable {
*/
private LocalDateTime updatedAt;
private static final SweetAppletSubMsg obj = new SweetAppletSubMsg();
public static SweetAppletSubMsg getNew() {
try {
return (SweetAppletSubMsg) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetAppletSubMsg();
}
}
}
......@@ -31,7 +31,11 @@ public class SweetAppletSubMsgController {
private SweetAppletSubMsgServiceImpl subMsgService;
@GetMapping("send")
@ApiOperation("发送模版消息")
@ApiOperation("发送模版消息 定时任务使用")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "活动类型", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "targetId", value = "演出ID", required = true),
})
public ResponseDto send(
@RequestParam Integer type,
@RequestParam String targetId
......@@ -40,13 +44,18 @@ public class SweetAppletSubMsgController {
}
@PostMapping("sendOfMid")
@ApiOperation("发送模版消息OfMid")
@ApiOperation("发送模版消息OfMid, 特殊情况手动调用使用")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "String", name = "midList", value = "mid列表逗号分割", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "targetId", value = "演出ID"),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "timeType", value = "是否判断演出时间 1判断 2不判断"),
})
public ResponseDto sendOfMid(
@RequestParam Integer type,
@RequestParam String midList,
@RequestParam String targetId
@RequestParam(defaultValue = "") String targetId,
@RequestParam(defaultValue = "1") Integer timeType
) {
return subMsgService.sendOfMid(type, midList, targetId);
return subMsgService.sendOfMid(midList, targetId, timeType);
}
// 一次订阅 可以多次发 直到用户取消订阅 所以正规做法应该是记录订阅模版 不关联任何推送数据 等推送的时候查是否订阅某模版
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment