19 lines
487 B
Kotlin
19 lines
487 B
Kotlin
package net.cismon.urlshortener.service
|
|
|
|
import net.cismon.urlshortener.dao.UrlDao
|
|
import net.cismon.urlshortener.model.UrlModel
|
|
import org.springframework.stereotype.Service
|
|
|
|
@Service
|
|
class UrlService(val urlDao: UrlDao) {
|
|
|
|
fun saveUrl(url: UrlModel) = urlDao.save(url)
|
|
|
|
fun getAllUrl(uid: Long) = urlDao.findByUid(uid)
|
|
|
|
fun deleteUrl(id: Long) = urlDao.deleteById(id)
|
|
|
|
fun getUrl(id: Long) = urlDao.findById(id)
|
|
|
|
fun getUrl(uuid: String) = urlDao.findByUuid(uuid)
|
|
} |