Skip to content

Instantly share code, notes, and snippets.

@tuesd4y
Created February 28, 2019 12:17
Show Gist options
  • Save tuesd4y/3176eda2799d11dce76ca957385e07e3 to your computer and use it in GitHub Desktop.
Save tuesd4y/3176eda2799d11dce76ca957385e07e3 to your computer and use it in GitHub Desktop.
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)
)
}
}
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