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

Commit aca96511 authored by jiangxiulong's avatar jiangxiulong

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

parent d23e8361
package com.liquidnet.service.sweet.service; package com.liquidnet.service.sweet.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.sweet.entity.SweetAppletSubMsg; import com.liquidnet.service.sweet.entity.SweetAppletSubMsg;
import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* <p> * <p>
...@@ -16,7 +16,7 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> { ...@@ -16,7 +16,7 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> {
ResponseDto sendMsg(Integer type, String targetId); 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); ResponseDto<Boolean> create(String openId, String templateId, String targetId, Integer appletType, Integer activityType);
......
...@@ -2,11 +2,12 @@ package com.liquidnet.service.sweet.entity; ...@@ -2,11 +2,12 @@ package com.liquidnet.service.sweet.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* 小程序订阅消息记录表 * 小程序订阅消息记录表
...@@ -17,7 +18,7 @@ import lombok.EqualsAndHashCode; ...@@ -17,7 +18,7 @@ import lombok.EqualsAndHashCode;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
public class SweetAppletSubMsg implements Serializable { public class SweetAppletSubMsg implements Serializable, Cloneable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -69,5 +70,14 @@ public class SweetAppletSubMsg implements Serializable { ...@@ -69,5 +70,14 @@ public class SweetAppletSubMsg implements Serializable {
*/ */
private LocalDateTime updatedAt; 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 { ...@@ -31,7 +31,11 @@ public class SweetAppletSubMsgController {
private SweetAppletSubMsgServiceImpl subMsgService; private SweetAppletSubMsgServiceImpl subMsgService;
@GetMapping("send") @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( public ResponseDto send(
@RequestParam Integer type, @RequestParam Integer type,
@RequestParam String targetId @RequestParam String targetId
...@@ -40,13 +44,18 @@ public class SweetAppletSubMsgController { ...@@ -40,13 +44,18 @@ public class SweetAppletSubMsgController {
} }
@PostMapping("sendOfMid") @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( public ResponseDto sendOfMid(
@RequestParam Integer type,
@RequestParam String midList, @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