Authored by chenchao

add cached

fix nullpoint
package com.yohoufo.dal.order.model;
import lombok.ToString;
@ToString
public class MetaConfig {
private Integer id;
... ...
package com.yohoufo.dal.order.model;
import lombok.Data;
@Data
public class SellerEnterApply {
private Integer id;
... ... @@ -17,67 +20,4 @@ public class SellerEnterApply {
private Short status;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public Long getOrderCode() {
return orderCode;
}
public void setOrderCode(Long orderCode) {
this.orderCode = orderCode;
}
public Integer getPreEnterType() {
return preEnterType;
}
public void setPreEnterType(Integer preEnterType) {
this.preEnterType = preEnterType;
}
public Integer getEnterType() {
return enterType;
}
public void setEnterType(Integer enterType) {
this.enterType = enterType;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Integer updateTime) {
this.updateTime = updateTime;
}
public Short getStatus() {
return status;
}
public void setStatus(Short status) {
this.status = status;
}
}
\ No newline at end of file
... ...
package com.yohoufo.dal.order.model;
import lombok.Data;
@Data
public class SellerFunc {
private Integer id;
... ... @@ -9,35 +12,4 @@ public class SellerFunc {
private Integer code;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCnName() {
return cnName;
}
public void setCnName(String cnName) {
this.cnName = cnName == null ? null : cnName.trim();
}
public String getEnName() {
return enName;
}
public void setEnName(String enName) {
this.enName = enName == null ? null : enName.trim();
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
}
\ No newline at end of file
... ...
package com.yohoufo.dal.order.model;
import lombok.Data;
@Data
public class SellerLevelFunc {
private Integer id;
... ... @@ -9,35 +12,4 @@ public class SellerLevelFunc {
private String funcList;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getEnterType() {
return enterType;
}
public void setEnterType(Integer enterType) {
this.enterType = enterType;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getFuncList() {
return funcList;
}
public void setFuncList(String funcList) {
this.funcList = funcList == null ? null : funcList.trim();
}
}
\ No newline at end of file
... ...
... ... @@ -88,6 +88,7 @@ public class SellerFuncService {
SellerLevelFuncBo defaultSLFB = new SellerLevelFuncBo();
defaultSLFB.setLevel(SellerConfig.ENTER_TYPE_DEFAULT_LEVEL);
defaultSLFB.setFuncList(SellerConfig.ENTER_TYPE_DEFAULT_FUNCS);
defaultSLFB.setFuncIdList(new ArrayList<>(1));
return defaultSLFB;
}
... ...
... ... @@ -8,6 +8,7 @@ import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.order.service.impl.SellerService;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.SellerHelper;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -38,7 +39,8 @@ public class SellerAuthCheckService {
case BATCH_PUBLISH:
case BATCH_OFFSHELVE:
case BATCH_CHANGEPRICE:
if (!funcIdList.contains(sellerFunc.getCode())){
if (CollectionUtils.isEmpty(funcIdList)
||!funcIdList.contains(sellerFunc.getCode())){
logger.warn("in checkAuth fail uid {} est {} level {}", uid, est, level);
throw new UfoServiceException(511, "您已经被降级");
}
... ...