Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grzegorz
CTF
Commits
82ea409c
Commit
82ea409c
authored
Mar 19, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
team solutions endpoint improved
parent
49cd7aab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
SolutionsRepository.java
...ers/krakyournet/ctf/repositories/SolutionsRepository.java
+3
-2
SolutionsResource.java
...ephoners/krakyournet/ctf/resources/SolutionsResource.java
+2
-2
No files found.
service/src/main/java/com/telephoners/krakyournet/ctf/repositories/SolutionsRepository.java
View file @
82ea409c
...
@@ -27,8 +27,9 @@ public class SolutionsRepository implements Repository
...
@@ -27,8 +27,9 @@ public class SolutionsRepository implements Repository
//todo: do not add if already exists
//todo: do not add if already exists
}
}
public
void
getByTeam
(
Team
team
)
public
List
<
Solution
>
getByTeam
(
Team
team
)
{
{
//todo: merge with upper
return
datastore
.
createQuery
(
Solution
.
class
).
filter
(
"team"
,
team
).
asList
();
}
}
}
}
\ No newline at end of file
service/src/main/java/com/telephoners/krakyournet/ctf/resources/SolutionsResource.java
View file @
82ea409c
...
@@ -52,10 +52,10 @@ public class SolutionsResource
...
@@ -52,10 +52,10 @@ public class SolutionsResource
@GET
@GET
@Path
(
"/my"
)
@Path
(
"/my"
)
public
void
getTeamSolutions
(
@Auth
User
user
)
public
List
<
Solution
>
getTeamSolutions
(
@Auth
User
user
)
{
{
Optional
<
Team
>
team
=
teamsRepository
.
getTeamByUser
(
user
);
Optional
<
Team
>
team
=
teamsRepository
.
getTeamByUser
(
user
);
solutionsRepository
.
getByTeam
(
team
.
get
())
return
solutionsRepository
.
getByTeam
(
team
.
get
());
//todo: per task
}
}
@GET
@GET
...
...
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