| | |
| | | package com.pollex.pam.web.rest; |
| | | |
| | | import com.pollex.pam.aop.logging.audit.AuditLoggingInject; |
| | | import com.pollex.pam.aop.logging.audit.AuditLoggingType; |
| | | import com.pollex.pam.domain.Appointment; |
| | | import com.pollex.pam.domain.Consultant; |
| | | import com.pollex.pam.security.SecurityUtils; |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | import static com.pollex.pam.aop.logging.audit.AuditLoggingType.CONSULTANT_SEND_FILL_SATISFACTION_NOTICE; |
| | | import static com.pollex.pam.aop.logging.audit.AuditLoggingType.EDIT_CONSULTANT_DATA; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/consultant") |
| | | public class ConsultantResource { |
| | | |
| | | @Autowired |
| | | ConsultantService consultantService; |
| | | |
| | | |
| | | @Autowired |
| | | AppointmentService appointmentService; |
| | | |
| | |
| | | }else { |
| | | return new ResponseEntity<>(HttpStatus.NOT_FOUND); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @PostMapping("/record/allAppointmentsView") |
| | |
| | | consultantService.recordAllAppointmentsView(); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | |
| | | |
| | | @AuditLoggingInject(type = EDIT_CONSULTANT_DATA) |
| | | @PostMapping("/edit") |
| | | public ResponseEntity<Consultant> editConsultant(@RequestBody ConsultantEditDTO editDTO) { |
| | | if(!editDTO.getAgentNo().equals(SecurityUtils.getAgentNo())) { |
| | |
| | | Consultant editResult = consultantService.editConsultant(editDTO); |
| | | return new ResponseEntity<>(editResult, HttpStatus.OK); |
| | | } |
| | | |
| | | |
| | | @AuditLoggingInject(type = CONSULTANT_SEND_FILL_SATISFACTION_NOTICE) |
| | | @PostMapping("/sendSatisfactionToClient/{appointmentId}") |
| | | public ResponseEntity<Void> sendSatisfactionToClient(@PathVariable Long appointmentId) { |
| | | Appointment appointment = appointmentService.findById(appointmentId); |