From 97777e5c968c9430f95080ecc830f78debb8cc4c Mon Sep 17 00:00:00 2001 From: jack <jack.su@pollex.com.tw> Date: 星期一, 31 七月 2023 17:26:09 +0800 Subject: [PATCH] [ADD] 新增OTP檢核, 驗證之前需要先檢查帳號跟index key有沒有符合, todo : 171002 --- pamapi/src/main/java/com/pollex/pam/web/rest/ConsultantResource.java | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/web/rest/ConsultantResource.java b/pamapi/src/main/java/com/pollex/pam/web/rest/ConsultantResource.java index d80947c..7c8bc6f 100644 --- a/pamapi/src/main/java/com/pollex/pam/web/rest/ConsultantResource.java +++ b/pamapi/src/main/java/com/pollex/pam/web/rest/ConsultantResource.java @@ -1,25 +1,23 @@ package com.pollex.pam.web.rest; -import com.pollex.pam.domain.Consultant; -import com.pollex.pam.security.SecurityUtils; -import com.pollex.pam.service.ConsultantService; -import com.pollex.pam.service.dto.*; +import com.pollex.pam.business.aop.logging.audit.AuditLoggingInject; +import com.pollex.pam.business.domain.Consultant; +import com.pollex.pam.business.security.SecurityUtils; +import com.pollex.pam.business.service.AppointmentService; +import com.pollex.pam.business.service.ConsultantService; +import com.pollex.pam.business.service.dto.*; import org.apache.commons.compress.utils.IOUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.Resource; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.nio.charset.StandardCharsets; import java.util.List; + +import static com.pollex.pam.business.aop.logging.audit.AuditLoggingType.EDIT_CONSULTANT_DATA; @RestController @RequestMapping("/api/consultant") @@ -27,6 +25,9 @@ @Autowired ConsultantService consultantService; + + @Autowired + AppointmentService appointmentService; @GetMapping("/favorite") public ResponseEntity<List<CustomerFavoriteConsultantDTO>> getMyConsultantList() { @@ -97,8 +98,8 @@ }else { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } - - + + } @PostMapping("/record/allAppointmentsView") @@ -106,7 +107,8 @@ 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())) { -- Gitblit v1.8.0