Package org.vrspace.server.api
Class Data
java.lang.Object
org.vrspace.server.api.ApiBase
org.vrspace.server.api.ClientControllerBase
org.vrspace.server.api.Data
@RestController
@RequestMapping("/vrspace/api/user-data")
public class Data
extends ClientControllerBase
Adds custom data to the user. These are simple key-value pairs, strings only.
User has to be logged in and connected to use any of these methods, or else.
- Author:
- joe
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearUserData
(jakarta.servlet.http.HttpSession session) Delete all user data belonging to the client.void
deleteUserData
(String key, jakarta.servlet.http.HttpSession session) Delete a value for the given key.org.springframework.http.ResponseEntity<UserData>
getUserData
(String key, jakarta.servlet.http.HttpSession session) Get user data for the keylistUserData
(jakarta.servlet.http.HttpSession session) List all user data belonging to the client.org.springframework.http.ResponseEntity<Void>
setUserData
(UserData data, jakarta.servlet.http.HttpSession session) Add or replace existing user data.Methods inherited from class org.vrspace.server.api.ClientControllerBase
findClient, findClient, getAuthorisedClient, getAuthorisedClient, isAuthenticated
Methods inherited from class org.vrspace.server.api.ApiBase
currentUserName, isAuthenticated
-
Field Details
-
PATH
- See Also:
-
-
Constructor Details
-
Data
public Data()
-
-
Method Details
-
listUserData
List all user data belonging to the client. -
setUserData
@PostMapping public org.springframework.http.ResponseEntity<Void> setUserData(@RequestBody UserData data, jakarta.servlet.http.HttpSession session) Add or replace existing user data.- Parameters:
data
- the key-value pair.
-
clearUserData
@DeleteMapping public void clearUserData(jakarta.servlet.http.HttpSession session) Delete all user data belonging to the client. -
deleteUserData
@DeleteMapping("/{key}") public void deleteUserData(@PathVariable String key, jakarta.servlet.http.HttpSession session) Delete a value for the given key. -
getUserData
@GetMapping("/{key}") public org.springframework.http.ResponseEntity<UserData> getUserData(@PathVariable String key, jakarta.servlet.http.HttpSession session) Get user data for the key- Parameters:
key
- specifies which value to get
-