更改返回标签
This commit is contained in:
@@ -131,18 +131,19 @@ public class UserDao {
|
||||
String sql = "select searchHistory from user where userName=? and isValid = 1";
|
||||
userEntity = runner.query(conn, sql, new BeanHandler<>(userEntity.class),name);
|
||||
l = userEntity.getSearchHistory().split(";");
|
||||
|
||||
for(int i=0;i<l.length;i++)
|
||||
List<String> sss= new ArrayList<>(Arrays.asList(l));
|
||||
for(int i=0;i<sss.size();i++)
|
||||
{
|
||||
if(l[i].equals(str))
|
||||
if(sss.get(i).equals(str))
|
||||
{
|
||||
l[i]="";
|
||||
sss.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
label = String.join(";",l)+";";
|
||||
if(l.length == 1)
|
||||
if(sss.size()!=0)
|
||||
{
|
||||
label = String.join(";",sss)+";";
|
||||
}else{
|
||||
label="";
|
||||
}
|
||||
sql="UPDATE user SET searchHistory = ? WHERE userName= ?";
|
||||
|
@@ -44,7 +44,7 @@ public class selectUserLabelServlet extends HttpServlet {
|
||||
String name = userEntity.getUserName();
|
||||
List<String> stringList = userService.selectLabel(name);
|
||||
if(stringList.get(0).equals("无搜索历史")){
|
||||
writer.println(jsonString);
|
||||
writer.println("null");
|
||||
}
|
||||
else{
|
||||
jsonString = JSONObject.toJSONString(stringList);
|
||||
|
Reference in New Issue
Block a user