25 lines
787 B
Kotlin
25 lines
787 B
Kotlin
package com.chantha.mini.service
|
|
|
|
import com.chantha.mini.dto.UserDto
|
|
import com.chantha.mini.repo.UserRepo
|
|
import com.fasterxml.jackson.annotation.JsonFilter
|
|
import com.fasterxml.jackson.annotation.JsonRootName
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
import org.springframework.stereotype.Service
|
|
import java.util.*
|
|
|
|
@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.findAllRecord()
|
|
}
|
|
|
|
fun findByOneRecord(Id : Long ): List<UserDto> {
|
|
return userRepo.findByOneRecord(Id)
|
|
}
|
|
} |