Skip to content

Instantly share code, notes, and snippets.

@svenhakvoort
Created May 17, 2020 15:55
Show Gist options
  • Save svenhakvoort/5f6c027579d5a68780d80f2c5fb130ad to your computer and use it in GitHub Desktop.
Save svenhakvoort/5f6c027579d5a68780d80f2c5fb130ad to your computer and use it in GitHub Desktop.
DemoService
package com.example.demographql.service
import com.example.demographql.model.Demo
import com.example.demographql.repository.DemoRepository
import org.springframework.stereotype.Service
import reactor.core.publisher.Mono
@Service
class DemoService(val demoRepository: DemoRepository) {
fun createNewDemo(someText: String): Mono<Demo> {
val model = Demo(someText = someText)
return demoRepository.save(model)
}
fun findById(demoId: String): Mono<Demo> {
return demoRepository.findById(demoId)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment