| | |
| | | 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 { |
| | |
| | | @GetMapping("/favorite") |
| | | public ResponseEntity<List<CustomerFavoriteConsultantDTO>> getMyConsultantList() { |
| | | List<CustomerFavoriteConsultantDTO> myConsultants = consultantService.getMyConsultantList(); |
| | | return new ResponseEntity<>(myConsultants, HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("/all") |
| | | public ResponseEntity<List<ConsultantDTO>> getAllConsultantList() { |
| | | List<ConsultantDTO> myConsultants = consultantService.getAllConsultantList(); |
| | | return new ResponseEntity<>(myConsultants, HttpStatus.OK); |
| | | } |
| | | |
| | |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @Deprecated |
| | | |
| | | @PostMapping("/strictQuery") |
| | | public ResponseEntity<List<ConsultantDTO>> strictQueryConsultant(@RequestBody StrictQueryConsultantParam param) { |
| | | List<ConsultantDTO> queryResult = consultantService.strictQueryConsultant(param); |
| | | return new ResponseEntity<>(queryResult, HttpStatus.OK); |
| | | } |
| | | @Deprecated |
| | | |
| | | @PostMapping("/fastQuery") |
| | | public ResponseEntity<List<ConsultantDTO>> fastQueryConsultant(@RequestBody FastQueryConsultantParam param) { |
| | | List<ConsultantDTO> queryResult = consultantService.fastQueryConsultant(param); |
| | |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | |
| | | @AuditLoggingInject(type = EDIT_CONSULTANT_DATA) |
| | | @PostMapping("/edit") |
| | | public ResponseEntity<Consultant> editConsultant(@RequestBody ConsultantEditDTO editDTO) { |
| | | if(!editDTO.getAgentNo().equals(SecurityUtils.getAgentNo())) { |
| | |
| | | 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); |