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
a5e35f97
Commit
a5e35f97
authored
Nov 12, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store teamId in user
parent
6ced0452
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
CTFApplication.java
.../java/com/telephoners/krakyournet/ctf/CTFApplication.java
+3
-3
User.java
...main/java/com/telephoners/krakyournet/ctf/beans/User.java
+5
-10
No files found.
service/src/main/java/com/telephoners/krakyournet/ctf/CTFApplication.java
View file @
a5e35f97
...
@@ -76,11 +76,11 @@ public class CTFApplication extends Application<ApplicationConfiguration>
...
@@ -76,11 +76,11 @@ public class CTFApplication extends Application<ApplicationConfiguration>
team
.
setName
(
"asdf"
);
team
.
setName
(
"asdf"
);
team
.
setDescription
(
"sadf"
);
team
.
setDescription
(
"sadf"
);
User
user
=
new
User
();
User
user
=
new
User
();
user
.
setName
(
"asdf"
);
user
.
setEmail
(
"asdfht"
);
user
.
setPassword
(
"asdf"
);
user
.
setPassword
(
"asdf"
);
user
.
setAdmin
(
false
);
user
.
setAdmin
(
false
);
user
.
setTeam
(
team
);
user
.
setName
(
"dfdf"
);
user
.
setEmail
(
"hgfd"
);
user
.
setTeamId
(
team
.
getId
());
Repository
<
Team
>
teamRepository
=
injector
.
getInstance
(
Key
.
get
(
new
TypeLiteral
<
Repository
<
Team
>>(){}));
Repository
<
Team
>
teamRepository
=
injector
.
getInstance
(
Key
.
get
(
new
TypeLiteral
<
Repository
<
Team
>>(){}));
Repository
<
User
>
userRepository
=
injector
.
getInstance
(
Key
.
get
(
new
TypeLiteral
<
Repository
<
User
>>(){}));
Repository
<
User
>
userRepository
=
injector
.
getInstance
(
Key
.
get
(
new
TypeLiteral
<
Repository
<
User
>>(){}));
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/beans/User.java
View file @
a5e35f97
package
com
.
telephoners
.
krakyournet
.
ctf
.
beans
;
package
com
.
telephoners
.
krakyournet
.
ctf
.
beans
;
import
org.ektorp.docref.DocumentReferences
;
import
org.ektorp.support.CouchDbDocument
;
import
org.ektorp.support.CouchDbDocument
;
//todo: use CouchDbDocument
//todo: implement principal
//todo: implement principal
public
class
User
extends
CouchDbDocument
public
class
User
extends
CouchDbDocument
{
{
...
@@ -11,10 +9,7 @@ public class User extends CouchDbDocument
...
@@ -11,10 +9,7 @@ public class User extends CouchDbDocument
private
String
password
;
private
String
password
;
private
String
email
;
private
String
email
;
private
boolean
admin
=
false
;
private
boolean
admin
=
false
;
private
String
teamId
;
//todo: better references
@DocumentReferences
//todo: important! doesnot work
private
Team
team
;
public
String
getName
()
public
String
getName
()
{
{
...
@@ -56,13 +51,13 @@ public class User extends CouchDbDocument
...
@@ -56,13 +51,13 @@ public class User extends CouchDbDocument
this
.
admin
=
admin
;
this
.
admin
=
admin
;
}
}
public
Team
getTeam
()
public
String
getTeamId
()
{
{
return
team
;
return
team
Id
;
}
}
public
void
setTeam
(
Team
team
)
public
void
setTeam
Id
(
String
teamId
)
{
{
this
.
team
=
team
;
this
.
team
Id
=
teamId
;
}
}
}
}
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