记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
d23e8361
Commit
d23e8361
authored
Feb 23, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记录订阅增加redis标识,增加是否预约接口
parent
915d5143
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
4 deletions
+55
-4
SweetConstant.java
...a/com/liquidnet/service/sweet/constant/SweetConstant.java
+2
-0
ISweetAppletSubMsgService.java
...dnet/service/sweet/service/ISweetAppletSubMsgService.java
+3
-1
SweetAppletSubMsgController.java
...service/sweet/controller/SweetAppletSubMsgController.java
+16
-3
SweetAppletSubMsgServiceImpl.java
...vice/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
+13
-0
RedisActivityUtils.java
...com/liquidnet/service/sweet/utils/RedisActivityUtils.java
+21
-0
No files found.
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/constant/SweetConstant.java
View file @
d23e8361
...
@@ -67,6 +67,8 @@ public class SweetConstant {
...
@@ -67,6 +67,8 @@ 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:"
;
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetAppletSubMsgService.java
View file @
d23e8361
...
@@ -16,7 +16,9 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> {
...
@@ -16,7 +16,9 @@ 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
<
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
);
ResponseDto
sendOfMid
(
Integer
type
,
String
midList
,
String
targetId
);
ResponseDto
<
Integer
>
isSubPerform
(
String
openId
,
String
targetId
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetAppletSubMsgController.java
View file @
d23e8361
...
@@ -56,10 +56,10 @@ public class SweetAppletSubMsgController {
...
@@ -56,10 +56,10 @@ public class SweetAppletSubMsgController {
@PostMapping
(
"create"
)
@PostMapping
(
"create"
)
@ApiOperation
(
"添加订阅记录"
)
@ApiOperation
(
"添加订阅记录"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"openId"
,
value
=
"openId"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"openId"
,
value
=
"
对应小程序的
openId"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"templateId"
,
value
=
"
templateId
多个用英文逗号分割"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"templateId"
,
value
=
"
模版消息ID,
多个用英文逗号分割"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"appletType"
,
value
=
"1草莓 2五百里 3mdsk 4正在 5跳飞船音乐节"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"appletType"
,
value
=
"
小程序类型
1草莓 2五百里 3mdsk 4正在 5跳飞船音乐节"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"activityType"
,
value
=
"活动类型"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"activityType"
,
value
=
"活动类型"
,
required
=
true
),
})
})
public
ResponseDto
<
Boolean
>
create
(
public
ResponseDto
<
Boolean
>
create
(
...
@@ -72,5 +72,18 @@ public class SweetAppletSubMsgController {
...
@@ -72,5 +72,18 @@ public class SweetAppletSubMsgController {
return
subMsgService
.
create
(
openId
,
templateId
,
targetId
,
appletType
,
activityType
);
return
subMsgService
.
create
(
openId
,
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
);
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
View file @
d23e8361
...
@@ -18,6 +18,7 @@ import com.liquidnet.service.sweet.mapper.SweetAppletSubMsgMapper;
...
@@ -18,6 +18,7 @@ import com.liquidnet.service.sweet.mapper.SweetAppletSubMsgMapper;
import
com.liquidnet.service.sweet.service.ISweetAppletSubMsgService
;
import
com.liquidnet.service.sweet.service.ISweetAppletSubMsgService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.service.sweet.utils.QueueUtils
;
import
com.liquidnet.service.sweet.utils.QueueUtils
;
import
com.liquidnet.service.sweet.utils.RedisActivityUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -54,6 +55,9 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -54,6 +55,9 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
@Autowired
@Autowired
private
QueueUtils
queueUtils
;
private
QueueUtils
queueUtils
;
@Autowired
private
RedisActivityUtils
redisActivityUtils
;
@Override
@Override
public
ResponseDto
sendMsg
(
Integer
type
,
String
targetId
)
{
public
ResponseDto
sendMsg
(
Integer
type
,
String
targetId
)
{
List
<
SweetAppletSubMsg
>
msgList
=
subMsgMapper
.
selectList
(
List
<
SweetAppletSubMsg
>
msgList
=
subMsgMapper
.
selectList
(
...
@@ -194,9 +198,18 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -194,9 +198,18 @@ 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
);
}
/**
/**
* 微信小程序推送订阅消息
* 微信小程序推送订阅消息
*/
*/
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/RedisActivityUtils.java
View file @
d23e8361
...
@@ -47,4 +47,25 @@ public class RedisActivityUtils {
...
@@ -47,4 +47,25 @@ 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
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment