| | |
| | | package com.pollex.pam.web.rest; |
| | | |
| | | import com.pollex.pam.domain.Appointment; |
| | | import com.pollex.pam.domain.Consultant; |
| | | import com.pollex.pam.security.SecurityUtils; |
| | | import com.pollex.pam.service.AppointmentService; |
| | | import com.pollex.pam.service.ConsultantService; |
| | | import com.pollex.pam.service.dto.*; |
| | | import org.apache.commons.compress.utils.IOUtils; |
| | |
| | | |
| | | @Autowired |
| | | ConsultantService consultantService; |
| | | |
| | | @Autowired |
| | | AppointmentService appointmentService; |
| | | |
| | | @GetMapping("/favorite") |
| | | public ResponseEntity<List<CustomerFavoriteConsultantDTO>> getMyConsultantList() { |
| | |
| | | Consultant editResult = consultantService.editConsultant(editDTO); |
| | | return new ResponseEntity<>(editResult, HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping("/sendSatisfactionToClient/{appointmentId}") |
| | | public ResponseEntity<Void> sendSatisfactionToClient(@PathVariable Long appointmentId) { |
| | | Appointment appointment = appointmentService.findById(appointmentId); |
| | | if(!appointment.getAgentNo().equals(SecurityUtils.getAgentNo())) { |
| | | throw new IllegalAccessError(); |
| | | } |
| | | consultantService.sendSatisfactionToClient(appointment); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | } |