mirror of
https://github.com/dalbodeule/sh0rt.kr-pdns.git
synced 2026-11-05 22:29:34 +09:00
initialized
This commit is contained in:
37 files changed
+2112
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package space.mori.dnsapi.service
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.stereotype.Service
|
||||
import space.mori.dnsapi.db.Domain
|
||||
import space.mori.dnsapi.db.DomainRepository
|
||||
import java.util.*
|
||||
|
||||
|
||||
@Service
|
||||
class DomainService {
|
||||
@Autowired
|
||||
private val domainRepository: DomainRepository? = null
|
||||
|
||||
fun getAllDomains(): List<Domain?> {
|
||||
return domainRepository!!.findAll()
|
||||
}
|
||||
|
||||
fun getDomainById(cfid: String): Optional<Domain> {
|
||||
return domainRepository!!.findByCfid(cfid)
|
||||
}
|
||||
|
||||
fun createDomain(domain: Domain): Domain {
|
||||
return domainRepository!!.save<Domain>(domain)
|
||||
}
|
||||
|
||||
fun deleteDomain(cfid: String) {
|
||||
domainRepository!!.deleteByCfid(cfid)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user