daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.rivalgame.controller;
  2.  
  3. import com.rivalgame.characters.Characters;
  4. import com.rivalgame.database.DBConnector;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.http.MediaType;
  7. import org.springframework.web.bind.annotation.*;
  8.  
  9.  
  10. @RestController
  11. @RequestMapping("/api/user")
  12. public class RegisterController {
  13.  
  14.     private DBConnector dbConnector;
  15.  
  16.     @Autowired
  17.     public void RegisterController(DBConnector dbConnector){
  18.         this.dbConnector=dbConnector;
  19.     }
  20.  
  21.  
  22.     @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE)
  23.     public String saveChar(@RequestBody Characters characters) throws Exception {
  24.          dbConnector.setUp();
  25.          dbConnector.save(characters);
  26.          return "redirect: index";
  27.  
  28.  
  29.     }
  30.  
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top