记得上下班打卡 | git大法好,push需谨慎

Commit 971cbabb authored by wangyifan's avatar wangyifan

douduo-添加动态查询

parent 69e9b1d2
package com.liquidnet.service.sweet.vo;
import com.liquidnet.service.sweet.entity.SweetDoudou;
import com.liquidnet.service.sweet.entity.SweetDoudouScope;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -42,4 +41,16 @@ public class SweetDouDouScopeVo implements Serializable, Cloneable{
return new SweetDouDouScopeVo();
}
}
public SweetDouDouScopeVo copy(SweetDoudouScope source) {
if (null == source) return this;
this.mobile = source.getMobile();
this.nickName = source.getNickName();
this.realName = source.getRealName();
this.idCard = source.getIdCard();
this.status = source.getStatus();
this.createdAt = source.getCreatedAt();
this.updatedAt = source.getUpdatedAt();
return this;
}
}
......@@ -60,6 +60,8 @@ public class RedisDataUtils {
@Autowired
private SweetIntegralActivityDrawMapper sweetIntegralActivityDrawMapper;
@Autowired
private SweetDoudouScopeMapper sweetDoudouScopeMapper;
@Autowired
@Lazy
private FeignSlimeApiClient feignSlimeApiClient;
......@@ -473,7 +475,15 @@ public class RedisDataUtils {
String redisKey = SweetConstant.REDIS_KEY_SWEET_DOUDOU_SCOPE_MOBILE.concat(mobile);
SweetDouDouScopeVo scopeVo = (SweetDouDouScopeVo) redisUtil.get(redisKey);
if (scopeVo == null) {
//TODO 从MySQL查询
// 从MySQL查询
LambdaQueryWrapper<SweetDoudouScope> lambda = new QueryWrapper<SweetDoudouScope>()
.lambda().eq(SweetDoudouScope::getMobile, mobile)
.eq(SweetDoudouScope::getStatus, 1);
SweetDoudouScope scope = sweetDoudouScopeMapper.selectOne(lambda);
if (scope != null) {
scopeVo = new SweetDouDouScopeVo().copy(scope);
setSweetDouDouScopeVo(scopeVo);
}
}
return scopeVo;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment