Commit 8729fa6e by fudahua

会员的好友导购列表

parent 9259b01b
......@@ -7,6 +7,7 @@ import java.util.List;
import java.util.stream.Collectors;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.web.vo.SdkVersionLimitVo;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -76,27 +77,33 @@ public class ApplicationController extends WebBaseController{
if (StringUtils.isBlank(skdVersion)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
SdkVersionLimitVo sdkVersionLimitVo = new SdkVersionLimitVo();
Object cache = RedisUtil.getCache(SDKVERSION_KEY);
if (null == cache) {
return resultResponse(HaoBanErrCode.ERR_1, true);
return resultResponse(HaoBanErrCode.ERR_1, sdkVersionLimitVo);
}
String limitSdkVersion = cache.toString();
sdkVersionLimitVo.setLimitSdkVersion(limitSdkVersion);
String[] limitSdk = StringUtils.split(limitSdkVersion, ".");
String[] versionSplit = StringUtils.split(skdVersion, ".");
int checkFlag = checkNum(Integer.valueOf(limitSdk[0]), Integer.valueOf(versionSplit[0]));
if (checkFlag != 0) {
return resultResponse(HaoBanErrCode.ERR_1, checkFlag > 0 ? true : false);
sdkVersionLimitVo.setCheckFlag(checkFlag > 0 ? true : false);
return resultResponse(HaoBanErrCode.ERR_1, sdkVersionLimitVo);
}
checkFlag = checkNum(Integer.valueOf(limitSdk[1]), Integer.valueOf(versionSplit[1]));
if (checkFlag != 0) {
return resultResponse(HaoBanErrCode.ERR_1, checkFlag > 0 ? true : false);
sdkVersionLimitVo.setCheckFlag(checkFlag > 0 ? true : false);
return resultResponse(HaoBanErrCode.ERR_1, sdkVersionLimitVo);
}
checkFlag = checkNum(Integer.valueOf(limitSdk[2]), Integer.valueOf(versionSplit[2]));
if (checkFlag != 0) {
return resultResponse(HaoBanErrCode.ERR_1, checkFlag > 0 ? true : false);
sdkVersionLimitVo.setCheckFlag(checkFlag > 0 ? true : false);
return resultResponse(HaoBanErrCode.ERR_1, sdkVersionLimitVo);
}
return resultResponse(HaoBanErrCode.ERR_1, true);
return resultResponse(HaoBanErrCode.ERR_1, sdkVersionLimitVo);
}
......
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
/**
* Created 2021/3/24.
*
* @author hua
*/
public class SdkVersionLimitVo implements Serializable {
private String limitSdkVersion;
private boolean checkFlag = true;
public String getLimitSdkVersion() {
return limitSdkVersion;
}
public void setLimitSdkVersion(String limitSdkVersion) {
this.limitSdkVersion = limitSdkVersion;
}
public boolean isCheckFlag() {
return checkFlag;
}
public void setCheckFlag(boolean checkFlag) {
this.checkFlag = checkFlag;
}
}
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