2sxc has a lot of WebApis - grouped into two types
- Stateless - these don't need a Block-context, so they don't need to know what module the call was made from.
- Stateful - these have commands which may need the block, but sometimes also work without a block context.
To keep our code clean and optimized, we must create these two base controllers, which the other controllers will inherit.
Create the Stateless ControllerBase
- Look at the OqtStatelesControllerBase, and create your similar implementation. Note that it's very trivial, the main feature is the Log-Name, which inheriting classes will have to provide.
Create the Stateful ControllerBase
- Look at the OqtStatefulControllerBase and create your similar implementation. Some notes
- As you'll end up adding more dependencies with time, I recommend creating a StatefulControllerDependencies object which makes it easier to inherit this class
- GetBlock should ensure that a block configuration is built/created if the headers are provided. In the initial implementation, please just return
null
to signal than blocks are not yet supported.
- GetContext should return the context of the block, or otherwise a neutral site/user only context
GetApp(appId)
should return a simple app object, just like in the Oqtane implementation
Note that you won't be able to test these, until you've actually implemented an API, so continue with the next step.