Authored by mali

Merge branch 'master' into hotfix_vedio

package com.yoho.ufo.util;
import org.apache.commons.lang3.StringUtils;
/**
* Created by li.ma on 2019/4/19.
*/
public class KeyWordHiddenUtil {
/**
* 隐晦敏感词
* @param keyWord
* @param startlength 显示开始的几个字符
* @param endLength 显示结束的几个字符
* @return 隐晦后的敏感词
*/
public static String hiddenKeyWord(String keyWord, int startlength, int endLength) {
if (StringUtils.isEmpty(keyWord)) {
return keyWord;
}
int length = keyWord.length();
if (length <= startlength + endLength) {
return keyWord;
}
StringBuffer sb = new StringBuffer(length - startlength - endLength);
for (int i = length - startlength - endLength; i > 0; i--) {
sb.append('*');
}
return keyWord.substring(0, startlength) + sb.toString() + keyWord.substring(length - endLength);
}
}
... ...
... ... @@ -22,6 +22,7 @@ import com.yoho.ufo.order.response.StoredSellerRespVo;
import com.yoho.ufo.order.service.ITradeBillsService;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yoho.ufo.util.CollectionUtil;
import com.yoho.ufo.util.KeyWordHiddenUtil;
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
import com.yohobuy.ufo.model.order.resp.TradeBillsResp;
import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq;
... ... @@ -116,7 +117,7 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
StoredSellerRespVo resp=new StoredSellerRespVo();
resp.setUid(item.getUid());
resp.setCertName(item.getCertName());
resp.setCertNo(item.getCertNo());
resp.setCertNo(KeyWordHiddenUtil.hiddenKeyWord(item.getCertNo(), 2, 2));
resp.setValidStatus(item.getValidStatus());
resp.setValidStatusDesc(StoredSellerStatusEnum.getDescriptionByCode(item.getValidStatus()));
resp.setMobile(getMobileByUidFromCache(item.getUid()));
... ...