Package org.vrspace.server.api
Class WorldController
- java.lang.Object
-
- org.vrspace.server.api.ApiBase
-
- org.vrspace.server.api.WorldController
-
@RestController @RequestMapping("/vrspace/api/worlds") public class WorldController extends ApiBase
World controller handles worlds-related operations. Currently only list and count users, publicly available. Eventually it should allow world creation and management for authorised users.- Author:
- joe
-
-
Constructor Summary
Constructors Constructor Description WorldController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<String>
createWorld(javax.servlet.http.HttpSession session, String worldName, String templateWorldName, boolean isPublic, boolean isTemporary)
Create a private world, the user must be authenticated.List<World>
list()
List<WorldStatus>
users()
-
Methods inherited from class org.vrspace.server.api.ApiBase
currentUserName
-
-
-
-
Field Detail
-
PATH
public static final String PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
users
@GetMapping("/users") public List<WorldStatus> users()
-
createWorld
@PostMapping("/create") public org.springframework.http.ResponseEntity<String> createWorld(javax.servlet.http.HttpSession session, @RequestParam(required=true) String worldName, String templateWorldName, boolean isPublic, boolean isTemporary)
Create a private world, the user must be authenticated. If the world already exists, owner may change isPublic or isTemporary parameters. Returns HTTP 201 CREATED for created world, or HTTP 200 OK if world already exists.- Parameters:
session
- automatically passed by frameworkworldName
- world name of created world, must be uniquetemplateWorldName
- optional world template to useisPublic
- optional flag to create public or private world, default falseisTemporary
- optional flag to create a temporary world, default true- Returns:
- token required to enter the world, only for private worlds
-
-