KotlinStart/mini/src/main/kotlin/com/chantha/mini/service/UserService.kt
2020-05-08 16:54:31 +07:00

17 lines
553 B
Kotlin

package com.chantha.mini.service
import com.chantha.mini.dto.UserDto
import com.chantha.mini.repo.UserRepo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
@Service
class UserService @Autowired constructor(private val userRepo: UserRepo) {
fun findByFirstNameAndLastName(firstName: String? = "", lastName: String? = ""):UserDto {
return userRepo.findByFirstnameAndLastname(firstName,lastName)
}
fun findAllRecord():List<UserDto>{
return userRepo.findAll()
}
}