[update] 若顧問停用時,將無法登入 (文案待確認)
| | |
| | | Consultant consultant = consultantRepository.findOneByAgentNo(account).orElseThrow(() -> new UsernameNotFoundException("該顧問資料並不存在於媒合平台系統中")); |
| | | |
| | | if(consultant.getStatus() == DISABLE) { |
| | | throw new ConsultantDisableException(); |
| | | throw new ConsultantDisableException("顧問帳號目前停用中"); |
| | | } |
| | | |
| | | List<GrantedAuthority> grantedAuths = Arrays.asList(new SimpleGrantedAuthority("ROLE_USER")); |
| | |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.web.bind.annotation.ResponseStatus; |
| | | |
| | | @ResponseStatus(value = HttpStatus.UNAUTHORIZED, reason = "顧問帳號目前停用中") |
| | | @ResponseStatus(value = HttpStatus.UNAUTHORIZED) |
| | | public class ConsultantDisableException extends RuntimeException { |
| | | public ConsultantDisableException(String message) { |
| | | super(message); |
| | | } |
| | | } |