From 96d7bd0c2e99994cdc09bd61ef42307504fc5efa Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期一, 25 七月 2022 16:56:15 +0800 Subject: [PATCH] update: [nuxt-config] GTM code --- pamapi/src/main/java/com/pollex/pam/service/CustomerService.java | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java b/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java index c944a44..2ecff6d 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java +++ b/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java @@ -2,21 +2,23 @@ import java.util.Optional; -import com.pollex.pam.security.SecurityUtils; -import com.pollex.pam.service.dto.CustomerDTO; -import com.pollex.pam.service.mapper.CustomerMapper; +import com.pollex.pam.business.security.SecurityUtils; +import com.pollex.pam.business.service.OtpTmpService; +import com.pollex.pam.business.service.UsernameAlreadyUsedException; +import com.pollex.pam.business.service.dto.CustomerDTO; +import com.pollex.pam.business.service.mapper.CustomerMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.pollex.pam.domain.Customer; -import com.pollex.pam.domain.OtpTmp; -import com.pollex.pam.enums.OtpLoginTypeEnum; -import com.pollex.pam.enums.OtpTmpStatusEnum; -import com.pollex.pam.repository.CustomerRepository; -import com.pollex.pam.service.dto.CustomerRegisterDTO; -import com.pollex.pam.service.mapper.CustomerDTOMapper; +import com.pollex.pam.business.domain.Customer; +import com.pollex.pam.business.domain.OtpTmp; +import com.pollex.pam.business.enums.OtpLoginTypeEnum; +import com.pollex.pam.business.enums.OtpTmpStatusEnum; +import com.pollex.pam.business.repository.CustomerRepository; +import com.pollex.pam.business.service.dto.CustomerRegisterDTO; +import com.pollex.pam.business.service.mapper.CustomerDTOMapper; @Service @Transactional @@ -64,7 +66,7 @@ } public void updateLoggedCustomer(CustomerDTO customerDTO) { - Long customerId = SecurityUtils.getCustomerId(); + Long customerId = SecurityUtils.getCustomerDBId(); Customer customer = customerRepository.findById(customerId) .orElseThrow(() -> new UsernameNotFoundException("customerId which is from token is not found in customer db table, customer id = " + customerId)); @@ -75,7 +77,7 @@ } public CustomerDTO getLoggedCustomerDTO() { - Long customerId = SecurityUtils.getCustomerId(); + Long customerId = SecurityUtils.getCustomerDBId(); Customer customer = customerRepository.findById(customerId) .orElseThrow(() -> new UsernameNotFoundException("customerId which is from token is not found in customer db table, customer id = " + customerId)); @@ -88,7 +90,7 @@ private boolean checkCustomerExist(CustomerRegisterDTO registDTO) { String account = getCustomerAccount(registDTO); - Optional<Customer> customer = customerRepository.findOneByEmailEqualsOrPhoneEquals(account, account); + Optional<Customer> customer = customerRepository.findOneByEmailEqualsOrPhoneEquals(account); return customer.isPresent(); } } -- Gitblit v1.8.0