Package com.cyran.tp.server
Class UserController
java.lang.Object
com.cyran.tp.server.UserController
@RestController
public class UserController
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description UserController()
-
Method Summary
Modifier and Type Method Description java.lang.String
checkToken(Page accessingPage)
com.fasterxml.jackson.databind.JsonNode
createOrder(OrderRequest orderRequest)
java.lang.String
createProduct(ProductRequest createProductRequest)
java.lang.String
getCSRFToken(PageRequest accessingPage)
Product
getProduct(java.lang.String name)
User
getUser(java.lang.String name)
java.lang.String
orderProduct(UserOrderRequest userRequest)
java.lang.String
registerUser(RegisterUserRequest userRequest)
java.lang.String
updateProduct(ProductRequest updateProductRequest)
-
Constructor Details
-
UserController
public UserController()
-
-
Method Details
-
getUser
@CrossOrigin @GetMapping("/getUser") public User getUser(@RequestParam java.lang.String name) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
getProduct
@CrossOrigin @GetMapping("/getProduct") public Product getProduct(@RequestParam java.lang.String name) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
orderProduct
@CrossOrigin @PostMapping(path="/order", consumes="application/json", produces="application/json") public java.lang.String orderProduct(@RequestBody UserOrderRequest userRequest) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
registerUser
@CrossOrigin @PostMapping("/register") public java.lang.String registerUser(@RequestBody RegisterUserRequest userRequest) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
createProduct
@CrossOrigin @RequestMapping(value="/create/product", consumes="application/json", produces="application/json", method=POST) public java.lang.String createProduct(@RequestBody ProductRequest createProductRequest) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
updateProduct
@CrossOrigin @RequestMapping(value="/update/product", consumes="application/json", produces="application/json", method=POST) public java.lang.String updateProduct(@RequestBody ProductRequest updateProductRequest) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
createOrder
@CrossOrigin @RequestMapping(value="/create/order", consumes="application/json", produces="application/json", method=POST) public com.fasterxml.jackson.databind.JsonNode createOrder(@RequestBody OrderRequest orderRequest) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
getCSRFToken
@CrossOrigin @RequestMapping(value="/getToken", consumes="application/json", produces="application/json", method=POST) public java.lang.String getCSRFToken(@RequestBody PageRequest accessingPage) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
checkToken
@CrossOrigin @RequestMapping(value="/check-token", consumes="application/json", produces="application/json", method=POST) public java.lang.String checkToken(@RequestBody Page accessingPage) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-