| | |
| | | Consultant consultant = consultantRepository.findOneByAgentNo(account).orElseThrow(() -> new UsernameNotFoundException("該顧問資料並不存在於媒合平台系統中")); |
| | | |
| | | if(consultant.getStatus() == DISABLE) { |
| | | throw new ConsultantDisableException("顧問帳號目前停用中"); |
| | | throw new ConsultantDisableException(); |
| | | } |
| | | |
| | | consultant.setLatestLoginTime(Instant.now()); |
| | |
| | | |
| | | @ResponseStatus(value = HttpStatus.UNAUTHORIZED) |
| | | public class ConsultantDisableException extends RuntimeException { |
| | | public ConsultantDisableException(String message) { |
| | | super(message); |
| | | public ConsultantDisableException() { |
| | | super("此帳號目前無使用此平台之權限"); |
| | | } |
| | | } |