Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
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
徐少华
midjourney-proxy
Commits
7c155e22
Commit
7c155e22
authored
May 13, 2020
by
郑永强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【1002900】消息提醒已读状态接口优化
parent
f5c94d91
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
CultivateNotifyBizImpl.java
...cloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
+3
-1
CultivateNotifySendDao.java
...com/pcloud/book/cultivate/dao/CultivateNotifySendDao.java
+2
-0
CultivateNotifySendDaoImpl.java
...d/book/cultivate/dao/impl/CultivateNotifySendDaoImpl.java
+7
-0
CultivateNotifySend.xml
...c/main/resources/mapper/cultivate/CultivateNotifySend.xml
+8
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
View file @
7c155e22
...
...
@@ -112,7 +112,9 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
CultivateNotify
byId
=
cultivateNotifyDao
.
getById
(
messageId
);
notifyDTO
.
setMessageType
(
byId
.
getMessageType
());
notifyDTO
.
setTitle
(
byId
.
getTitle
());
cultivateNotifySendDao
.
updateIsRead
(
wechatUserId
,
messageId
);
// cultivateNotifySendDao.updateIsRead(wechatUserId,messageId);
// 更新之前的所有未读消息都不显示到主页
cultivateNotifySendDao
.
updateShowHome
(
wechatUserId
);
return
notifyDTO
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dao/CultivateNotifySendDao.java
View file @
7c155e22
...
...
@@ -13,6 +13,8 @@ public interface CultivateNotifySendDao extends BaseDao<CultivateNotifySend> {
void
updateIsRead
(
Long
wechatUserId
,
Long
messageId
);
void
updateShowHome
(
Long
wechatUserId
);
List
<
CultivateNotifyTypeDTO
>
getNotify4Type
(
Long
wechatUserId
);
List
<
CultivateNotifyDTO
>
getNotifyListByType
(
Long
wechatUserId
,
Integer
messageType
,
Integer
currentPage
,
Integer
numPerPage
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dao/impl/CultivateNotifySendDaoImpl.java
View file @
7c155e22
...
...
@@ -28,6 +28,13 @@ public class CultivateNotifySendDaoImpl extends BaseDaoImpl<CultivateNotifySend>
}
@Override
public
void
updateShowHome
(
Long
wechatUserId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
super
.
getSessionTemplate
().
update
(
getStatement
(
"updateShowHome"
),
map
);
}
@Override
public
List
<
CultivateNotifyTypeDTO
>
getNotify4Type
(
Long
wechatUserId
)
{
return
super
.
getSessionTemplate
().
selectList
(
getStatement
(
"getNotify4Type"
),
wechatUserId
);
}
...
...
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifySend.xml
View file @
7c155e22
...
...
@@ -27,6 +27,7 @@
message_id,
message_type,
is_read,
show_home,
create_time,
update_time
)
...
...
@@ -39,6 +40,7 @@
#{item.messageId},
#{item.messageType},
0,
1,
NOW(),
NOW()
)
...
...
@@ -48,7 +50,7 @@
<select
id=
"getFirstNoReadNotify"
parameterType=
"Long"
resultType=
"Long"
>
select message_id messageId from cultivate_notify_send
where wechat_user_id=#{wechatUserId}
and is_read=0
and is_read=0
AND show_home=1
order by create_time desc limit 1
</select>
...
...
@@ -78,6 +80,11 @@
and message_id=#{messageId}
</update>
<update
id=
"updateShowHome"
parameterType=
"map"
>
update cultivate_notify_send set show_home=0,update_time=now()
where wechat_user_id=#{wechatUserId} AND show_home=1
</update>
<select
id=
"getNotify4Type"
resultType=
"com.pcloud.book.cultivate.dto.CultivateNotifyTypeDTO"
>
select message_type messageType ,MAX(create_time) firstNoReadDate ,count(1) noReadCounts from cultivate_notify_send
where is_read=0
...
...
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