【7.1.6】更新获取用户信息的接口

pull/23/head
fengshuonan 2021-11-26 18:05:20 +08:00
parent 009d0b4544
commit 1ce8a831e8
2 changed files with 25 additions and 1 deletions

View File

@ -70,4 +70,13 @@ public interface CustomerApi {
*/
String createOrUpdateCustomerSecret(Long customerId);
/**
*
*
* @param keyWords id
* @author fengshuonan
* @date 2021/7/20 10:44
*/
CustomerInfo getCustomerInfoByKeyWords(String keyWords);
}

View File

@ -369,7 +369,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
@Override
public String createOrUpdateCustomerSecret(Long customerId) {
if(customerId == null){
if (customerId == null) {
return null;
}
@ -388,6 +388,21 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
return randomString;
}
@Override
public CustomerInfo getCustomerInfoByKeyWords(String keyWords) {
LambdaQueryWrapper<Customer> customerLambdaQueryWrapper = new LambdaQueryWrapper<>();
customerLambdaQueryWrapper.eq(Customer::getAccount, keyWords)
.or().eq(Customer::getEmail, keyWords)
.or().eq(Customer::getCustomerId, keyWords)
.select(Customer::getCustomerId);
Customer one = this.getOne(customerLambdaQueryWrapper, false);
if (one == null) {
return null;
} else {
return this.getCustomerInfoById(one.getCustomerId());
}
}
@Override
public CustomerInfo getCustomerInfoById(Long customerId) {