Add some other resources

This commit is contained in:
2025-01-12 11:47:59 +01:00
parent eaeae11e97
commit ef5df17f58
7 changed files with 145 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
package service
import dao.TermDao
import org.jetbrains.exposed.sql.transactions.transaction
import service.DatabaseFactory.dbExecId
import models.Term
import models.TermFull
class TermServiceImpl : TermService {
override fun getTerm(id: Int): Term? = dbExecId(1) {
TermDao.findById(id)?.toModel()
}
override fun getAllTerm(): List<Term> = dbExecId(1) {
TermDao.all().map { it.toModel() }
}
override fun getFullTerm(id: Int): TermFull? = dbExecId(1) {
TermDao.findById(id)?.toFullModel()
}
}