Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
1d7f74fd
Commit
1d7f74fd
authored
Aug 13, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
圈子消息通知-插入
parent
67864f98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
NotificationService.java
...java/com/tanpu/community/service/NotificationService.java
+12
-8
No files found.
community-service/src/main/java/com/tanpu/community/service/NotificationService.java
View file @
1d7f74fd
...
@@ -14,7 +14,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -14,7 +14,6 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
import
java.util.TreeSet
;
@Service
@Service
public
class
NotificationService
{
public
class
NotificationService
{
...
@@ -25,20 +24,21 @@ public class NotificationService {
...
@@ -25,20 +24,21 @@ public class NotificationService {
@Autowired
@Autowired
private
UuidGenHelper
uuidGenHelper
;
private
UuidGenHelper
uuidGenHelper
;
@Transactional
public
void
insert
(
String
operatorId
,
String
notifierId
,
NotificationTypeEnum
type
,
String
targetId
,
String
content
){
public
void
insert
(
String
operatorId
,
String
notifierId
,
NotificationTypeEnum
type
,
String
targetId
,
String
content
){
NotificationEntity
.
builder
().
operatorId
(
operatorId
)
NotificationEntity
entity
=
NotificationEntity
.
builder
().
operatorId
(
operatorId
)
.
notificationId
(
uuidGenHelper
.
getUuidStr
())
.
notificationId
(
uuidGenHelper
.
getUuidStr
())
.
notifiedUserId
(
notifierId
)
.
notifiedUserId
(
notifierId
)
.
messageType
(
type
.
getCode
())
.
messageType
(
type
.
getCode
())
.
content
(
content
)
.
content
(
content
)
.
operatorId
(
targetId
).
build
();
.
operatorId
(
targetId
).
build
();
insert
(
entity
);
}
}
@Transactional
public
void
insertForward
(
String
operatorId
,
String
notifierId
,
String
themeId
,
String
topicId
,
String
text
){
public
void
insertForward
(
String
operatorId
,
String
notifierId
,
String
themeId
,
String
topicId
,
String
text
){
NotificationForwardDO
forwardDO
=
NotificationForwardDO
.
builder
().
topicId
(
topicId
).
content
(
text
).
build
();
NotificationForwardDO
forwardDO
=
NotificationForwardDO
.
builder
().
topicId
(
topicId
).
content
(
text
).
build
();
NotificationEntity
.
builder
().
operatorId
(
operatorId
)
NotificationEntity
entity
=
NotificationEntity
.
builder
().
operatorId
(
operatorId
)
.
notificationId
(
uuidGenHelper
.
getUuidStr
())
.
notificationId
(
uuidGenHelper
.
getUuidStr
())
.
notifiedUserId
(
notifierId
)
.
notifiedUserId
(
notifierId
)
.
messageType
(
NotificationTypeEnum
.
LIKE
.
getCode
())
.
messageType
(
NotificationTypeEnum
.
LIKE
.
getCode
())
...
@@ -46,11 +46,11 @@ public class NotificationService {
...
@@ -46,11 +46,11 @@ public class NotificationService {
.
operatorId
(
operatorId
)
.
operatorId
(
operatorId
)
.
targetId
(
themeId
)
.
targetId
(
themeId
)
.
build
();
.
build
();
insert
(
entity
);
}
}
@Transactional
public
void
insertLike
(
String
operatorId
,
String
notifierId
,
String
targetId
){
public
void
insertLike
(
String
operatorId
,
String
notifierId
,
String
targetId
){
NotificationEntity
entity
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>()
NotificationEntity
entity
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>()
.
eq
(
NotificationEntity:
:
getMessageType
,
NotificationTypeEnum
.
LIKE
.
getCode
())
.
eq
(
NotificationEntity:
:
getMessageType
,
NotificationTypeEnum
.
LIKE
.
getCode
())
...
@@ -73,9 +73,13 @@ public class NotificationService {
...
@@ -73,9 +73,13 @@ public class NotificationService {
.
operatorId
(
operatorId
)
.
operatorId
(
operatorId
)
.
build
();
.
build
();
}
}
insert
(
entity
);
}
}
@Transactional
public
void
insert
(
NotificationEntity
entity
){
notificationMapper
.
insert
(
entity
);
}
public
NotificationEntity
queryById
(
String
notificationId
){
public
NotificationEntity
queryById
(
String
notificationId
){
...
...
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