|
42 | 42 |
|
43 | 43 | @Component |
44 | 44 | public class AccountDaoImpl extends GenericDaoBase<AccountVO, Long> implements AccountDao { |
45 | | - private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, u.username, u.account_id, u.secret_key, u.state, u.api_key_access, " |
| 45 | + private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, u.uuid u.username, u.account_id, u.secret_key, u.state, u.api_key_access, " |
46 | 46 | + "a.id, a.account_name, a.type, a.role_id, a.domain_id, a.state, a.api_key_access " + "FROM `cloud`.`user` u, `cloud`.`account` a " |
47 | 47 | + "WHERE u.account_id = a.id AND u.api_key = ? and u.removed IS NULL"; |
48 | 48 |
|
@@ -145,24 +145,25 @@ public Pair<User, Account> findUserAccountByApiKey(String apiKey) { |
145 | 145 | // TODO: make sure we don't have more than 1 result? ApiKey had better be unique |
146 | 146 | if (rs.next()) { |
147 | 147 | User u = new UserVO(rs.getLong(1)); |
148 | | - u.setUsername(rs.getString(2)); |
149 | | - u.setAccountId(rs.getLong(3)); |
150 | | - u.setSecretKey(DBEncryptionUtil.decrypt(rs.getString(4))); |
151 | | - u.setState(State.getValueOf(rs.getString(5))); |
152 | | - boolean apiKeyAccess = rs.getBoolean(6); |
| 148 | + u.setUuid(rs.getString(2)); |
| 149 | + u.setUsername(rs.getString(3)); |
| 150 | + u.setAccountId(rs.getLong(4)); |
| 151 | + u.setSecretKey(DBEncryptionUtil.decrypt(rs.getString(5))); |
| 152 | + u.setState(State.getValueOf(rs.getString(6))); |
| 153 | + boolean apiKeyAccess = rs.getBoolean(7); |
153 | 154 | if (rs.wasNull()) { |
154 | 155 | u.setApiKeyAccess(null); |
155 | 156 | } else { |
156 | 157 | u.setApiKeyAccess(apiKeyAccess); |
157 | 158 | } |
158 | 159 |
|
159 | | - AccountVO a = new AccountVO(rs.getLong(7)); |
160 | | - a.setAccountName(rs.getString(8)); |
161 | | - a.setType(Account.Type.getFromValue(rs.getInt(9))); |
162 | | - a.setRoleId(rs.getLong(10)); |
163 | | - a.setDomainId(rs.getLong(11)); |
164 | | - a.setState(State.getValueOf(rs.getString(12))); |
165 | | - apiKeyAccess = rs.getBoolean(13); |
| 160 | + AccountVO a = new AccountVO(rs.getLong(8)); |
| 161 | + a.setAccountName(rs.getString(9)); |
| 162 | + a.setType(Account.Type.getFromValue(rs.getInt(10))); |
| 163 | + a.setRoleId(rs.getLong(11)); |
| 164 | + a.setDomainId(rs.getLong(12)); |
| 165 | + a.setState(State.getValueOf(rs.getString(13))); |
| 166 | + apiKeyAccess = rs.getBoolean(14); |
166 | 167 | if (rs.wasNull()) { |
167 | 168 | a.setApiKeyAccess(null); |
168 | 169 | } else { |
|
0 commit comments