content: package com.wenmrong.community1.community.cache;
  
  import com.aliyun.oss.common.utils.StringUtils;
  import com.wenmrong.community1.community.dto.TagDTO;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  import java.util.stream.Collectors;
  
  public class TagCache {
      public static List<TagDTO> get(){
          List<TagDTO> tagDTOS = new ArrayList<>();
          TagDTO language = new TagDTO();
          language.setCategoryName("language");
          language.setTags(Arrays.asList("javascript", "php", "css", "html", "html5", "java", "node.js", "python", "c++", "c", "golang", "objective-c", "typescript", "shell", "swift", "c#", "sass", "ruby", "bash", "less", "asp.net", "lua", "scala", "coffeescript", "actionscript", "rust", "erlang", "perl"));
          tagDTOS.add(language);
  
  
          TagDTO framework = new TagDTO();
          framework.setCategoryName("framework");
          framework.setTags(Arrays.asList("laravel", "spring","mybatis", "express", "django", "flask", "yii", "ruby-on-rails", "tornado", "koa", "struts"));
          tagDTOS.add(framework);
  
          TagDTO server = new TagDTO();
          server.setCategoryName("server");
          server.setTags(Arrays.asList("linux", "nginx", "docker", "apache", "ubuntu", "centos", "缓存 tomcat", "负载均衡", "unix", "hadoop", "windows-server"));
          tagDTOS.add(server);
  
          TagDTO db = new TagDTO();
          db.setCategoryName("database");
          db.setTags(Arrays.asList("mysql", "redis", "mongodb", "sql", "oracle", "nosql memcached", "sqlserver", "postgresql", "sqlite"));
          tagDTOS.add(db);
  
          TagDTO tool = new TagDTO();
          tool.setCategoryName("developTool");
          tool.setTags(Arrays.asList("git", "github", "visual-studio-code", "vim", "sublime-text", "xcode intellij-idea", "eclipse", "maven", "ide", "svn", "visual-studio", "atom emacs", "textmate", "hg"));
          tagDTOS.add(tool);
          return tagDTOS;
  
      }
      public static String filterInvalid(String tags) {
          String[] split = tags.split(",");
          List<TagDTO> tagDTOS = get();
  
          List<String> tagList= tagDTOS.stream().flatMap(tag -> tag.getTags().stream()).collect(Collectors.toList());
          String invalid = Arrays.stream(split).filter(t -> !tagList.contains(t)).collect(Collectors.joining(","));
          return invalid;
  
  
      }
  }
  