yangys
2024-04-19 0141c3ed55171b22dd998ba037166f67e69c9aa9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.qianwen.core.secure.provider;
 
import com.qianwen.core.secure.constant.SecureConstant;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
 
public class ClientDetailsServiceImpl implements IClientDetailsService {
    private final JdbcTemplate jdbcTemplate;
 
    public ClientDetailsServiceImpl(final JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }
 
    @Override // org.springblade.core.secure.provider.IClientDetailsService
    public IClientDetails loadClientByClientId(String clientId) {
        try {
            return (IClientDetails) this.jdbcTemplate.queryForObject(SecureConstant.DEFAULT_SELECT_STATEMENT, new String[]{clientId}, new BeanPropertyRowMapper(ClientDetails.class));
        } catch (Exception e) {
            return null;
        }
    }
}