start api with kotlin

This commit is contained in:
Chantha 2020-05-08 17:01:07 +07:00
parent ec11937139
commit e238ee257a
2 changed files with 3 additions and 1 deletions

View File

@ -10,4 +10,6 @@ interface UserRepo : JpaRepository<UserDto,Long> {
@Query("SELECT * FROM user_dto WHERE firstName=?1 AND lastName=?2",nativeQuery = true)
fun findByFirstnameAndLastname(firstName:String?="",lastName:String?=""):UserDto
@Query("SELECT * FROM user_dto",nativeQuery = true)
fun findAllRecord():List<UserDto>
}

View File

@ -12,6 +12,6 @@ class UserService @Autowired constructor(private val userRepo: UserRepo) {
return userRepo.findByFirstnameAndLastname(firstName,lastName)
}
fun findAllRecord():List<UserDto>{
return userRepo.findAll()
return userRepo.findAllRecord()
}
}