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

Commit 21943dd7 authored by jiangxiulong's avatar jiangxiulong

sweet 删除不要的接口

parent 6c5cde37
...@@ -67,8 +67,6 @@ public class SweetConstant { ...@@ -67,8 +67,6 @@ public class SweetConstant {
// public final static String REDIS_KEY_SWEET_COLLECTION_RESERVATION_USER = "sweet:collectionReservation:unionId:"; // public final static String REDIS_KEY_SWEET_COLLECTION_RESERVATION_USER = "sweet:collectionReservation:unionId:";
// 活动结束时间 // 活动结束时间
public final static String REDIS_KEY_SWEET_ACTIVITY_END_TIME = "sweet:activity:endTime:type:"; public final static String REDIS_KEY_SWEET_ACTIVITY_END_TIME = "sweet:activity:endTime:type:";
// 演出预约
public final static String REDIS_KEY_SWEET_PERFORM_SUBSCRIBE = "sweet:performSubscribe:openId:";
// 微信服务号用户相关 // 微信服务号用户相关
public final static String REDIS_KEY_SWEET_WECHAT_USERS_UNIONID = "sweet:user:service:unionId:"; public final static String REDIS_KEY_SWEET_WECHAT_USERS_UNIONID = "sweet:user:service:unionId:";
......
...@@ -22,5 +22,4 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> { ...@@ -22,5 +22,4 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> {
ResponseDto<Boolean> create(String openId, String unionId, String templateId, String targetId, Integer appletType, Integer activityType); ResponseDto<Boolean> create(String openId, String unionId, String templateId, String targetId, Integer appletType, Integer activityType);
ResponseDto<Integer> isSubPerform(String openId, String targetId);
} }
...@@ -96,18 +96,4 @@ public class SweetAppletSubMsgController { ...@@ -96,18 +96,4 @@ public class SweetAppletSubMsgController {
return subMsgService.create(openId, unionId, templateId, targetId, appletType, activityType); return subMsgService.create(openId, unionId, templateId, targetId, appletType, activityType);
} }
@PostMapping("isSubPerform")
@ApiOperation("是否预约演出")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "String", name = "openId", value = "对应小程序的openId", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "targetId", value = "演出id", required = true)
})
public ResponseDto<Integer> isSubPerform(
@RequestParam() String openId,
@RequestParam() String targetId
) {
return subMsgService.isSubPerform(openId, targetId);
}
} }
...@@ -149,7 +149,6 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM ...@@ -149,7 +149,6 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
// 发送订阅消息接口 // 发送订阅消息接口
boolean subMessage = sendSubMessage(info, targetId, title, timeStart); boolean subMessage = sendSubMessage(info, targetId, title, timeStart);
if (subMessage) { if (subMessage) {
redisActivityUtils.delSubscribe(info.getOpenId(), targetId);
msgIdList.add(msgId); msgIdList.add(msgId);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -206,7 +205,6 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM ...@@ -206,7 +205,6 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
// 发送订阅消息接口 // 发送订阅消息接口
boolean subMessage = sendSubMessage(info, targetId, title, timeStart); boolean subMessage = sendSubMessage(info, targetId, title, timeStart);
if (subMessage) { if (subMessage) {
redisActivityUtils.delSubscribe(info.getOpenId(), targetId);
msgIdList.add(msgId); msgIdList.add(msgId);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -243,17 +241,9 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM ...@@ -243,17 +241,9 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_REMIND_INSERT.getKey(), queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_REMIND_INSERT.getKey(),
SqlMapping.gets(sqls, sqlsDataA)); SqlMapping.gets(sqls, sqlsDataA));
redisActivityUtils.setSubscribe(openId, targetId);
return ResponseDto.success(); return ResponseDto.success();
} }
@Override
public ResponseDto<Integer> isSubPerform(String openId, String targetId) {
Integer subscribe = redisActivityUtils.getSubscribe(openId, targetId);
return ResponseDto.success(subscribe);
}
/** /**
* 微信小程序推送订阅消息 * 微信小程序推送订阅消息
*/ */
......
...@@ -35,6 +35,7 @@ public class RedisActivityUtils { ...@@ -35,6 +35,7 @@ public class RedisActivityUtils {
String redisKey = SweetConstant.REDIS_KEY_SWEET_ACTIVITY_END_TIME.concat(type); String redisKey = SweetConstant.REDIS_KEY_SWEET_ACTIVITY_END_TIME.concat(type);
redisUtil.set(redisKey, endTime); redisUtil.set(redisKey, endTime);
} }
public LocalDateTime getEndTime(String type) { public LocalDateTime getEndTime(String type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_ACTIVITY_END_TIME.concat(type); String redisKey = SweetConstant.REDIS_KEY_SWEET_ACTIVITY_END_TIME.concat(type);
Object obj = redisUtil.get(redisKey); Object obj = redisUtil.get(redisKey);
...@@ -47,32 +48,4 @@ public class RedisActivityUtils { ...@@ -47,32 +48,4 @@ public class RedisActivityUtils {
} }
} }
public void setSubscribe(String openId, String targetId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_PERFORM_SUBSCRIBE
.concat(openId)
.concat(":")
.concat(targetId);
redisUtil.set(redisKey, 1);
}
public Integer getSubscribe(String openId, String targetId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_PERFORM_SUBSCRIBE
.concat(openId)
.concat(":")
.concat(targetId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
} else {
return (Integer) obj;
}
}
public void delSubscribe(String openId, String targetId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_PERFORM_SUBSCRIBE
.concat(openId)
.concat(":")
.concat(targetId);
redisUtil.del(redisKey);
}
} }
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