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
9a77c9aa
Commit
9a77c9aa
authored
7 years ago
by
Daniel Gerhardt
Browse files
Options
Downloads
Patches
Plain Diff
Add /user/{id}/roomHistory endpoint for adding new entries
parent
c4b87459
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/controller/UserController.java
+12
-1
12 additions, 1 deletion
src/main/java/de/thm/arsnova/controller/UserController.java
with
12 additions
and
1 deletion
src/main/java/de/thm/arsnova/controller/UserController.java
+
12
−
1
View file @
9a77c9aa
...
@@ -2,7 +2,9 @@ package de.thm.arsnova.controller;
...
@@ -2,7 +2,9 @@ package de.thm.arsnova.controller;
import
de.thm.arsnova.entities.LoginCredentials
;
import
de.thm.arsnova.entities.LoginCredentials
;
import
de.thm.arsnova.entities.UserProfile
;
import
de.thm.arsnova.entities.UserProfile
;
import
de.thm.arsnova.services.RoomService
;
import
de.thm.arsnova.services.UserService
;
import
de.thm.arsnova.services.UserService
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -12,12 +14,15 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -12,12 +14,15 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
UserController
.
REQUEST_MAPPING
)
@RequestMapping
(
UserController
.
REQUEST_MAPPING
)
public
class
UserController
extends
AbstractEntityController
<
UserProfile
>
{
public
class
UserController
extends
AbstractEntityController
<
UserProfile
>
{
protected
static
final
String
REQUEST_MAPPING
=
"/user"
;
protected
static
final
String
REQUEST_MAPPING
=
"/user"
;
private
static
final
String
ROOM_HISTORY_MAPPING
=
DEFAULT_ID_MAPPING
+
"/roomHistory"
;
private
UserService
userService
;
private
UserService
userService
;
private
RoomService
roomService
;
public
UserController
(
final
UserService
userService
)
{
public
UserController
(
final
UserService
userService
,
final
RoomService
roomService
)
{
super
(
userService
);
super
(
userService
);
this
.
userService
=
userService
;
this
.
userService
=
userService
;
this
.
roomService
=
roomService
;
}
}
@Override
@Override
...
@@ -29,4 +34,10 @@ public class UserController extends AbstractEntityController<UserProfile> {
...
@@ -29,4 +34,10 @@ public class UserController extends AbstractEntityController<UserProfile> {
public
void
register
(
@RequestBody
LoginCredentials
loginCredentials
)
{
public
void
register
(
@RequestBody
LoginCredentials
loginCredentials
)
{
userService
.
create
(
loginCredentials
.
getLoginId
(),
loginCredentials
.
getPassword
());
userService
.
create
(
loginCredentials
.
getLoginId
(),
loginCredentials
.
getPassword
());
}
}
@PostMapping
(
ROOM_HISTORY_MAPPING
)
public
void
postRoomHistoryEntry
(
@PathVariable
final
String
id
,
@RequestBody
final
UserProfile
.
RoomHistoryEntry
roomHistoryEntry
)
{
userService
.
addRoomToHistory
(
userService
.
get
(
id
),
roomService
.
get
(
roomHistoryEntry
.
getRoomId
()));
}
}
}
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