| | |
| | | http://localhost:8080/api/satisfaction/score |
| | | |
| | | |
| | | 填寫ä¸ç: |
| | | |
| | | request body: |
| | | |
| | | { |
| | | [{ |
| | | "appointmentId": 67, |
| | | "score":4 |
| | | } |
| | | }] |
| | | |
| | | |
| | | |
| | |
| | | "agentNo": "admin", |
| | | "status": "UNFILLED", |
| | | "score": 4 |
| | | } |
| | | } |
| | | |
| | | ===================================================== |
| | | |
| | | 填寫å¤ç滿æåº¦: |
| | | |
| | | request body: |
| | | |
| | | [{ |
| | | "appointmentId": 67, |
| | | "score":4 |
| | | }] |
| | | |
| | | |
| | | |
| | | response body: |
| | | |
| | | [ADD] |
| | | |
| | | [{ |
| | | "id": 3, |
| | | "customerId": 2, |
| | | "agentNo": "admin", |
| | | "status": "UNFILLED", |
| | | "score": 4 |
| | | }] |
| | | |
| | |
| | | package com.pollex.pam.service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | |
| | | public Optional<Satisfaction> getByAppointmentId(Long appointmentId) { |
| | | return satisfactionRepository.findOneByAppointmentId(appointmentId); |
| | | } |
| | | |
| | | public List<Satisfaction> scoreAllfaction(List<SatisfactionCustomerScoreDTO> scoreDTO) { |
| | | List<Satisfaction> satisfactionList = new ArrayList<>(); |
| | | scoreDTO.stream().forEach(dto ->{ |
| | | satisfactionList.add(scorefaction(dto)); |
| | | }); |
| | | return satisfactionList; |
| | | } |
| | | } |
| | |
| | | return satisfactionService.scorefaction(scoreDTO); |
| | | } |
| | | |
| | | @PostMapping("/score/all") |
| | | public List<Satisfaction> scoreAllfaction(@RequestBody List<SatisfactionCustomerScoreDTO> scoreDTO) { |
| | | return satisfactionService.scoreAllfaction(scoreDTO); |
| | | } |
| | | |
| | | @GetMapping("/getMySatisfaction") |
| | | public List<SatisfactionDTO> getMySatisfaction(){ |
| | | if(StringUtils.hasText(SecurityUtils.getAgentNo())) { |