Created
May 17, 2020 15:55
-
-
Save svenhakvoort/5f6c027579d5a68780d80f2c5fb130ad to your computer and use it in GitHub Desktop.
DemoService
This file contains 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 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