-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
…sitory
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.saveourtool.save.authservice.repository | ||
|
||
import com.saveourtool.save.authservice.utils.toUserEntity | ||
import com.saveourtool.save.entities.User | ||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate | ||
import org.springframework.stereotype.Component | ||
|
||
/** | ||
* Repository for [com.saveourtool.save.entities.User] | ||
*/ | ||
@Component | ||
class AuthenticationOriginalUserRepository( | ||
private val namedParameterJdbcTemplate: NamedParameterJdbcTemplate, | ||
) { | ||
/** | ||
* @param name name of user | ||
* @param source source of user | ||
* @return user or null if no results have been found | ||
*/ | ||
fun findByNameAndSource(name: String, source: String): User? = | ||
namedParameterJdbcTemplate.queryForList( | ||
Check failure Code scanning / ktlint [WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 12 but was 8 Error
[WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 12 but was 8
|
||
"SELECT * FROM save_cloud.user WHERE id = (select user_id from save_cloud.original_login where name = :name AND source = :source)", | ||
Check failure Code scanning / ktlint [WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 16 but was 12 Error
[WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 16 but was 12
|
||
mapOf("name" to name, "source" to source) | ||
Check failure Code scanning / ktlint [WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 16 but was 12 Error
[WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 16 but was 12
|
||
).singleOrNull()?.toUserEntity() | ||
Check failure Code scanning / ktlint [WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 12 but was 8 Error
[WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 12 but was 8
|
||
} |