| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | out.print(JsonUtil.loadFalseResult("值为空"));
|
| | | return;
|
| | | }
|
| | | //去除前后空格
|
| | | text=text.trim();
|
| | |
|
| | | if (text.length() > 256) {
|
| | | out.print(JsonUtil.loadFalseResult("值过长"));
|
| | |
| | | Pattern p = Pattern.compile(URL_REGEX);
|
| | | Matcher matcher = p.matcher(text);
|
| | | if (!matcher.find()) {// 不包含链接
|
| | | // 商品详情
|
| | | // 发现
|
| | | // 没有链接,标题过长也不处理
|
| | | if (text.startsWith("【") && text.contains("】")) {
|
| | | int end = text.indexOf("】");
|
| | | if (end > 2)
|
| | | text = text.substring(1, end);
|
| | | }
|
| | | |
| | | String pattern = "^[A-Za-z0-9]+$";
|
| | | String pattern = "^[A-Za-z0-9-]+$";
|
| | | if (Pattern.matches(pattern, text)) {
|
| | | out.println(JsonUtil.loadFalseResult("不支持推荐"));
|
| | | return;
|