Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
John Samuel Ako Deutesfeld
ARSnova Backend
Commits
c1833a2d
Commit
c1833a2d
authored
7 years ago
by
Tom Käsler
Committed by
Daniel Gerhardt
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add FindQueryService for Comment
Currently supports finding comments by `roomId`. See !83.
parent
33e3c26e
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/services/CommentFindQueryService.java
+48
-0
48 additions, 0 deletions
...java/de/thm/arsnova/services/CommentFindQueryService.java
with
48 additions
and
0 deletions
src/main/java/de/thm/arsnova/services/CommentFindQueryService.java
0 → 100644
+
48
−
0
View file @
c1833a2d
/*
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2018 The ARSnova Team and Contributors
*
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package
de.thm.arsnova.services
;
import
de.thm.arsnova.entities.FindQuery
;
import
de.thm.arsnova.entities.Comment
;
import
org.springframework.stereotype.Service
;
import
java.util.HashSet
;
import
java.util.Set
;
@Service
public
class
CommentFindQueryService
implements
FindQueryService
<
Comment
>
{
private
CommentService
commentService
;
private
UserService
userService
;
public
CommentFindQueryService
(
final
CommentService
commentService
,
final
UserService
userService
)
{
this
.
commentService
=
commentService
;
this
.
userService
=
userService
;
}
@Override
public
Set
<
String
>
resolveQuery
(
final
FindQuery
<
Comment
>
findQuery
)
{
Set
<
String
>
ids
=
new
HashSet
<>();
if
(
findQuery
.
getProperties
().
getRoomId
()
!=
null
)
{
for
(
Comment
c
:
commentService
.
getByRoomId
(
findQuery
.
getProperties
().
getRoomId
(),
0
,
0
))
{
ids
.
add
(
c
.
getId
());
}
}
return
ids
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment