Package it.unisa.KryptoAuth.controller
Class BlockchainController
java.lang.Object
it.unisa.KryptoAuth.controller.BlockchainController
@Controller
@RequestMapping(value="/kryptoauth",
method=POST)
public class BlockchainController
extends Object
Gestisce tutte le chiamate POST per effettuare le operazioni di:
- registrazione;
- login;
- attivazione account;
- disattivazione account;
- cambio privilegi ad un account.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactiveAddress
(String address, String role, String status, String privateKey, javax.servlet.http.HttpServletRequest request) disactiveAddress
(String address, String role, String status, String privateKey, javax.servlet.http.HttpServletRequest request) loginPost
(@Valid User user, org.springframework.validation.Errors errors, String address, String privateKey, javax.servlet.http.HttpServletRequest request) registerPost
(@Valid User user, org.springframework.validation.Errors errors, String address, String privateKey, javax.servlet.http.HttpServletRequest request) renounceAdmin
(String address, javax.servlet.http.HttpServletRequest request) renounceRoles
(String address, javax.servlet.http.HttpServletRequest request)
-
Constructor Details
-
BlockchainController
public BlockchainController()
-
-
Method Details
-
loginPost
@ResponseBody @PostMapping("/login") public AjaxResponse loginPost(@Valid @ModelAttribute("user") @Valid User user, org.springframework.validation.Errors errors, @RequestParam("userAddress") String address, @RequestParam("privateKey") String privateKey, javax.servlet.http.HttpServletRequest request) throws Exception - Throws:
Exception
-
registerPost
@ResponseBody @PostMapping("/register") public AjaxResponse registerPost(@Valid @ModelAttribute("user") @Valid User user, org.springframework.validation.Errors errors, @RequestParam("userAddress") String address, @RequestParam("privateKey") String privateKey, javax.servlet.http.HttpServletRequest request) throws Exception - Throws:
Exception
-
activeAddress
@ResponseBody @PostMapping("/activeAddress") public AjaxResponse activeAddress(@RequestParam("address") String address, @RequestParam("role") String role, @RequestParam("status") String status, @RequestParam("privateKey") String privateKey, javax.servlet.http.HttpServletRequest request) throws Exception - Throws:
Exception
-
disactiveAddress
@ResponseBody @PostMapping("/disactiveAddress") public AjaxResponse disactiveAddress(@RequestParam("address") String address, @RequestParam("role") String role, @RequestParam("status") String status, @RequestParam("privateKey") String privateKey, javax.servlet.http.HttpServletRequest request) throws Exception - Throws:
Exception
-
renounceAdmin
@ResponseBody @PostMapping("/revokeAdmin") public AjaxResponse renounceAdmin(@RequestParam("address") String address, javax.servlet.http.HttpServletRequest request) -
renounceRoles
@ResponseBody @PostMapping("/revokeRoles") public AjaxResponse renounceRoles(@RequestParam("address") String address, javax.servlet.http.HttpServletRequest request)
-