SPARK-1013 in progress
This commit is contained in:
1 parent
d2fb9f2b7b
commit
6c9ec7238d
3 files changed
+63
-16
No files matched your search
@@ -64,9 +64,20 @@ void UserModelServiceServer::create_account(const api::account::AccountCreateAPI
|
||||
}
|
||||
}
|
||||
|
||||
void UserModelServiceServer::set_account_clip_limits(const api::account::AccountSecurityClipLimitsAPIArgument&,
|
||||
void UserModelServiceServer::set_account_clip_limits(const api::account::AccountSecurityClipLimitsAPIArgument& acct_clips_arg,
|
||||
const api::Response<::bts::api::VoidMessage>&)
|
||||
{
|
||||
bts::api::account::BTSAccount* account = _find_account(acct_clips_arg.account_id());
|
||||
if (account != nullptr)
|
||||
{
|
||||
// if(!account->has_account_data())
|
||||
// {
|
||||
// account->mutable_account_data()->mutable_security_clip_limits()->mutable_limit()->Clear();
|
||||
// }
|
||||
}
|
||||
else{
|
||||
// TODO: return error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +153,15 @@ bts::api::account::BTSAccount* UserModelServiceServer::_find_account (const std:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bts::api::account::BTSAccount* UserModelServiceServer::_find_account (int id){
|
||||
for(int i=0; i<_state.accounts_size(); i++){
|
||||
bts::api::account::BTSAccount* acct = _state.mutable_accounts(i);
|
||||
if(id == acct->id())
|
||||
return acct;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bts::api::account::BTSUser* UserModelServiceServer::_find_user (const std::string& user_name){
|
||||
for(int i=0; i<_state.users_size(); i++){
|
||||
bts::api::account::BTSUser* user = _state.mutable_users(i);
|
||||
@@ -151,7 +171,26 @@ bts::api::account::BTSUser* UserModelServiceServer::_find_user (const std::strin
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bts::api::account::BTSUser* UserModelServiceServer::_find_user (const int id){
|
||||
for(int i=0; i<_state.users_size(); i++){
|
||||
bts::api::account::BTSUser* user = _state.mutable_users(i);
|
||||
if(id == user->id())
|
||||
return user;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int UserModelServiceServer::_find_curr_acct_id (){
|
||||
int rv = 0;
|
||||
for(int i=0; i<_state.accounts_size(); i++){
|
||||
bts::api::account::BTSAccount* acct = _state.mutable_accounts(i);
|
||||
if (acct->id() > rv)
|
||||
rv = acct->id();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
int UserModelServiceServer::_find_curr_user_id (){
|
||||
int rv = 0;
|
||||
for(int i=0; i<_state.users_size(); i++){
|
||||
bts::api::account::BTSUser* user = _state.mutable_users(i);
|
||||
|
||||
Reference in new issue
Block a user