This commit is contained in:
xds
2025-10-31 19:28:59 +03:00
parent 0f02b53bc0
commit d0cae182b7
6 changed files with 12 additions and 7 deletions

View File

@@ -53,12 +53,12 @@ class UserRepoImpl(
select * from finance.users u where tg_id = :tgId
""".trimIndent()
val params = mapOf("tgId" to tgId)
return jdbcTemplate.queryForObject(sql, params, userRowMapper())
return jdbcTemplate.query(sql, params, userRowMapper()).firstOrNull()
}
override fun create(user: User): User {
val sql =
"insert into finance.users(username, first_name, tg_id, tg_user_name, photo_url, password, is_active, reg_date) values (:username, :firstname, :tg_id, :tg_user_name, :photo_url :password, :isActive, :regDate) returning ID"
"insert into finance.users(username, first_name, tg_id, tg_user_name, photo_url, password, is_active, reg_date) values (:username, :firstname, :tg_id, :tg_user_name, :photo_url, :password, :isActive, :regDate) returning ID"
val params = mapOf(
"username" to user.username,
"firstname" to user.firstName,