mirror of https://gitee.com/stylefeng/roses
【7.1.6】更新获取用户信息的接口
parent
009d0b4544
commit
1ce8a831e8
|
@ -70,4 +70,13 @@ public interface CustomerApi {
|
||||||
*/
|
*/
|
||||||
String createOrUpdateCustomerSecret(Long customerId);
|
String createOrUpdateCustomerSecret(Long customerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
*
|
||||||
|
* @param keyWords 用户账号,邮箱,或用户id
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2021/7/20 10:44
|
||||||
|
*/
|
||||||
|
CustomerInfo getCustomerInfoByKeyWords(String keyWords);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -388,6 +388,21 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
||||||
return randomString;
|
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
|
@Override
|
||||||
public CustomerInfo getCustomerInfoById(Long customerId) {
|
public CustomerInfo getCustomerInfoById(Long customerId) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue