17 lines
553 B
Kotlin
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()
|
|
}
|
|
} |