2020-05-08 16:54:31 +07:00
|
|
|
package com.chantha.mini.service
|
|
|
|
|
|
|
|
import com.chantha.mini.dto.UserDto
|
|
|
|
import com.chantha.mini.repo.UserRepo
|
2020-05-08 17:16:54 +07:00
|
|
|
import com.fasterxml.jackson.annotation.JsonFilter
|
|
|
|
import com.fasterxml.jackson.annotation.JsonRootName
|
2020-05-08 16:54:31 +07:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
|
|
import org.springframework.stereotype.Service
|
2020-05-08 17:16:54 +07:00
|
|
|
import java.util.*
|
2020-05-08 16:54:31 +07:00
|
|
|
|
|
|
|
@Service
|
|
|
|
class UserService @Autowired constructor(private val userRepo: UserRepo) {
|
|
|
|
|
|
|
|
fun findByFirstNameAndLastName(firstName: String? = "", lastName: String? = ""):UserDto {
|
|
|
|
return userRepo.findByFirstnameAndLastname(firstName,lastName)
|
|
|
|
}
|
2020-05-08 17:16:54 +07:00
|
|
|
|
2020-05-08 16:54:31 +07:00
|
|
|
fun findAllRecord():List<UserDto>{
|
2020-05-08 17:01:07 +07:00
|
|
|
return userRepo.findAllRecord()
|
2020-05-08 16:54:31 +07:00
|
|
|
}
|
2020-05-08 17:16:54 +07:00
|
|
|
|
2020-05-08 17:50:25 +07:00
|
|
|
fun findByOneRecord(Id : Long ): List<UserDto> {
|
|
|
|
return userRepo.findByOneRecord(Id)
|
2020-05-08 17:16:54 +07:00
|
|
|
}
|
2020-05-08 16:54:31 +07:00
|
|
|
}
|