| | |
| | | AppointmentCustomerViewMapper appointmentCustomerViewMapper; |
| | | |
| | | public List<ConsultantDTO> getMyConsultantList() { |
| | | Long userId = SecurityUtils.getCustomerId(); |
| | | Long userId = SecurityUtils.getCustomerDBId(); |
| | | return customerFavoriteConsultantRepository.findAllByCustomerId(userId) |
| | | .stream() |
| | | .map(consultantMapper::toDto) |
| | |
| | | public void addConsultantToCustomList(AddConsultantParam param) { |
| | | List<String> agentNoList = param.getAgentNoList(); |
| | | List<Consultant> consultants = consultantRepository.findAllByAgentNoIn(agentNoList); |
| | | Long userId = SecurityUtils.getCustomerId(); |
| | | Long userId = SecurityUtils.getCustomerDBId(); |
| | | |
| | | consultants.forEach(consultant -> { |
| | | boolean isConsultantInList = customerFavoriteConsultantRepository.findOneByCustomerIdAndConsultant(userId, consultant).isPresent(); |
| | |
| | | } |
| | | |
| | | public void removeConsultantFromCustomList(String agentNo) { |
| | | Long customId = SecurityUtils.getCustomerId(); |
| | | Long customId = SecurityUtils.getCustomerDBId(); |
| | | Consultant consultant = consultantRepository.findOneByAgentNo(agentNo).orElseThrow(ConsultantNotFoundException::new); |
| | | CustomerFavoriteConsultant target = customerFavoriteConsultantRepository.findOneByCustomerIdAndConsultant(customId, consultant).orElse(null); |
| | | |