CommonConst.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package net.lab1024.smartadmin.constant;
  2. import com.google.common.collect.ImmutableSet;
  3. import org.apache.commons.collections4.CollectionUtils;
  4. import java.util.Set;
  5. /**
  6. *
  7. * [ 通用常量 ]
  8. *
  9. * @version 1.0
  10. * @since JDK1.8
  11. * @author yandanyang
  12. * @company 1024lab.net
  13. * @copyright (c) 2019 1024lab.netInc. All rights reserved.
  14. * @date
  15. */
  16. public class CommonConst {
  17. public static final class Page {
  18. public static final Integer SIZE = 10;
  19. }
  20. public static final class Password {
  21. public static final String DEFAULT = "123456";
  22. public static final String SALT_FORMAT = "smart_%s_admin";
  23. }
  24. public static final String IGNORE_H5_URL_MAPPING = "/h5/api";
  25. public static final class CommonCollection {
  26. public static final Set<String> IGNORE_URL = ImmutableSet.of("/swagger", "Excel");
  27. public static final Set<String> IGNORE_URL_MAPPING = ImmutableSet.of(IGNORE_H5_URL_MAPPING);
  28. public static Boolean contain(Set<String> ignores, String uri) {
  29. if (CollectionUtils.isEmpty(ignores)) {
  30. return false;
  31. }
  32. for (String ignoreUrl : ignores) {
  33. if (uri.startsWith(ignoreUrl)) {
  34. return true;
  35. }
  36. }
  37. return false;
  38. }
  39. }
  40. }