add clearManager

master
luoyang 6 years ago
parent 297d01a794
commit 992b9cec09

@ -11,6 +11,8 @@ public interface SignInAccountService {
JSONObject getManager(String accountId); JSONObject getManager(String accountId);
void clearManager(String accountId);
JSONObject getClient(String accountId); JSONObject getClient(String accountId);
void clearAccountCache(String accountId); void clearAccountCache(String accountId);

@ -6,6 +6,7 @@ import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.organizations.core.OrgManager; import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.manage.signin.beans.ManagerInfo; import au.com.royalpay.payment.manage.signin.beans.ManagerInfo;
import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService; import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException; import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
@ -37,6 +38,8 @@ public class ManagerAccountServiceImpl implements ManagerAccountsService {
@Resource @Resource
private OrgManager orgManager; private OrgManager orgManager;
@Resource
private SignInAccountService signInAccountService;
@Override @Override
public PageList<JSONObject> listManagers(JSONObject loginManager,JSONObject params) { public PageList<JSONObject> listManagers(JSONObject loginManager,JSONObject params) {
@ -105,6 +108,7 @@ public class ManagerAccountServiceImpl implements ManagerAccountsService {
} }
obj.put("manager_id", userId); obj.put("manager_id", userId);
managerMapper.update(obj); managerMapper.update(obj);
signInAccountService.clearManager(userId);
} }
@Override @Override

@ -129,6 +129,12 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
return manager; return manager;
} }
@Override
@CacheEvict(value = ":login:managers:", key = "''+#accountId")
public void clearManager(String accountId) {
}
@Override @Override
@Cacheable(value = ":login:clients:", key = "''+#accountId") @Cacheable(value = ":login:clients:", key = "''+#accountId")
public JSONObject getClient(String accountId) { public JSONObject getClient(String accountId) {

Loading…
Cancel
Save