Created
February 28, 2019 12:17
-
-
Save tuesd4y/3176eda2799d11dce76ca957385e07e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package at.triply.backend.eventbackend.security | |
import at.triply.backend.eventbackend.data.entities.EventManager | |
import at.triply.backend.eventbackend.data.repositories.EventManagerRepository | |
import org.springframework.data.rest.webmvc.BasePathAwareController | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.PostMapping | |
import org.springframework.web.bind.annotation.RequestBody | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.web.bind.annotation.ResponseBody | |
@BasePathAwareController | |
@RequestMapping("/users") | |
class EventManagerController(val eventManagerRepository: EventManagerRepository) { | |
@PostMapping("/signup") | |
@ResponseBody | |
fun signUp(@RequestBody user: EventManager): ResponseEntity<User> { | |
return ResponseEntity.ok( | |
eventManagerRepository.save(user) | |
) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package at.triply.backend.eventbackend.security | |
interface User { | |
val username: String | |
val password: String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment