From 6fe21dd11e27c96f5adfae55f85bbce1ef0e3185 Mon Sep 17 00:00:00 2001 From: JSYOO Date: Thu, 2 Dec 2021 17:42:09 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B7=A8=EC=95=BD=EC=A0=90=EC=88=98=EC=A0=95?= =?UTF-8?q?=20,=20=EC=86=8C=EC=9E=A5=EC=9E=90=EB=A3=8C=20=EA=B0=81?= =?UTF-8?q?=EC=9E=90=EB=A3=8C=EC=9C=A0=ED=98=95=EB=B3=84=20=ED=8F=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=8D=94=EB=B3=B4=EA=B8=B0=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/nlib/sch/util/NlibCmmUtil.java | 100 -------------- .../user/service/impl/MemberServiceImpl.java | 20 ++- .../java/nlib/user/web/MemberController.java | 1 - .../jsp/nlib/collection/searchItemDetail.jsp | 128 +++++++++++++++--- 4 files changed, 120 insertions(+), 129 deletions(-) diff --git a/src/main/java/nlib/sch/util/NlibCmmUtil.java b/src/main/java/nlib/sch/util/NlibCmmUtil.java index b1e4d586..2c718228 100644 --- a/src/main/java/nlib/sch/util/NlibCmmUtil.java +++ b/src/main/java/nlib/sch/util/NlibCmmUtil.java @@ -172,14 +172,6 @@ public class NlibCmmUtil { Matcher matcher = pattern.matcher(str); return matcher.find(); } - public static String generateRandomString(String allowed, int length) { - Random random = new Random(); - StringBuilder sb = new StringBuilder(length); - for (int i = 0; i < length; i++) { - sb.append(allowed.charAt(random.nextInt(allowed.length()))); - } - return sb.toString(); - } public static String getIpAddress(HttpServletRequest req) { String ipAddress = ""; if (req.getHeader("X-Forwarded-For") == null) { @@ -317,59 +309,6 @@ public class NlibCmmUtil { str = map.get(key)+""; return str; } - @SuppressWarnings("rawtypes") - public static Integer getInteger(Map map, String key) { - Integer value = null; - if (isEmpty(map, key)) return value; - try { - value = new Integer(map.get(key)+""); - } catch (NumberFormatException e1) { - LOGGER.error("fail in getInteger() key="+key+", map="+map, e1); - } catch (Exception e2) { - LOGGER.error("fail in getInteger() key="+key+", map="+map, e2); - } - return value; - } - @SuppressWarnings("rawtypes") - public static BigDecimal getBigDecimal(Map map, String key) { - BigDecimal value = null; - if (isEmpty(map, key)) return value; - - try { - value = new BigDecimal(map.get(key)+""); - } catch (NumberFormatException e1) { - LOGGER.error("fail in getBigDecimal() key="+key+", map="+map, e1); - } catch (Exception e2) { - LOGGER.error("fail in getBigDecimal() key="+key+", map="+map, e2); - } - return value; - } - public static String getPassStr() { - String str = ""; - Random r = new Random(); - for(int i = 0; i < 10; i++){ - char lowerStr = (char)(r.nextDouble() * 26 + 97); - if(i%2 == 0){ - str += (int)(r.nextDouble() * 10); - }else{ - str += lowerStr; - } - } - return str; - } - public static String getPassStr(int cnt) { - String str = ""; - Random r = new Random(); - for(int i = 0; i < cnt; i++){ - char lowerStr = (char)(r.nextDouble() * 26 + 97); - if(i%2 == 0){ - str += (int)(r.nextDouble() * cnt); - }else{ - str += lowerStr; - } - } - return str; - } public static String getIp(HttpServletRequest request) throws IOException, InvocationTargetException, SQLException, Exception { String ip = request.getHeader("X-Forwarded-For"); @@ -392,45 +331,6 @@ public class NlibCmmUtil { return ip; } - public static boolean checkIPMatching(String pattern, String address) - { - if (pattern.equals("*.*.*.*") || pattern.equals("*")) - return true; - - String[] mask = pattern.split("\\."); - String[] ip_address = address.split("\\."); - for (int i = 0; i < mask.length; i++) - { - if (mask[i].equals("*") || mask[i].equals(ip_address[i])) - continue; - else if (mask[i].contains("-")) - { - byte min = Byte.parseByte(mask[i].split("-")[0]); - byte max = Byte.parseByte(mask[i].split("-")[1]); - byte ip = Byte.parseByte(ip_address[i]); - if (ip < min || ip > max) - return false; - } - else - return false; - } - return true; - } - public static String getRandomNum(int size) { - String strRandom = ""; - Random rand = new Random(); - for (int i = 0; i < size; i++) { - strRandom += String.valueOf(rand.nextInt(10)); - } - return strRandom; - } - public static boolean isMobile(final HttpServletRequest req) { - String ua = StringUtils.defaultString(req.getHeader("User-Agent"), "").toLowerCase(); - if (ua.indexOf(Constant.ANDROID) > -1 || ua.indexOf(Constant.IOS) > -1 || ua.indexOf("mobile") > -1) { - return true; - } - return false; - } public static void setNfsPathModelMap(HttpServletRequest req, ModelMap modelMap){ // ams 경로 String nfsNasPath = getPropertyStr(Constant.NFS_NAS_KEY); diff --git a/src/main/java/nlib/user/service/impl/MemberServiceImpl.java b/src/main/java/nlib/user/service/impl/MemberServiceImpl.java index 991b1d5f..9ea6df95 100644 --- a/src/main/java/nlib/user/service/impl/MemberServiceImpl.java +++ b/src/main/java/nlib/user/service/impl/MemberServiceImpl.java @@ -1,8 +1,10 @@ package nlib.user.service.impl; +import java.security.SecureRandom; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Random; @@ -89,7 +91,7 @@ public class MemberServiceImpl implements MemberService */ public String numberGen(int len, int dupCd ) { - Random rand = new Random(); + SecureRandom rand = new SecureRandom(); String numStr = ""; //난수가 저장될 변수 for(int i=0;i -
  • - 저자 - - -
  • 생산기관 -
  • -
  • - 출판사 - - -
  • -
  • - 생산년도 - - -
  • -
  • - 발간유형 - - -
  • 테마 -
  • -
  • - 발간매체 - - -
  • 시대 -
  • - 청구기호 - - + 생산년도 + -
  • + +
  • + 저자 + - +
  • +
  • + 출판사 + - +
  • +
  • + 발간유형 + - +
  • +
  • + 발간매체 + - +
  • +
  • + 청구기호 + - +
  • +
    + +
  • + 문서번호 + - +
  • +
    + +
  • + 매체 + - +
  • +
  • + 규격 + - +
  • +
  • + 미디어 설명 +
    +
    -
    + +
    +
  • +
  • + 미디어 부가설명 +
    +
    -
    + +
    +
  • +
    + +
  • + 미디어 유형 + - +
  • +
  • + 재생시간 + - +
  • +
  • + 재생화질상태 + - +
  • +
  • + 미디어 설명 +
    +
    -
    + +
    +
  • +
  • + 미디어 부가설명 +
    +
    -
    + +
    +
  • +
    + +
  • + 도면/지도유형 + - +
  • +
  • + 위치(주소) + - +
  • +
    + +
  • + 박물유형 + - +
  • +
  • + 박물형태 + - +
  • +
  • + 재질 + - +
  • +