Commit 655f0e5f by lixian7

调整接口

parent cb0e74ce
...@@ -126,7 +126,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple ...@@ -126,7 +126,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
*/ */
@Override @Override
public boolean unbindInfo(UnBindReq req) { public boolean unbindInfo(UnBindReq req) {
return bindCache.unBind(req.getUnqId()); return bindCache.unBind(req.getUnqId(), req.getUserId());
} }
/** /**
......
...@@ -7,6 +7,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper; ...@@ -7,6 +7,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper;
import com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo; import com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -47,11 +48,16 @@ public class BindCache { ...@@ -47,11 +48,16 @@ public class BindCache {
/** /**
* 解绑 * 解绑
* @param unqId * @param unqId 绑定唯一标识
* @param userId 第三方用户ID
* @return * @return
*/ */
@CacheEvict( value = "bindinfo", key = "'id:'+#unqId", condition = "#unqId!=null") @Caching(evict = {
public boolean unBind(String unqId){ @CacheEvict( value = "bindinfo", key = "'id:'+#unqId", condition = "#unqId!=null"),
@CacheEvict( value = "bindinfo", key = "'userId:'+#userId", condition = "#userId!=null")
})
public boolean unBind(String unqId, String userId){
BindInfo bindInfo = new BindInfo(); BindInfo bindInfo = new BindInfo();
bindInfo.setUnqId(unqId); bindInfo.setUnqId(unqId);
bindInfo.setStatus("0"); bindInfo.setStatus("0");
......
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