feat:修改文件视频处理类型

dev
wangxy 8 months ago
parent e6395c3828
commit fc5784e92c

@ -1,82 +1,82 @@
/* */ package com.archive.common.constant; package com.archive.common.constant;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class GenConstants public class GenConstants
/* */ { {
/* */ public static final String TPL_CRUD = "crud"; public static final String TPL_CRUD = "crud";
/* */ public static final String TPL_TREE = "tree"; public static final String TPL_TREE = "tree";
/* */ public static final String TPL_SUB = "sub"; public static final String TPL_SUB = "sub";
/* */ public static final String TREE_CODE = "treeCode"; public static final String TREE_CODE = "treeCode";
/* */ public static final String TREE_PARENT_CODE = "treeParentCode"; public static final String TREE_PARENT_CODE = "treeParentCode";
/* */ public static final String TREE_NAME = "treeName"; public static final String TREE_NAME = "treeName";
/* */ public static final String PARENT_MENU_ID = "parentMenuId"; public static final String PARENT_MENU_ID = "parentMenuId";
/* */ public static final String PARENT_MENU_NAME = "parentMenuName"; public static final String PARENT_MENU_NAME = "parentMenuName";
/* 35 */ public static final String[] COLUMNTYPE_STR = new String[] { "char", "varchar", "nvarchar", "varchar2" }; public static final String[] COLUMNTYPE_STR = new String[] { "char", "varchar", "nvarchar", "varchar2" };
/* */
/* */
/* 38 */ public static final String[] COLUMNTYPE_TEXT = new String[] { "tinytext", "text", "mediumtext", "longtext" }; public static final String[] COLUMNTYPE_TEXT = new String[] { "tinytext", "text", "mediumtext", "longtext" };
/* */
/* */
/* 41 */ public static final String[] COLUMNTYPE_TIME = new String[] { "datetime", "time", "date", "timestamp" }; public static final String[] COLUMNTYPE_TIME = new String[] { "datetime", "time", "date", "timestamp" };
/* */
/* */
/* 44 */ public static final String[] COLUMNTYPE_NUMBER = new String[] { "tinyint", "smallint", "mediumint", "int", "number", "integer", "bit", "bigint", "float", "double", "decimal" }; public static final String[] COLUMNTYPE_NUMBER = new String[] { "tinyint", "smallint", "mediumint", "int", "number", "integer", "bit", "bigint", "float", "double", "decimal" };
/* */
/* */
/* */
/* 48 */ public static final String[] COLUMNNAME_NOT_EDIT = new String[] { "id", "create_by", "create_time", "del_flag" }; public static final String[] COLUMNNAME_NOT_EDIT = new String[] { "id", "create_by", "create_time", "del_flag" };
/* */
/* */
/* 51 */ public static final String[] COLUMNNAME_NOT_LIST = new String[] { "id", "create_by", "create_time", "del_flag", "update_by", "update_time" }; public static final String[] COLUMNNAME_NOT_LIST = new String[] { "id", "create_by", "create_time", "del_flag", "update_by", "update_time" };
/* */
/* */
/* */
/* 55 */ public static final String[] COLUMNNAME_NOT_QUERY = new String[] { "id", "create_by", "create_time", "del_flag", "update_by", "update_time", "remark" }; public static final String[] COLUMNNAME_NOT_QUERY = new String[] { "id", "create_by", "create_time", "del_flag", "update_by", "update_time", "remark" };
/* */
/* */
/* */
/* 59 */ public static final String[] BASE_ENTITY = new String[] { "createBy", "createTime", "updateBy", "updateTime", "remark" }; public static final String[] BASE_ENTITY = new String[] { "createBy", "createTime", "updateBy", "updateTime", "remark" };
/* */
/* */
/* 62 */ public static final String[] TREE_ENTITY = new String[] { "parentName", "parentId", "orderNum", "ancestors" }; public static final String[] TREE_ENTITY = new String[] { "parentName", "parentId", "orderNum", "ancestors" };
/* */ public static final String HTML_INPUT = "input"; public static final String HTML_INPUT = "input";
/* */ public static final String HTML_TEXTAREA = "textarea"; public static final String HTML_TEXTAREA = "textarea";
/* */ public static final String HTML_SELECT = "select"; public static final String HTML_SELECT = "select";
/* */ public static final String HTML_RADIO = "radio"; public static final String HTML_RADIO = "radio";
/* */ public static final String HTML_CHECKBOX = "checkbox"; public static final String HTML_CHECKBOX = "checkbox";
/* */ public static final String HTML_DATETIME = "datetime"; public static final String HTML_DATETIME = "datetime";
/* */ public static final String HTML_UPLOAD = "upload"; public static final String HTML_UPLOAD = "upload";
/* */ public static final String HTML_SUMMERNOTE = "summernote"; public static final String HTML_SUMMERNOTE = "summernote";
/* */ public static final String TYPE_STRING = "String"; public static final String TYPE_STRING = "String";
/* */ public static final String TYPE_INTEGER = "Integer"; public static final String TYPE_INTEGER = "Integer";
/* */ public static final String TYPE_LONG = "Long"; public static final String TYPE_LONG = "Long";
/* */ public static final String TYPE_DOUBLE = "Double"; public static final String TYPE_DOUBLE = "Double";
/* */ public static final String TYPE_BIGDECIMAL = "BigDecimal"; public static final String TYPE_BIGDECIMAL = "BigDecimal";
/* */ public static final String TYPE_DATE = "Date"; public static final String TYPE_DATE = "Date";
/* */ public static final String QUERY_LIKE = "LIKE"; public static final String QUERY_LIKE = "LIKE";
/* */ public static final String REQUIRE = "1"; public static final String REQUIRE = "1";
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\constant\GenConstants.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\constant\GenConstants.class

@ -1,53 +1,53 @@
/* */ package com.archive.common.convert; package com.archive.common.convert;
/* */
/* */ import java.io.File; import java.io.File;
/* */ import java.io.FileOutputStream; import java.io.FileOutputStream;
/* */ import java.io.OutputStream; import java.io.OutputStream;
/* */ import org.xhtmlrenderer.pdf.ITextFontResolver; import org.xhtmlrenderer.pdf.ITextFontResolver;
/* */ import org.xhtmlrenderer.pdf.ITextRenderer; import org.xhtmlrenderer.pdf.ITextRenderer;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class HtmlToPdf public class HtmlToPdf
/* */ { {
/* */ public static void html2pdf(String htmlFile, String pdfFile) throws Exception { public static void html2pdf(String htmlFile, String pdfFile) throws Exception {
/* 21 */ String url = (new File(htmlFile)).toURI().toURL().toString(); String url = (new File(htmlFile)).toURI().toURL().toString();
/* 22 */ System.out.println(url); System.out.println(url);
/* */
/* 24 */ OutputStream os = new FileOutputStream(pdfFile); OutputStream os = new FileOutputStream(pdfFile);
/* 25 */ ITextRenderer renderer = new ITextRenderer(); ITextRenderer renderer = new ITextRenderer();
/* 26 */ renderer.setDocument(url); renderer.setDocument(url);
/* */
/* */
/* 29 */ ITextFontResolver fontResolver = renderer.getFontResolver(); ITextFontResolver fontResolver = renderer.getFontResolver();
/* 30 */ if ("linux".equals(getCurrentOperatingSystem())) { if ("linux".equals(getCurrentOperatingSystem())) {
/* 31 */ fontResolver.addFont("/usr/share/fonts/chiness/simsun.ttc", "Identity-H", true); fontResolver.addFont("/usr/share/fonts/chiness/simsun.ttc", "Identity-H", true);
/* */ } else { } else {
/* 33 */ fontResolver.addFont("c:/Windows/Fonts/simsun.ttc", "Identity-H", false); fontResolver.addFont("c:/Windows/Fonts/simsun.ttc", "Identity-H", false);
/* */ } }
/* */
/* 36 */ renderer.layout(); renderer.layout();
/* 37 */ renderer.createPDF(os); renderer.createPDF(os);
/* 38 */ os.close(); os.close();
/* */
/* 40 */ System.out.println("create pdf done!!"); System.out.println("create pdf done!!");
/* */ } }
/* */
/* */
/* */ public static String getCurrentOperatingSystem() { public static String getCurrentOperatingSystem() {
/* 45 */ String os = System.getProperty("os.name").toLowerCase(); String os = System.getProperty("os.name").toLowerCase();
/* 46 */ System.out.println("---------当前操作系统是-----------" + os); System.out.println("---------当前操作系统是-----------" + os);
/* 47 */ return os; return os;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\convert\HtmlToPdf.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\convert\HtmlToPdf.class

@ -1,393 +1,393 @@
/* */ package com.archive.common.convert; package com.archive.common.convert;
/* */
/* */ import com.lowagie.text.Document; import com.lowagie.text.Document;
/* */ import com.lowagie.text.Element; import com.lowagie.text.Element;
/* */ import com.lowagie.text.Image; import com.lowagie.text.Image;
/* */ import com.lowagie.text.Rectangle; import com.lowagie.text.Rectangle;
/* */ import com.lowagie.text.pdf.PdfWriter; import com.lowagie.text.pdf.PdfWriter;
/* */ import java.awt.AlphaComposite; import java.awt.AlphaComposite;
/* */ import java.awt.Color; import java.awt.Color;
/* */ import java.awt.Font; import java.awt.Font;
/* */ import java.awt.Graphics; import java.awt.Graphics;
/* */ import java.awt.Graphics2D; import java.awt.Graphics2D;
/* */
/* */ import java.awt.RenderingHints; import java.awt.RenderingHints;
/* */ import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
/* */ import java.io.File; import java.io.File;
/* */ import java.io.FileOutputStream; import java.io.FileOutputStream;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import java.text.DecimalFormat; import java.text.DecimalFormat;
/* */ import java.util.ArrayList; import java.util.ArrayList;
/* */ import java.util.Arrays; import java.util.Arrays;
/* */ import javax.imageio.ImageIO; import javax.imageio.ImageIO;
/* */ import javax.swing.ImageIcon; import javax.swing.ImageIcon;
/* */
/* */ public class ImgConvert public class ImgConvert
/* */ { {
/* */ public static void ImagesToPdf(String imageFolderPath, String pdfPath) { public static void ImagesToPdf(String imageFolderPath, String pdfPath) {
/* */ try { try {
/* 29 */ long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
/* 30 */ ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
/* */
/* 32 */ String imagePath = null; String imagePath = null;
/* 33 */ FileOutputStream fos = new FileOutputStream(pdfPath); FileOutputStream fos = new FileOutputStream(pdfPath);
/* */
/* 35 */ Document doc = new Document(null, 20.0F, 20.0F, 20.0F, 20.0F); Document doc = new Document(null, 20.0F, 20.0F, 20.0F, 20.0F);
/* */
/* 37 */ PdfWriter.getInstance(doc, fos); PdfWriter.getInstance(doc, fos);
/* */
/* */
/* */
/* */
/* */
/* 43 */ File file = new File(imageFolderPath); File file = new File(imageFolderPath);
/* 44 */ File[] files = file.listFiles(); File[] files = file.listFiles();
/* */
/* 46 */ for (File file1 : files) { for (File file1 : files) {
/* 47 */ if (file1.getName().endsWith(".png") || file1.getName().endsWith(".jpg") || file1.getName().endsWith(".gif") || file1 if (file1.getName().endsWith(".png") || file1.getName().endsWith(".jpg") || file1.getName().endsWith(".gif") || file1
/* 48 */ .getName().endsWith(".jpeg") || file1.getName().endsWith(".tif")) { .getName().endsWith(".jpeg") || file1.getName().endsWith(".tif")) {
/* 49 */ imagePath = imageFolderPath + File.separator + file1.getName(); imagePath = imageFolderPath + File.separator + file1.getName();
/* 50 */ list.add(file1.getName()); list.add(file1.getName());
/* */
/* 52 */ BufferedImage img = ImageIO.read(new File(imagePath)); BufferedImage img = ImageIO.read(new File(imagePath));
/* */
/* 54 */ doc.setPageSize(new Rectangle(img.getWidth(), img.getHeight())); doc.setPageSize(new Rectangle(img.getWidth(), img.getHeight()));
/* */
/* 56 */ Image image = Image.getInstance(imagePath); Image image = Image.getInstance(imagePath);
/* */
/* 58 */ doc.open(); doc.open();
/* 59 */ doc.add((Element)image); doc.add((Element)image);
/* */ } }
/* */ } }
/* */
/* */
/* 64 */ doc.close(); doc.close();
/* 65 */ long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
/* 66 */ int time = (int)((endTime - start) / 1000L); int time = (int)((endTime - start) / 1000L);
/* 67 */ System.out.println("用时:{" + time + "}:秒!"); System.out.println("用时:{" + time + "}:秒!");
/* 68 */ } catch (Exception e) { } catch (Exception e) {
/* 69 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void ImgToPdf(String imagePath, String pdfPath) { public static void ImgToPdf(String imagePath, String pdfPath) {
/* */ try { try {
/* 81 */ long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
/* 82 */ ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
/* */
/* */
/* 85 */ FileOutputStream fos = new FileOutputStream(pdfPath); FileOutputStream fos = new FileOutputStream(pdfPath);
/* */
/* 87 */ Document doc = new Document(null, 20.0F, 20.0F, 20.0F, 20.0F); Document doc = new Document(null, 20.0F, 20.0F, 20.0F, 20.0F);
/* */
/* 89 */ PdfWriter.getInstance(doc, fos); PdfWriter.getInstance(doc, fos);
/* */
/* */
/* */
/* */
/* */
/* 95 */ BufferedImage img = ImageIO.read(new File(imagePath)); BufferedImage img = ImageIO.read(new File(imagePath));
/* */
/* 97 */ doc.setPageSize(new Rectangle(img.getWidth(), img.getHeight())); doc.setPageSize(new Rectangle(img.getWidth(), img.getHeight()));
/* */
/* 99 */ Image image = Image.getInstance(imagePath); Image image = Image.getInstance(imagePath);
/* */
/* 101 */ doc.open(); doc.open();
/* 102 */ doc.add((Element)image); doc.add((Element)image);
/* */
/* */
/* */
/* 106 */ doc.close(); doc.close();
/* 107 */ long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
/* 108 */ int time = (int)((endTime - start) / 1000L); int time = (int)((endTime - start) / 1000L);
/* 109 */ System.out.println("用时:{" + time + "}:秒!"); System.out.println("用时:{" + time + "}:秒!");
/* 110 */ } catch (Exception e) { } catch (Exception e) {
/* 111 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void PngToJpg(String pngPath, String jpgPath) { public static void PngToJpg(String pngPath, String jpgPath) {
/* */ try { try {
/* 125 */ BufferedImage bufferedImage = ImageIO.read(new File(pngPath)); BufferedImage bufferedImage = ImageIO.read(new File(pngPath));
/* 126 */ BufferedImage newBufferedImage = new BufferedImage(bufferedImage.getWidth(), bufferedImage.getHeight(), 1); BufferedImage newBufferedImage = new BufferedImage(bufferedImage.getWidth(), bufferedImage.getHeight(), 1);
/* 127 */ newBufferedImage.createGraphics().drawImage(bufferedImage, 0, 0, Color.white, null); newBufferedImage.createGraphics().drawImage(bufferedImage, 0, 0, Color.white, null);
/* 128 */ ImageIO.write(newBufferedImage, "jpg", new File(jpgPath)); ImageIO.write(newBufferedImage, "jpg", new File(jpgPath));
/* 129 */ } catch (Exception e) { } catch (Exception e) {
/* 130 */ System.out.println("ERROR:png转jpg出现异常:" + e.getMessage()); System.out.println("ERROR:png转jpg出现异常:" + e.getMessage());
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void JpgToPng(String jpgPath, String pngPath) { public static void JpgToPng(String jpgPath, String pngPath) {
/* */ try { try {
/* 144 */ BufferedImage bufferedImage = ImageIO.read(new File(jpgPath)); BufferedImage bufferedImage = ImageIO.read(new File(jpgPath));
/* 145 */ BufferedImage newBufferedImage = new BufferedImage(bufferedImage.getWidth(), bufferedImage.getHeight(), 1); BufferedImage newBufferedImage = new BufferedImage(bufferedImage.getWidth(), bufferedImage.getHeight(), 1);
/* 146 */ newBufferedImage.createGraphics().drawImage(bufferedImage, 0, 0, Color.white, null); newBufferedImage.createGraphics().drawImage(bufferedImage, 0, 0, Color.white, null);
/* 147 */ ImageIO.write(newBufferedImage, "png", new File(pngPath)); ImageIO.write(newBufferedImage, "png", new File(pngPath));
/* 148 */ } catch (Exception e) { } catch (Exception e) {
/* 149 */ System.out.println("ERROR:jpg转png出现异常:" + e.getMessage()); System.out.println("ERROR:jpg转png出现异常:" + e.getMessage());
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static BufferedImage waterMarkByText(int width, int heigth, String text, Color color, Font font, Double degree, float alpha) { public static BufferedImage waterMarkByText(int width, int heigth, String text, Color color, Font font, Double degree, float alpha) {
/* 167 */ BufferedImage buffImg = new BufferedImage(width, heigth, 1); BufferedImage buffImg = new BufferedImage(width, heigth, 1);
/* */
/* 169 */ Graphics2D g2d = buffImg.createGraphics(); Graphics2D g2d = buffImg.createGraphics();
/* */
/* */
/* 172 */ buffImg = g2d.getDeviceConfiguration().createCompatibleImage(width, heigth, 3); buffImg = g2d.getDeviceConfiguration().createCompatibleImage(width, heigth, 3);
/* 173 */ g2d.dispose(); g2d.dispose();
/* 174 */ g2d = buffImg.createGraphics(); g2d = buffImg.createGraphics();
/* */
/* */
/* */
/* 178 */ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 186 */ if (null != degree) if (null != degree)
/* */ { {
/* */
/* 189 */ g2d.rotate(Math.toRadians(degree.doubleValue()), buffImg.getWidth() / 2.0D, buffImg g2d.rotate(Math.toRadians(degree.doubleValue()), buffImg.getWidth() / 2.0D, buffImg
/* 190 */ .getHeight() / 2.0D); .getHeight() / 2.0D);
/* */ } }
/* */
/* */
/* 194 */ g2d.setColor(color); g2d.setColor(color);
/* */
/* */
/* 197 */ g2d.setFont(font); g2d.setFont(font);
/* */
/* */
/* 200 */ g2d.setComposite(AlphaComposite.getInstance(3, alpha)); g2d.setComposite(AlphaComposite.getInstance(3, alpha));
/* */
/* 202 */ float realWidth = getRealFontWidth(text); float realWidth = getRealFontWidth(text);
/* 203 */ float fontSize = font.getSize(); float fontSize = font.getSize();
/* */
/* */
/* 206 */ float x = 0.5F * width - 0.5F * fontSize * realWidth; float x = 0.5F * width - 0.5F * fontSize * realWidth;
/* 207 */ float y = 0.5F * heigth + 0.5F * fontSize; float y = 0.5F * heigth + 0.5F * fontSize;
/* */
/* 209 */ g2d.drawString(text, x, y); g2d.drawString(text, x, y);
/* */
/* 211 */ g2d.dispose(); g2d.dispose();
/* */
/* 213 */ return buffImg; return buffImg;
/* */ } }
/* */
/* */
/* */
/* */ public static BufferedImage waterMarkByText(int width, int heigth, String text, Color color, float alpha) { public static BufferedImage waterMarkByText(int width, int heigth, String text, Color color, float alpha) {
/* 219 */ Font font = new Font("Dialog", 0, 33); Font font = new Font("Dialog", 0, 33);
/* 220 */ return waterMarkByText(width, heigth, text, color, font, Double.valueOf(-30.0D), alpha); return waterMarkByText(width, heigth, text, color, font, Double.valueOf(-30.0D), alpha);
/* */ } }
/* */
/* */ public static BufferedImage waterMarkByText(int width, int heigth, String text, float alpha) { public static BufferedImage waterMarkByText(int width, int heigth, String text, float alpha) {
/* 224 */ return waterMarkByText(width, heigth, text, Color.GRAY, alpha); return waterMarkByText(width, heigth, text, Color.GRAY, alpha);
/* */ } }
/* */
/* */
/* */ public static BufferedImage waterMarkByText(int width, int heigth, String text) { public static BufferedImage waterMarkByText(int width, int heigth, String text) {
/* 229 */ return waterMarkByText(width, heigth, text, 0.2F); return waterMarkByText(width, heigth, text, 0.2F);
/* */ } }
/* */
/* */ public static BufferedImage waterMarkByText(String text) { public static BufferedImage waterMarkByText(String text) {
/* 233 */ return waterMarkByText(200, 150, text); return waterMarkByText(200, 150, text);
/* */ } }
/* */
/* */
/* */
/* */
/* */ private static float getRealFontWidth(String text) { private static float getRealFontWidth(String text) {
/* 240 */ int len = text.length(); int len = text.length();
/* 241 */ float width = 0.0F; float width = 0.0F;
/* 242 */ for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
/* 243 */ if (text.charAt(i) < 'Ā') { if (text.charAt(i) < 'Ā') {
/* 244 */ width += 0.5F; width += 0.5F;
/* */ } else { } else {
/* 246 */ width++; width++;
/* */ } }
/* */ } }
/* 249 */ return width; return width;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void changeImgColor(String path, String newPath) throws IOException { public static void changeImgColor(String path, String newPath) throws IOException {
/* 263 */ File file = new File(path); File file = new File(path);
/* 264 */ BufferedImage bi = ImageIO.read(file); BufferedImage bi = ImageIO.read(file);
/* 265 */ java.awt.Image image = bi; java.awt.Image image = bi;
/* */
/* 267 */ ImageIcon imageIcon = new ImageIcon(image); ImageIcon imageIcon = new ImageIcon(image);
/* 268 */ int width = imageIcon.getIconWidth(); int width = imageIcon.getIconWidth();
/* 269 */ int height = imageIcon.getIconHeight(); int height = imageIcon.getIconHeight();
/* */
/* 271 */ BufferedImage bufferedImage = new BufferedImage(width, height, 6); BufferedImage bufferedImage = new BufferedImage(width, height, 6);
/* 272 */ Graphics2D graphics2D = (Graphics2D)bufferedImage.getGraphics(); Graphics2D graphics2D = (Graphics2D)bufferedImage.getGraphics();
/* 273 */ graphics2D.drawImage(imageIcon.getImage(), 0, 0, imageIcon.getImageObserver()); graphics2D.drawImage(imageIcon.getImage(), 0, 0, imageIcon.getImageObserver());
/* 274 */ int alpha = 255; int alpha = 255;
/* */
/* 276 */ int RGB = bufferedImage.getRGB(width - 1, height - 1); int RGB = bufferedImage.getRGB(width - 1, height - 1);
/* 277 */ for (int i = bufferedImage.getMinX(); i < width; i++) { for (int i = bufferedImage.getMinX(); i < width; i++) {
/* 278 */ for (int j = bufferedImage.getMinY(); j < height; j++) { for (int j = bufferedImage.getMinY(); j < height; j++) {
/* 279 */ int rgb = bufferedImage.getRGB(i, j); int rgb = bufferedImage.getRGB(i, j);
/* 280 */ int r = (rgb & 0xFF0000) >> 16; int r = (rgb & 0xFF0000) >> 16;
/* 281 */ int g = (rgb & 0xFF00) >> 8; int g = (rgb & 0xFF00) >> 8;
/* 282 */ int b = rgb & 0xFF; int b = rgb & 0xFF;
/* 283 */ int R = (RGB & 0xFF0000) >> 16; int R = (RGB & 0xFF0000) >> 16;
/* 284 */ int G = (RGB & 0xFF00) >> 8; int G = (RGB & 0xFF00) >> 8;
/* 285 */ int B = RGB & 0xFF; int B = RGB & 0xFF;
/* */
/* 287 */ int a = 45; int a = 45;
/* 288 */ if (Math.abs(R - r) < a && Math.abs(G - g) < a && Math.abs(B - b) < a) { if (Math.abs(R - r) < a && Math.abs(G - g) < a && Math.abs(B - b) < a) {
/* 289 */ alpha = 0; alpha = 0;
/* */ } else { } else {
/* 291 */ alpha = 255; alpha = 255;
/* */ } }
/* 293 */ rgb = alpha << 24 | rgb & 0xFFFFFF; rgb = alpha << 24 | rgb & 0xFFFFFF;
/* 294 */ bufferedImage.setRGB(i, j, rgb); bufferedImage.setRGB(i, j, rgb);
/* */ } }
/* */ } }
/* 297 */ ImageIO.write(bufferedImage, "png", new File(newPath)); ImageIO.write(bufferedImage, "png", new File(newPath));
/* */ } }
/* */
/* */ public static String convertRgbStr(int color) { public static String convertRgbStr(int color) {
/* 301 */ int red = (color & 0xFF0000) >> 16; int red = (color & 0xFF0000) >> 16;
/* 302 */ int green = (color & 0xFF00) >> 8; int green = (color & 0xFF00) >> 8;
/* 303 */ int blue = color & 0xFF; int blue = color & 0xFF;
/* 304 */ return red + "," + green + "," + blue; return red + "," + green + "," + blue;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String thumbnailImage(String imagePath, int w, int h, String prevfix, boolean force) { public static String thumbnailImage(String imagePath, int w, int h, String prevfix, boolean force) {
/* 317 */ File imgFile = new File(imagePath); File imgFile = new File(imagePath);
/* 318 */ String newPath = ""; String newPath = "";
/* 319 */ if (imgFile.exists()) { if (imgFile.exists()) {
/* */
/* */ try { try {
/* 322 */ String types = Arrays.toString((Object[])ImageIO.getReaderFormatNames()); String types = Arrays.toString((Object[])ImageIO.getReaderFormatNames());
/* 323 */ String suffix = null; String suffix = null;
/* */
/* 325 */ if (imgFile.getName().indexOf(".") > -1) { if (imgFile.getName().indexOf(".") > -1) {
/* 326 */ suffix = imgFile.getName().substring(imgFile.getName().lastIndexOf(".") + 1); suffix = imgFile.getName().substring(imgFile.getName().lastIndexOf(".") + 1);
/* */ } }
/* */
/* 329 */ if (suffix == null || types.toLowerCase().indexOf(suffix.toLowerCase()) < 0) { if (suffix == null || types.toLowerCase().indexOf(suffix.toLowerCase()) < 0) {
/* 330 */ System.out.println("Sorry, the image suffix is illegal. the standard image suffix is {}." + types); System.out.println("Sorry, the image suffix is illegal. the standard image suffix is {}." + types);
/* 331 */ return newPath; return newPath;
/* */ } }
/* 333 */ System.out.println("target image's size, width:{" + w + "}, height:{" + h + "}."); System.out.println("target image's size, width:{" + w + "}, height:{" + h + "}.");
/* 334 */ java.awt.Image img = ImageIO.read(imgFile); java.awt.Image img = ImageIO.read(imgFile);
/* 335 */ if (!force) { if (!force) {
/* */
/* 337 */ int width = img.getWidth(null); int width = img.getWidth(null);
/* 338 */ int height = img.getHeight(null); int height = img.getHeight(null);
/* 339 */ if (width * 1.0D / w < height * 1.0D / h) { if (width * 1.0D / w < height * 1.0D / h) {
/* 340 */ if (width > w) { if (width > w) {
/* 341 */ h = Integer.parseInt((new DecimalFormat("0")).format((height * w) / width * 1.0D)); h = Integer.parseInt((new DecimalFormat("0")).format((height * w) / width * 1.0D));
/* 342 */ System.out.println("change image's height, width:{" + w + "}, height:{" + h + "}."); System.out.println("change image's height, width:{" + w + "}, height:{" + h + "}.");
/* */ } }
/* */
/* 345 */ } else if (height > h) { } else if (height > h) {
/* 346 */ w = Integer.parseInt((new DecimalFormat("0")).format((width * h) / height * 1.0D)); w = Integer.parseInt((new DecimalFormat("0")).format((width * h) / height * 1.0D));
/* 347 */ System.out.println("change image's width, width:{" + w + "}, height:{" + h + "}."); System.out.println("change image's width, width:{" + w + "}, height:{" + h + "}.");
/* */ } }
/* */ } }
/* */
/* 351 */ BufferedImage bi = new BufferedImage(w, h, 1); BufferedImage bi = new BufferedImage(w, h, 1);
/* 352 */ Graphics g = bi.getGraphics(); Graphics g = bi.getGraphics();
/* 353 */ g.drawImage(img, 0, 0, w, h, Color.LIGHT_GRAY, null); g.drawImage(img, 0, 0, w, h, Color.LIGHT_GRAY, null);
/* 354 */ g.dispose(); g.dispose();
/* 355 */ String p = imgFile.getPath(); String p = imgFile.getPath();
/* */
/* 357 */ newPath = p.substring(0, p.lastIndexOf(File.separator)) + File.separator + prevfix + imgFile.getName(); newPath = p.substring(0, p.lastIndexOf(File.separator)) + File.separator + prevfix + imgFile.getName();
/* 358 */ ImageIO.write(bi, suffix, new File(newPath)); ImageIO.write(bi, suffix, new File(newPath));
/* 359 */ System.out.println("缩略图在原路径下生成成功"); System.out.println("缩略图在原路径下生成成功");
/* 360 */ } catch (IOException e) { } catch (IOException e) {
/* 361 */ System.out.println("generate thumbnail image failed." + e); System.out.println("generate thumbnail image failed." + e);
/* */ } }
/* */ } else { } else {
/* 364 */ System.out.println("the image is not exist."); System.out.println("the image is not exist.");
/* */ } }
/* 366 */ return newPath; return newPath;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void main(String[] args) { public static void main(String[] args) {
/* */ try { try {
/* 383 */ changeImgColor("F:\\FFOutput\\profile.png", "F:\\FFOutput\\profile1.png"); changeImgColor("F:\\FFOutput\\profile.png", "F:\\FFOutput\\profile1.png");
/* 384 */ } catch (IOException e) { } catch (IOException e) {
/* 385 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\convert\ImgConvert.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\convert\ImgConvert.class

@ -1,21 +1,21 @@
/* */ package com.archive.common.exception.file; package com.archive.common.exception.file;
/* */
/* */ import com.archive.common.exception.base.BaseException; import com.archive.common.exception.base.BaseException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class FileException public class FileException
/* */ extends BaseException extends BaseException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */
/* */ public FileException(String code, Object[] args) { public FileException(String code, Object[] args) {
/* 16 */ super("file", code, args, null); super("file", code, args, null);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\FileException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\FileException.class

@ -1,19 +1,19 @@
/* */ package com.archive.common.exception.file; package com.archive.common.exception.file;
/* */
/* */ import com.archive.common.exception.file.FileException; import com.archive.common.exception.file.FileException;
/* */
/* */
/* */
/* */
/* */ public class FileNameLengthLimitExceededException public class FileNameLengthLimitExceededException
/* */ extends FileException extends FileException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */
/* */ public FileNameLengthLimitExceededException(int defaultFileNameLength) { public FileNameLengthLimitExceededException(int defaultFileNameLength) {
/* 14 */ super("upload.filename.exceed.length", new Object[] { Integer.valueOf(defaultFileNameLength) }); super("upload.filename.exceed.length", new Object[] { Integer.valueOf(defaultFileNameLength) });
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\FileNameLengthLimitExceededException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\FileNameLengthLimitExceededException.class

@ -1,19 +1,19 @@
/* */ package com.archive.common.exception.file; package com.archive.common.exception.file;
/* */
/* */ import com.archive.common.exception.file.FileException; import com.archive.common.exception.file.FileException;
/* */
/* */
/* */
/* */
/* */ public class FileSizeLimitExceededException public class FileSizeLimitExceededException
/* */ extends FileException extends FileException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */
/* */ public FileSizeLimitExceededException(long defaultMaxSize) { public FileSizeLimitExceededException(long defaultMaxSize) {
/* 14 */ super("upload.exceed.maxSize", new Object[] { Long.valueOf(defaultMaxSize) }); super("upload.exceed.maxSize", new Object[] { Long.valueOf(defaultMaxSize) });
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\FileSizeLimitExceededException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\FileSizeLimitExceededException.class

@ -1,44 +1,44 @@
/* */ package com.archive.common.exception.file; package com.archive.common.exception.file;
/* */
/* */ import java.util.Arrays; import java.util.Arrays;
/* */ import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.FileUploadException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class InvalidExtensionException public class InvalidExtensionException
/* */ extends FileUploadException extends FileUploadException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */ private String[] allowedExtension; private String[] allowedExtension;
/* */ private String extension; private String extension;
/* */ private String filename; private String filename;
/* */
/* */ public InvalidExtensionException(String[] allowedExtension, String extension, String filename) { public InvalidExtensionException(String[] allowedExtension, String extension, String filename) {
/* 21 */ super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString((Object[])allowedExtension) + "]"); super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString((Object[])allowedExtension) + "]");
/* 22 */ this.allowedExtension = allowedExtension; this.allowedExtension = allowedExtension;
/* 23 */ this.extension = extension; this.extension = extension;
/* 24 */ this.filename = filename; this.filename = filename;
/* */ } }
/* */
/* */
/* */ public String[] getAllowedExtension() { public String[] getAllowedExtension() {
/* 29 */ return this.allowedExtension; return this.allowedExtension;
/* */ } }
/* */
/* */
/* */ public String getExtension() { public String getExtension() {
/* 34 */ return this.extension; return this.extension;
/* */ } }
/* */
/* */
/* */ public String getFilename() { public String getFilename() {
/* 39 */ return this.filename; return this.filename;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException.class

@ -1,53 +1,53 @@
/* */ package com.archive.common.exception.file; package com.archive.common.exception.file;
/* */
/* */ import com.archive.common.exception.file.InvalidExtensionException; import com.archive.common.exception.file.InvalidExtensionException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class InvalidImageExtensionException public class InvalidImageExtensionException
/* */ extends InvalidExtensionException extends InvalidExtensionException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */
/* */ public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) { public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) {
/* 48 */ super(allowedExtension, extension, filename); super(allowedExtension, extension, filename);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException$InvalidImageExtensionException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException$InvalidImageExtensionException.class

@ -1,73 +1,73 @@
/* */ package com.archive.common.exception.file; package com.archive.common.exception.file;
/* */
/* */ import com.archive.common.exception.file.InvalidExtensionException; import com.archive.common.exception.file.InvalidExtensionException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class InvalidMediaExtensionException public class InvalidMediaExtensionException
/* */ extends InvalidExtensionException extends InvalidExtensionException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */
/* */ public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) { public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) {
/* 68 */ super(allowedExtension, extension, filename); super(allowedExtension, extension, filename);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException$InvalidMediaExtensionException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException$InvalidMediaExtensionException.class

@ -1,83 +1,83 @@
/* */ package com.archive.common.exception.file; package com.archive.common.exception.file;
/* */
/* */ import com.archive.common.exception.file.InvalidExtensionException; import com.archive.common.exception.file.InvalidExtensionException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class InvalidVideoExtensionException public class InvalidVideoExtensionException
/* */ extends InvalidExtensionException extends InvalidExtensionException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */
/* */ public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename) { public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename) {
/* 78 */ super(allowedExtension, extension, filename); super(allowedExtension, extension, filename);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException$InvalidVideoExtensionException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\file\InvalidExtensionException$InvalidVideoExtensionException.class

@ -1,58 +1,58 @@
/* */ package com.archive.common.ocr; package com.archive.common.ocr;
/* */
/* */ import com.archive.common.convert.ImgConvert; import com.archive.common.convert.ImgConvert;
/* */ import java.io.File; import java.io.File;
/* */ import net.sourceforge.tess4j.Tesseract; import net.sourceforge.tess4j.Tesseract;
/* */ import net.sourceforge.tess4j.util.LoadLibs; import net.sourceforge.tess4j.util.LoadLibs;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ImageOcr public class ImageOcr
/* */ { {
/* */ public static String ImageOcr(String imagPath) { public static String ImageOcr(String imagPath) {
/* 18 */ String res = ""; String res = "";
/* */ try { try {
/* 20 */ String pngPath = ""; String pngPath = "";
/* */
/* 22 */ if (imagPath.contains(".jpg") || imagPath.contains(".jpeg")) { if (imagPath.contains(".jpg") || imagPath.contains(".jpeg")) {
/* 23 */ File fil = new File(imagPath); File fil = new File(imagPath);
/* */
/* 25 */ pngPath = fil.getParentFile().getPath() + File.separator + fil.getName().replace(".jpg", ".png").replace(".jpeg", ".png"); pngPath = fil.getParentFile().getPath() + File.separator + fil.getName().replace(".jpg", ".png").replace(".jpeg", ".png");
/* 26 */ ImgConvert.JpgToPng(imagPath, pngPath); ImgConvert.JpgToPng(imagPath, pngPath);
/* */ } }
/* */
/* */
/* 30 */ Tesseract tesseract = new Tesseract(); Tesseract tesseract = new Tesseract();
/* */
/* 32 */ File tessDataFolder = LoadLibs.extractTessResources("tessdata"); File tessDataFolder = LoadLibs.extractTessResources("tessdata");
/* 33 */ tesseract.setDatapath(tessDataFolder.getAbsolutePath()); tesseract.setDatapath(tessDataFolder.getAbsolutePath());
/* */
/* 35 */ tesseract.setLanguage("chi_sim"); tesseract.setLanguage("chi_sim");
/* */
/* 37 */ String result = ""; String result = "";
/* 38 */ if (pngPath.equals("")) { if (pngPath.equals("")) {
/* 39 */ result = tesseract.doOCR(new File(imagPath)); result = tesseract.doOCR(new File(imagPath));
/* */ } else { } else {
/* 41 */ result = tesseract.doOCR(new File(pngPath)); result = tesseract.doOCR(new File(pngPath));
/* */ } }
/* */
/* 44 */ res = result.replaceAll("\\r|\\n", "-").replaceAll(" ", ""); res = result.replaceAll("\\r|\\n", "-").replaceAll(" ", "");
/* 45 */ } catch (Exception ex) { } catch (Exception ex) {
/* 46 */ System.out.println("图片OCR出现异常:" + ex.getMessage()); System.out.println("图片OCR出现异常:" + ex.getMessage());
/* */
/* */
/* 49 */ if (ex.getMessage().equals("javax.imageio.IIOException: JFIF APP0 must be first marker after SOI")); if (ex.getMessage().equals("javax.imageio.IIOException: JFIF APP0 must be first marker after SOI"));
/* */ } }
/* */
/* */
/* 53 */ return res; return res;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\ocr\ImageOcr.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\ocr\ImageOcr.class

@ -1,79 +1,79 @@
/* */ package com.archive.common.utils.file; package com.archive.common.utils.file;
/* */
/* */ import java.io.File; import java.io.File;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class FileTypeUtils public class FileTypeUtils
/* */ { {
/* */ public static String getFileType(File file) { public static String getFileType(File file) {
/* 23 */ if (null == file) if (null == file)
/* */ { {
/* 25 */ return ""; return "";
/* */ } }
/* 27 */ return getFileType(file.getName()); return getFileType(file.getName());
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getFileType(String fileName) { public static String getFileType(String fileName) {
/* 40 */ int separatorIndex = fileName.lastIndexOf("."); int separatorIndex = fileName.lastIndexOf(".");
/* 41 */ if (separatorIndex < 0) if (separatorIndex < 0)
/* */ { {
/* 43 */ return ""; return "";
/* */ } }
/* 45 */ return fileName.substring(separatorIndex + 1).toLowerCase(); return fileName.substring(separatorIndex + 1).toLowerCase();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getFileExtendName(byte[] photoByte) { public static String getFileExtendName(byte[] photoByte) {
/* 56 */ String strFileExtendName = "JPG"; String strFileExtendName = "JPG";
/* 57 */ if (photoByte[0] == 71 && photoByte[1] == 73 && photoByte[2] == 70 && photoByte[3] == 56 && (photoByte[4] == 55 || photoByte[4] == 57) && photoByte[5] == 97) { if (photoByte[0] == 71 && photoByte[1] == 73 && photoByte[2] == 70 && photoByte[3] == 56 && (photoByte[4] == 55 || photoByte[4] == 57) && photoByte[5] == 97) {
/* */
/* */
/* 60 */ strFileExtendName = "GIF"; strFileExtendName = "GIF";
/* */ } }
/* 62 */ else if (photoByte[6] == 74 && photoByte[7] == 70 && photoByte[8] == 73 && photoByte[9] == 70) { else if (photoByte[6] == 74 && photoByte[7] == 70 && photoByte[8] == 73 && photoByte[9] == 70) {
/* */
/* 64 */ strFileExtendName = "JPG"; strFileExtendName = "JPG";
/* */ } }
/* 66 */ else if (photoByte[0] == 66 && photoByte[1] == 77) { else if (photoByte[0] == 66 && photoByte[1] == 77) {
/* */
/* 68 */ strFileExtendName = "BMP"; strFileExtendName = "BMP";
/* */ } }
/* 70 */ else if (photoByte[1] == 80 && photoByte[2] == 78 && photoByte[3] == 71) { else if (photoByte[1] == 80 && photoByte[2] == 78 && photoByte[3] == 71) {
/* */
/* 72 */ strFileExtendName = "PNG"; strFileExtendName = "PNG";
/* */ } }
/* 74 */ return strFileExtendName; return strFileExtendName;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\file\FileTypeUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\file\FileTypeUtils.class

@ -1,207 +1,207 @@
/* */ package com.archive.common.utils.file; package com.archive.common.utils.file;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */
/* */ import java.io.File; import java.io.File;
/* */ import java.io.FileInputStream; import java.io.FileInputStream;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import java.io.OutputStream; import java.io.OutputStream;
/* */ import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
/* */ import java.net.URLEncoder; import java.net.URLEncoder;
/* */ import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
/* */ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/* */ import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
/* */
/* */
/* */
/* */ public class FileUtils public class FileUtils
/* */
/* */ { {
/* 23 */ public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void writeBytes(String filePath, OutputStream os) throws IOException { public static void writeBytes(String filePath, OutputStream os) throws IOException {
/* 34 */ FileInputStream fis = null; FileInputStream fis = null;
/* */
/* */ try { try {
/* 37 */ File file = new File(filePath); File file = new File(filePath);
/* 38 */ if (!file.exists()) if (!file.exists())
/* */ { {
/* 40 */ if (!(new File(file.getParent())).exists()) { if (!(new File(file.getParent())).exists()) {
/* 41 */ (new File(file.getParent())).mkdirs(); (new File(file.getParent())).mkdirs();
/* */ } }
/* */ } }
/* */
/* 45 */ fis = new FileInputStream(file); fis = new FileInputStream(file);
/* 46 */ byte[] b = new byte[1024]; byte[] b = new byte[1024];
/* */ int length; int length;
/* 48 */ while ((length = fis.read(b)) > 0) while ((length = fis.read(b)) > 0)
/* */ { {
/* 50 */ os.write(b, 0, length); os.write(b, 0, length);
/* */ } }
/* */ } }
/* 53 */ catch (IOException e) { catch (IOException e) {
/* */
/* 55 */ throw e; throw e;
/* */ } }
/* */ finally { finally {
/* */
/* 59 */ if (os != null) { if (os != null) {
/* */
/* */ try { try {
/* */
/* 63 */ os.close(); os.close();
/* */ } }
/* 65 */ catch (IOException e1) { catch (IOException e1) {
/* */
/* 67 */ e1.printStackTrace(); e1.printStackTrace();
/* */ } }
/* */ } }
/* 70 */ if (fis != null) { if (fis != null) {
/* */
/* */ try { try {
/* */
/* 74 */ fis.close(); fis.close();
/* */ } }
/* 76 */ catch (IOException e1) { catch (IOException e1) {
/* */
/* 78 */ e1.printStackTrace(); e1.printStackTrace();
/* */ } }
/* */ } }
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean deleteFile(String filePath) { public static boolean deleteFile(String filePath) {
/* 92 */ boolean flag = false; boolean flag = false;
/* 93 */ File file = new File(filePath); File file = new File(filePath);
/* */
/* 95 */ if (file.isFile() && file.exists()) { if (file.isFile() && file.exists()) {
/* */
/* 97 */ file.delete(); file.delete();
/* 98 */ flag = true; flag = true;
/* */ } }
/* 100 */ return flag; return flag;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isValidFilename(String filename) { public static boolean isValidFilename(String filename) {
/* 111 */ return filename.matches(FILENAME_PATTERN); return filename.matches(FILENAME_PATTERN);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean checkAllowDownload(String resource) { public static boolean checkAllowDownload(String resource) {
/* 123 */ if (StringUtils.contains(resource, "..")) if (StringUtils.contains(resource, ".."))
/* */ { {
/* 125 */ return false; return false;
/* */ } }
/* */
/* */
/* 129 */ if (ArrayUtils.contains((Object[])MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getFileType(resource))) if (ArrayUtils.contains((Object[])MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getFileType(resource)))
/* */ { {
/* 131 */ return true; return true;
/* */ } }
/* */
/* */
/* 135 */ return false; return false;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException { public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException {
/* 147 */ String agent = request.getHeader("USER-AGENT"); String agent = request.getHeader("USER-AGENT");
/* 148 */ String filename = fileName; String filename = fileName;
/* 149 */ if (agent.contains("MSIE")) { if (agent.contains("MSIE")) {
/* */
/* */
/* 152 */ filename = URLEncoder.encode(filename, "utf-8"); filename = URLEncoder.encode(filename, "utf-8");
/* 153 */ filename = filename.replace("+", " "); filename = filename.replace("+", " ");
/* */ } }
/* 155 */ else if (agent.contains("Firefox")) { else if (agent.contains("Firefox")) {
/* */
/* */
/* 158 */ filename = new String(fileName.getBytes(), "ISO8859-1"); filename = new String(fileName.getBytes(), "ISO8859-1");
/* */ } }
/* 160 */ else if (agent.contains("Chrome")) { else if (agent.contains("Chrome")) {
/* */
/* */
/* 163 */ filename = URLEncoder.encode(filename, "utf-8"); filename = URLEncoder.encode(filename, "utf-8");
/* */
/* */ } }
/* */ else { else {
/* */
/* 168 */ filename = URLEncoder.encode(filename, "utf-8"); filename = URLEncoder.encode(filename, "utf-8");
/* */ } }
/* 170 */ return filename; return filename;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException { public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException {
/* 182 */ String percentEncodedFileName = percentEncode(realFileName); String percentEncodedFileName = percentEncode(realFileName);
/* */
/* 184 */ StringBuilder contentDispositionValue = new StringBuilder(); StringBuilder contentDispositionValue = new StringBuilder();
/* 185 */ contentDispositionValue.append("attachment; filename=") contentDispositionValue.append("attachment; filename=")
/* 186 */ .append(percentEncodedFileName) .append(percentEncodedFileName)
/* 187 */ .append(";") .append(";")
/* 188 */ .append("filename*=") .append("filename*=")
/* 189 */ .append("utf-8''") .append("utf-8''")
/* 190 */ .append(percentEncodedFileName); .append(percentEncodedFileName);
/* */
/* 192 */ response.setHeader("Content-disposition", contentDispositionValue.toString()); response.setHeader("Content-disposition", contentDispositionValue.toString());
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String percentEncode(String s) throws UnsupportedEncodingException { public static String percentEncode(String s) throws UnsupportedEncodingException {
/* 203 */ String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString()); String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
/* 204 */ return encode.replaceAll("\\+", "%20"); return encode.replaceAll("\\+", "%20");
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\file\FileUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\file\FileUtils.class

@ -1,103 +1,103 @@
/* */ package com.archive.common.utils.file; package com.archive.common.utils.file;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.config.ArchiveConfig; import com.archive.framework.config.ArchiveConfig;
/* */ import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
/* */ import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
/* */ import java.io.FileInputStream; import java.io.FileInputStream;
/* */ import java.io.InputStream; import java.io.InputStream;
/* */ import java.net.URL; import java.net.URL;
/* */ import java.net.URLConnection; import java.net.URLConnection;
/* */ import java.util.Arrays; import java.util.Arrays;
/* */ import org.apache.poi.util.IOUtils; import org.apache.poi.util.IOUtils;
/* */ import org.slf4j.Logger; import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ImageUtils public class ImageUtils
/* */ { {
/* 24 */ private static final Logger log = LoggerFactory.getLogger(com.archive.common.utils.file.ImageUtils.class); private static final Logger log = LoggerFactory.getLogger(com.archive.common.utils.file.ImageUtils.class);
/* */
/* */
/* */ public static byte[] getImage(String imagePath) { public static byte[] getImage(String imagePath) {
/* 28 */ InputStream is = getFile(imagePath); InputStream is = getFile(imagePath);
/* */
/* */ try { try {
/* 31 */ return IOUtils.toByteArray(is); return IOUtils.toByteArray(is);
/* */ } }
/* 33 */ catch (Exception e) { catch (Exception e) {
/* */
/* 35 */ log.error("图片加载异常 {}", e); log.error("图片加载异常 {}", e);
/* 36 */ return null; return null;
/* */ } }
/* */ finally { finally {
/* */
/* 40 */ IOUtils.closeQuietly(is); IOUtils.closeQuietly(is);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */ public static InputStream getFile(String imagePath) { public static InputStream getFile(String imagePath) {
/* */ try { try {
/* 48 */ byte[] result = readFile(imagePath); byte[] result = readFile(imagePath);
/* 49 */ result = Arrays.copyOf(result, result.length); result = Arrays.copyOf(result, result.length);
/* 50 */ return new ByteArrayInputStream(result); return new ByteArrayInputStream(result);
/* */ } }
/* 52 */ catch (Exception e) { catch (Exception e) {
/* */
/* 54 */ log.error("获取图片异常 {}", e); log.error("获取图片异常 {}", e);
/* */
/* 56 */ return null; return null;
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static byte[] readFile(String url) { public static byte[] readFile(String url) {
/* 67 */ InputStream in = null; InputStream in = null;
/* 68 */ ByteArrayOutputStream baos = null; ByteArrayOutputStream baos = null;
/* */
/* */ try { try {
/* 71 */ if (url.startsWith("http")) { if (url.startsWith("http")) {
/* */
/* */
/* 74 */ URL urlObj = new URL(url); URL urlObj = new URL(url);
/* 75 */ URLConnection urlConnection = urlObj.openConnection(); URLConnection urlConnection = urlObj.openConnection();
/* 76 */ urlConnection.setConnectTimeout(30000); urlConnection.setConnectTimeout(30000);
/* 77 */ urlConnection.setReadTimeout(60000); urlConnection.setReadTimeout(60000);
/* 78 */ urlConnection.setDoInput(true); urlConnection.setDoInput(true);
/* 79 */ in = urlConnection.getInputStream(); in = urlConnection.getInputStream();
/* */
/* */ } }
/* */ else { else {
/* */
/* 84 */ String localPath = ArchiveConfig.getInstance().getProfile(); String localPath = ArchiveConfig.getInstance().getProfile();
/* 85 */ String downloadPath = localPath + StringUtils.substringAfter(url, "/profile"); String downloadPath = localPath + StringUtils.substringAfter(url, "/profile");
/* 86 */ in = new FileInputStream(downloadPath); in = new FileInputStream(downloadPath);
/* */ } }
/* 88 */ return IOUtils.toByteArray(in); return IOUtils.toByteArray(in);
/* */ } }
/* 90 */ catch (Exception e) { catch (Exception e) {
/* */
/* 92 */ log.error("获取文件路径异常 {}", e); log.error("获取文件路径异常 {}", e);
/* 93 */ return null; return null;
/* */ } }
/* */ finally { finally {
/* */
/* 97 */ IOUtils.closeQuietly(baos); IOUtils.closeQuietly(baos);
/* */ } }
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\file\ImageUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\file\ImageUtils.class

File diff suppressed because it is too large Load Diff

@ -1,264 +1,264 @@
/* */ package com.archive.common.utils.http; package com.archive.common.utils.http;
/* */
/* */ import com.archive.common.utils.http.HttpUtils; import com.archive.common.utils.http.HttpUtils;
/* */ import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HostnameVerifier;
/* */ import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSession;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ class TrustAnyHostnameVerifier class TrustAnyHostnameVerifier
/* */ implements HostnameVerifier implements HostnameVerifier
/* */ { {
/* */ TrustAnyHostnameVerifier() {} TrustAnyHostnameVerifier() {}
/* */
/* */ public boolean verify(String hostname, SSLSession session) { public boolean verify(String hostname, SSLSession session) {
/* 259 */ return true; return true;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\http\HttpUtils$TrustAnyHostnameVerifier.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\http\HttpUtils$TrustAnyHostnameVerifier.class

@ -1,255 +1,255 @@
/* */ package com.archive.common.utils.http; package com.archive.common.utils.http;
/* */
/* */ import com.archive.common.utils.http.HttpUtils; import com.archive.common.utils.http.HttpUtils;
/* */ import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
/* */ import javax.net.ssl.X509TrustManager; import javax.net.ssl.X509TrustManager;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ class TrustAnyTrustManager class TrustAnyTrustManager
/* */ implements X509TrustManager implements X509TrustManager
/* */ { {
/* */ TrustAnyTrustManager() {} TrustAnyTrustManager() {}
/* */
/* */ public void checkClientTrusted(X509Certificate[] chain, String authType) {} public void checkClientTrusted(X509Certificate[] chain, String authType) {}
/* */
/* */ public void checkServerTrusted(X509Certificate[] chain, String authType) {} public void checkServerTrusted(X509Certificate[] chain, String authType) {}
/* */
/* */ public X509Certificate[] getAcceptedIssuers() { public X509Certificate[] getAcceptedIssuers() {
/* 250 */ return new X509Certificate[0]; return new X509Certificate[0];
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\http\HttpUtils$TrustAnyTrustManager.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\http\HttpUtils$TrustAnyTrustManager.class

@ -1,286 +1,286 @@
/* */ package com.archive.common.utils.http; package com.archive.common.utils.http;
/* */
/* */ import java.io.BufferedReader; import java.io.BufferedReader;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import java.io.InputStream; import java.io.InputStream;
/* */ import java.io.InputStreamReader; import java.io.InputStreamReader;
/* */ import java.io.PrintWriter; import java.io.PrintWriter;
/* */ import java.net.ConnectException; import java.net.ConnectException;
/* */ import java.net.SocketTimeoutException; import java.net.SocketTimeoutException;
/* */ import java.net.URL; import java.net.URL;
/* */ import java.net.URLConnection; import java.net.URLConnection;
/* */ import java.security.SecureRandom; import java.security.SecureRandom;
/* */ import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HostnameVerifier;
/* */ import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;
/* */ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
/* */ import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManager;
/* */ import org.slf4j.Logger; import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class HttpUtils public class HttpUtils
/* */ { {
/* 30 */ private static final Logger log = LoggerFactory.getLogger(com.archive.common.utils.http.HttpUtils.class); private static final Logger log = LoggerFactory.getLogger(com.archive.common.utils.http.HttpUtils.class);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String sendGet(String url, String param) { public static String sendGet(String url, String param) {
/* 41 */ return sendGet(url, param, "UTF-8"); return sendGet(url, param, "UTF-8");
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String sendGet(String url, String param, String contentType) { public static String sendGet(String url, String param, String contentType) {
/* 54 */ StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
/* 55 */ BufferedReader in = null; BufferedReader in = null;
/* */
/* */ try { try {
/* 58 */ String urlNameString = url + "?" + param; String urlNameString = url + "?" + param;
/* 59 */ log.info("sendGet - {}", urlNameString); log.info("sendGet - {}", urlNameString);
/* 60 */ URL realUrl = new URL(urlNameString); URL realUrl = new URL(urlNameString);
/* 61 */ URLConnection connection = realUrl.openConnection(); URLConnection connection = realUrl.openConnection();
/* 62 */ connection.setRequestProperty("accept", "*/*"); connection.setRequestProperty("accept", "*/*");
/* 63 */ connection.setRequestProperty("connection", "Keep-Alive"); connection.setRequestProperty("connection", "Keep-Alive");
/* 64 */ connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
/* 65 */ connection.connect(); connection.connect();
/* 66 */ in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType));
/* */ String line; String line;
/* 68 */ while ((line = in.readLine()) != null) while ((line = in.readLine()) != null)
/* */ { {
/* 70 */ result.append(line); result.append(line);
/* */ } }
/* 72 */ log.info("recv - {}", result); log.info("recv - {}", result);
/* */ } }
/* 74 */ catch (ConnectException e) { catch (ConnectException e) {
/* */
/* 76 */ log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
/* */ } }
/* 78 */ catch (SocketTimeoutException e) { catch (SocketTimeoutException e) {
/* */
/* 80 */ log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
/* */ } }
/* 82 */ catch (IOException e) { catch (IOException e) {
/* */
/* 84 */ log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
/* */ } }
/* 86 */ catch (Exception e) { catch (Exception e) {
/* */
/* 88 */ log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e); log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
/* */ } finally { } finally {
/* */
/* */
/* */ try { try {
/* */
/* 94 */ if (in != null) if (in != null)
/* */ { {
/* 96 */ in.close(); in.close();
/* */ } }
/* */ } }
/* 99 */ catch (Exception ex) { catch (Exception ex) {
/* */
/* 101 */ log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
/* */ } }
/* */ } }
/* 104 */ return result.toString(); return result.toString();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String sendPost(String url, String param) { public static String sendPost(String url, String param) {
/* 116 */ PrintWriter out = null; PrintWriter out = null;
/* 117 */ BufferedReader in = null; BufferedReader in = null;
/* 118 */ StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
/* */
/* */ try { try {
/* 121 */ String urlNameString = url; String urlNameString = url;
/* 122 */ log.info("sendPost - {}", urlNameString); log.info("sendPost - {}", urlNameString);
/* 123 */ URL realUrl = new URL(urlNameString); URL realUrl = new URL(urlNameString);
/* 124 */ URLConnection conn = realUrl.openConnection(); URLConnection conn = realUrl.openConnection();
/* 125 */ conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("accept", "*/*");
/* 126 */ conn.setRequestProperty("connection", "Keep-Alive"); conn.setRequestProperty("connection", "Keep-Alive");
/* 127 */ conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
/* 128 */ conn.setRequestProperty("Accept-Charset", "utf-8"); conn.setRequestProperty("Accept-Charset", "utf-8");
/* 129 */ conn.setRequestProperty("contentType", "utf-8"); conn.setRequestProperty("contentType", "utf-8");
/* 130 */ conn.setDoOutput(true); conn.setDoOutput(true);
/* 131 */ conn.setDoInput(true); conn.setDoInput(true);
/* 132 */ out = new PrintWriter(conn.getOutputStream()); out = new PrintWriter(conn.getOutputStream());
/* 133 */ out.print(param); out.print(param);
/* 134 */ out.flush(); out.flush();
/* 135 */ in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8")); in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
/* */ String line; String line;
/* 137 */ while ((line = in.readLine()) != null) while ((line = in.readLine()) != null)
/* */ { {
/* 139 */ result.append(line); result.append(line);
/* */ } }
/* 141 */ log.info("recv - {}", result); log.info("recv - {}", result);
/* */ } }
/* 143 */ catch (ConnectException e) { catch (ConnectException e) {
/* */
/* 145 */ log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
/* */ } }
/* 147 */ catch (SocketTimeoutException e) { catch (SocketTimeoutException e) {
/* */
/* 149 */ log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
/* */ } }
/* 151 */ catch (IOException e) { catch (IOException e) {
/* */
/* 153 */ log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
/* */ } }
/* 155 */ catch (Exception e) { catch (Exception e) {
/* */
/* 157 */ log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e); log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
/* */ } finally { } finally {
/* */
/* */
/* */ try { try {
/* */
/* 163 */ if (out != null) if (out != null)
/* */ { {
/* 165 */ out.close(); out.close();
/* */ } }
/* 167 */ if (in != null) if (in != null)
/* */ { {
/* 169 */ in.close(); in.close();
/* */ } }
/* */ } }
/* 172 */ catch (IOException ex) { catch (IOException ex) {
/* */
/* 174 */ log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
/* */ } }
/* */ } }
/* 177 */ return result.toString(); return result.toString();
/* */ } }
/* */
/* */
/* */ public static String sendSSLPost(String url, String param) { public static String sendSSLPost(String url, String param) {
/* 182 */ StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
/* 183 */ String urlNameString = url + "?" + param; String urlNameString = url + "?" + param;
/* */
/* */ try { try {
/* 186 */ log.info("sendSSLPost - {}", urlNameString); log.info("sendSSLPost - {}", urlNameString);
/* 187 */ SSLContext sc = SSLContext.getInstance("SSL"); SSLContext sc = SSLContext.getInstance("SSL");
/* 188 */ sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom()); sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
/* 189 */ URL console = new URL(urlNameString); URL console = new URL(urlNameString);
/* 190 */ HttpsURLConnection conn = (HttpsURLConnection)console.openConnection(); HttpsURLConnection conn = (HttpsURLConnection)console.openConnection();
/* 191 */ conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("accept", "*/*");
/* 192 */ conn.setRequestProperty("connection", "Keep-Alive"); conn.setRequestProperty("connection", "Keep-Alive");
/* 193 */ conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
/* 194 */ conn.setRequestProperty("Accept-Charset", "utf-8"); conn.setRequestProperty("Accept-Charset", "utf-8");
/* 195 */ conn.setRequestProperty("contentType", "utf-8"); conn.setRequestProperty("contentType", "utf-8");
/* 196 */ conn.setDoOutput(true); conn.setDoOutput(true);
/* 197 */ conn.setDoInput(true); conn.setDoInput(true);
/* */
/* 199 */ conn.setSSLSocketFactory(sc.getSocketFactory()); conn.setSSLSocketFactory(sc.getSocketFactory());
/* 200 */ conn.setHostnameVerifier(new TrustAnyHostnameVerifier()); conn.setHostnameVerifier(new TrustAnyHostnameVerifier());
/* 201 */ conn.connect(); conn.connect();
/* 202 */ InputStream is = conn.getInputStream(); InputStream is = conn.getInputStream();
/* 203 */ BufferedReader br = new BufferedReader(new InputStreamReader(is)); BufferedReader br = new BufferedReader(new InputStreamReader(is));
/* 204 */ String ret = ""; String ret = "";
/* 205 */ while ((ret = br.readLine()) != null) { while ((ret = br.readLine()) != null) {
/* */
/* 207 */ if (ret != null && !ret.trim().equals("")) if (ret != null && !ret.trim().equals(""))
/* */ { {
/* 209 */ result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8")); result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8"));
/* */ } }
/* */ } }
/* 212 */ log.info("recv - {}", result); log.info("recv - {}", result);
/* 213 */ conn.disconnect(); conn.disconnect();
/* 214 */ br.close(); br.close();
/* */ } }
/* 216 */ catch (ConnectException e) { catch (ConnectException e) {
/* */
/* 218 */ log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
/* */ } }
/* 220 */ catch (SocketTimeoutException e) { catch (SocketTimeoutException e) {
/* */
/* 222 */ log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
/* */ } }
/* 224 */ catch (IOException e) { catch (IOException e) {
/* */
/* 226 */ log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e); log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
/* */ } }
/* 228 */ catch (Exception e) { catch (Exception e) {
/* */
/* 230 */ log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e); log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
/* */ } }
/* 232 */ return result.toString(); return result.toString();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean urlWhetherReachable(String urlString, int timeOutMillSeconds) { public static boolean urlWhetherReachable(String urlString, int timeOutMillSeconds) {
/* 270 */ boolean flag = true; boolean flag = true;
/* */
/* */ try { try {
/* 273 */ URL url = new URL(urlString); URL url = new URL(urlString);
/* 274 */ URLConnection co = url.openConnection(); URLConnection co = url.openConnection();
/* 275 */ co.setConnectTimeout(timeOutMillSeconds); co.setConnectTimeout(timeOutMillSeconds);
/* 276 */ co.connect(); co.connect();
/* 277 */ } catch (Exception e1) { } catch (Exception e1) {
/* 278 */ System.out.println(urlString + "连接请求超时!"); System.out.println(urlString + "连接请求超时!");
/* 279 */ flag = false; flag = false;
/* */ } }
/* 281 */ return flag; return flag;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\http\HttpUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\http\HttpUtils.class

@ -1,52 +1,52 @@
/* */ package com.archive.common.utils.uuid; package com.archive.common.utils.uuid;
/* */
/* */ import com.archive.common.utils.uuid.UUID; import com.archive.common.utils.uuid.UUID;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class IdUtils public class IdUtils
/* */ { {
/* */ public static String randomUUID() { public static String randomUUID() {
/* 17 */ return UUID.randomUUID().toString(); return UUID.randomUUID().toString();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String simpleUUID() { public static String simpleUUID() {
/* 27 */ return UUID.randomUUID().toString(true); return UUID.randomUUID().toString(true);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String fastUUID() { public static String fastUUID() {
/* 37 */ return UUID.fastUUID().toString(); return UUID.fastUUID().toString();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String fastSimpleUUID() { public static String fastSimpleUUID() {
/* 47 */ return UUID.fastUUID().toString(true); return UUID.fastUUID().toString(true);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\util\\uuid\IdUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\util\\uuid\IdUtils.class

@ -1,51 +1,51 @@
/* */ package com.archive.framework.config package com.archive.framework.config
; ;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.xss.XssFilter; import com.archive.common.xss.XssFilter;
/* */ import com.google.common.collect.Maps; import com.google.common.collect.Maps;
/* */ import java.util.Map; import java.util.Map;
/* */ import javax.servlet.DispatcherType; import javax.servlet.DispatcherType;
/* */ import javax.servlet.Filter; import javax.servlet.Filter;
/* */ import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
/* */ import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.FilterRegistrationBean;
/* */ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
/* */ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Configuration @Configuration
/* */ public class FilterConfig public class FilterConfig
/* */ { {
/* */ @Value("${xss.enabled}") @Value("${xss.enabled}")
/* */ private String enabled; private String enabled;
/* */ @Value("${xss.excludes}") @Value("${xss.excludes}")
/* */ private String excludes; private String excludes;
/* */ @Value("${xss.urlPatterns}") @Value("${xss.urlPatterns}")
/* */ private String urlPatterns; private String urlPatterns;
/* */
/* */ @Bean @Bean
/* */ public FilterRegistrationBean xssFilterRegistration() { public FilterRegistrationBean xssFilterRegistration() {
/* 34 */ FilterRegistrationBean registration = new FilterRegistrationBean(); FilterRegistrationBean registration = new FilterRegistrationBean();
/* 35 */ registration.setDispatcherTypes(DispatcherType.REQUEST, new DispatcherType[0]); registration.setDispatcherTypes(DispatcherType.REQUEST, new DispatcherType[0]);
/* 36 */ registration.setFilter((Filter)new XssFilter()); registration.setFilter((Filter)new XssFilter());
/* 37 */ registration.addUrlPatterns(StringUtils.split(this.urlPatterns, ",")); registration.addUrlPatterns(StringUtils.split(this.urlPatterns, ","));
/* 38 */ registration.setName("xssFilter"); registration.setName("xssFilter");
/* 39 */ registration.setOrder(2147483647); registration.setOrder(2147483647);
/* 40 */ Map<String, String> initParameters = Maps.newHashMap(); Map<String, String> initParameters = Maps.newHashMap();
/* 41 */ initParameters.put("excludes", this.excludes); initParameters.put("excludes", this.excludes);
/* 42 */ initParameters.put("enabled", this.enabled); initParameters.put("enabled", this.enabled);
/* 43 */ registration.setInitParameters(initParameters); registration.setInitParameters(initParameters);
/* 44 */ return registration; return registration;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\FilterConfig.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\FilterConfig.class

@ -1,71 +1,71 @@
/* */ package com.archive.framework.config package com.archive.framework.config
; ;
/* */
/* */ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ @ConfigurationProperties(prefix = "gen") @ConfigurationProperties(prefix = "gen")
/* */ public class GenConfig public class GenConfig
/* */ { {
/* */ public static String author; public static String author;
/* */ public static String packageName; public static String packageName;
/* */ public static boolean autoRemovePre; public static boolean autoRemovePre;
/* */ public static String tablePrefix; public static String tablePrefix;
/* */
/* */ public static String getAuthor() { public static String getAuthor() {
/* 29 */ return author; return author;
/* */ } }
/* */
/* */
/* */ public void setAuthor(String author) { public void setAuthor(String author) {
/* 34 */ com.archive.framework.config.GenConfig.author = author; com.archive.framework.config.GenConfig.author = author;
/* */ } }
/* */
/* */
/* */ public static String getPackageName() { public static String getPackageName() {
/* 39 */ return packageName; return packageName;
/* */ } }
/* */
/* */
/* */ public void setPackageName(String packageName) { public void setPackageName(String packageName) {
/* 44 */ com.archive.framework.config.GenConfig.packageName = packageName; com.archive.framework.config.GenConfig.packageName = packageName;
/* */ } }
/* */
/* */
/* */ public static boolean getAutoRemovePre() { public static boolean getAutoRemovePre() {
/* 49 */ return autoRemovePre; return autoRemovePre;
/* */ } }
/* */
/* */
/* */ public void setAutoRemovePre(boolean autoRemovePre) { public void setAutoRemovePre(boolean autoRemovePre) {
/* 54 */ com.archive.framework.config.GenConfig.autoRemovePre = autoRemovePre; com.archive.framework.config.GenConfig.autoRemovePre = autoRemovePre;
/* */ } }
/* */
/* */
/* */ public static String getTablePrefix() { public static String getTablePrefix() {
/* 59 */ return tablePrefix; return tablePrefix;
/* */ } }
/* */
/* */
/* */ public void setTablePrefix(String tablePrefix) { public void setTablePrefix(String tablePrefix) {
/* 64 */ com.archive.framework.config.GenConfig.tablePrefix = tablePrefix; com.archive.framework.config.GenConfig.tablePrefix = tablePrefix;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\GenConfig.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\GenConfig.class

@ -1,47 +1,47 @@
/* */ package com.archive.framework.config package com.archive.framework.config
; ;
/* */
/* */ import java.util.Locale; import java.util.Locale;
/* */ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
/* */ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/* */ import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
/* */ import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.LocaleResolver;
/* */ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
/* */ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/* */ import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
/* */ import org.springframework.web.servlet.i18n.SessionLocaleResolver; import org.springframework.web.servlet.i18n.SessionLocaleResolver;
/* */
/* */
/* */
/* */
/* */
/* */ @Configuration @Configuration
/* */ public class I18nConfig public class I18nConfig
/* */ implements WebMvcConfigurer implements WebMvcConfigurer
/* */ { {
/* */ @Bean @Bean
/* */ public LocaleResolver localeResolver() { public LocaleResolver localeResolver() {
/* 23 */ SessionLocaleResolver slr = new SessionLocaleResolver(); SessionLocaleResolver slr = new SessionLocaleResolver();
/* */
/* 25 */ slr.setDefaultLocale(Locale.SIMPLIFIED_CHINESE); slr.setDefaultLocale(Locale.SIMPLIFIED_CHINESE);
/* 26 */ return (LocaleResolver)slr; return (LocaleResolver)slr;
/* */ } }
/* */
/* */
/* */ @Bean @Bean
/* */ public LocaleChangeInterceptor localeChangeInterceptor() { public LocaleChangeInterceptor localeChangeInterceptor() {
/* 32 */ LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); LocaleChangeInterceptor lci = new LocaleChangeInterceptor();
/* */
/* 34 */ lci.setParamName("lang"); lci.setParamName("lang");
/* 35 */ return lci; return lci;
/* */ } }
/* */
/* */
/* */
/* */ public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
/* 41 */ registry.addInterceptor((HandlerInterceptor)localeChangeInterceptor()); registry.addInterceptor((HandlerInterceptor)localeChangeInterceptor());
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\I18nConfig.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\I18nConfig.class

@ -1,121 +1,121 @@
/* */ package com.archive.framework.web.exception package com.archive.framework.web.exception
; ;
/* */
/* */ import com.archive.common.exception.BusinessException; import com.archive.common.exception.BusinessException;
/* */ import com.archive.common.exception.DemoModeException; import com.archive.common.exception.DemoModeException;
/* */ import com.archive.common.utils.ServletUtils; import com.archive.common.utils.ServletUtils;
/* */ import com.archive.common.utils.security.PermissionUtils; import com.archive.common.utils.security.PermissionUtils;
/* */ import com.archive.framework.web.domain.AjaxResult; import com.archive.framework.web.domain.AjaxResult;
/* */ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/* */ import org.apache.shiro.authz.AuthorizationException; import org.apache.shiro.authz.AuthorizationException;
/* */ import org.slf4j.Logger; import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/* */ import org.springframework.validation.BindException; import org.springframework.validation.BindException;
/* */ import org.springframework.validation.ObjectError; import org.springframework.validation.ObjectError;
/* */ import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException;
/* */ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
/* */ import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
/* */ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
/* */
/* */
/* */
/* */
/* */
/* */ @RestControllerAdvice @RestControllerAdvice
/* */ public class GlobalExceptionHandler public class GlobalExceptionHandler
/* */ { {
/* 26 */ private static final Logger log = LoggerFactory.getLogger(com.archive.framework.web.exception.GlobalExceptionHandler.class); private static final Logger log = LoggerFactory.getLogger(com.archive.framework.web.exception.GlobalExceptionHandler.class);
/* */
/* */
/* */
/* */
/* */
/* */ @ExceptionHandler({AuthorizationException.class}) @ExceptionHandler({AuthorizationException.class})
/* */ public Object handleAuthorizationException(HttpServletRequest request, AuthorizationException e) { public Object handleAuthorizationException(HttpServletRequest request, AuthorizationException e) {
/* 34 */ log.error(e.getMessage(), (Throwable)e); log.error(e.getMessage(), (Throwable)e);
/* 35 */ if (ServletUtils.isAjaxRequest(request)) if (ServletUtils.isAjaxRequest(request))
/* */ { {
/* 37 */ return AjaxResult.error(PermissionUtils.getMsg(e.getMessage())); return AjaxResult.error(PermissionUtils.getMsg(e.getMessage()));
/* */ } }
/* */
/* */
/* 41 */ ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
/* 42 */ modelAndView.setViewName("error/unauth"); modelAndView.setViewName("error/unauth");
/* 43 */ return modelAndView; return modelAndView;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @ExceptionHandler({HttpRequestMethodNotSupportedException.class}) @ExceptionHandler({HttpRequestMethodNotSupportedException.class})
/* */ public AjaxResult handleException(HttpRequestMethodNotSupportedException e) { public AjaxResult handleException(HttpRequestMethodNotSupportedException e) {
/* 53 */ log.error(e.getMessage(), (Throwable)e); log.error(e.getMessage(), (Throwable)e);
/* 54 */ return AjaxResult.error("不支持' " + e.getMethod() + "'请求"); return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @ExceptionHandler({RuntimeException.class}) @ExceptionHandler({RuntimeException.class})
/* */ public AjaxResult notFount(RuntimeException e) { public AjaxResult notFount(RuntimeException e) {
/* 63 */ log.error("运行时异常:", e); log.error("运行时异常:", e);
/* 64 */ return AjaxResult.error("运行时异常:" + e.getMessage()); return AjaxResult.error("运行时异常:" + e.getMessage());
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @ExceptionHandler({Exception.class}) @ExceptionHandler({Exception.class})
/* */ public AjaxResult handleException(Exception e) { public AjaxResult handleException(Exception e) {
/* 73 */ log.error(e.getMessage(), e); log.error(e.getMessage(), e);
/* 74 */ return AjaxResult.error("服务器错误,请联系管理员"); return AjaxResult.error("服务器错误,请联系管理员");
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @ExceptionHandler({BusinessException.class}) @ExceptionHandler({BusinessException.class})
/* */ public Object businessException(HttpServletRequest request, BusinessException e) { public Object businessException(HttpServletRequest request, BusinessException e) {
/* 83 */ log.error(e.getMessage(), (Throwable)e); log.error(e.getMessage(), (Throwable)e);
/* 84 */ if (ServletUtils.isAjaxRequest(request)) if (ServletUtils.isAjaxRequest(request))
/* */ { {
/* 86 */ return AjaxResult.error(e.getMessage()); return AjaxResult.error(e.getMessage());
/* */ } }
/* */
/* */
/* 90 */ ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
/* 91 */ modelAndView.addObject("errorMessage", e.getMessage()); modelAndView.addObject("errorMessage", e.getMessage());
/* 92 */ modelAndView.setViewName("error/business"); modelAndView.setViewName("error/business");
/* 93 */ return modelAndView; return modelAndView;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @ExceptionHandler({BindException.class}) @ExceptionHandler({BindException.class})
/* */ public AjaxResult validatedBindException(BindException e) { public AjaxResult validatedBindException(BindException e) {
/* 103 */ log.error(e.getMessage(), (Throwable)e); log.error(e.getMessage(), (Throwable)e);
/* 104 */ String message = ((ObjectError)e.getAllErrors().get(0)).getDefaultMessage(); String message = ((ObjectError)e.getAllErrors().get(0)).getDefaultMessage();
/* 105 */ return AjaxResult.error(message); return AjaxResult.error(message);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @ExceptionHandler({DemoModeException.class}) @ExceptionHandler({DemoModeException.class})
/* */ public AjaxResult demoModeException(DemoModeException e) { public AjaxResult demoModeException(DemoModeException e) {
/* 114 */ return AjaxResult.error("演示模式,不允许操作"); return AjaxResult.error("演示模式,不允许操作");
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\web\exception\GlobalExceptionHandler.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\web\exception\GlobalExceptionHandler.class

@ -1,102 +1,102 @@
/* */ package com.archive.project.common.service package com.archive.project.common.service
; ;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.project.common.mapper.ExecuteSqlMapper; import com.archive.project.common.mapper.ExecuteSqlMapper;
/* */ import com.archive.project.common.service.IExecuteSqlService; import com.archive.project.common.service.IExecuteSqlService;
/* */ import java.util.LinkedHashMap; import java.util.LinkedHashMap;
/* */ import java.util.List; import java.util.List;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
/* */ import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/* */
/* */ @Service @Service
/* */ public class ExecuteSqlServiceImpl public class ExecuteSqlServiceImpl
/* */ implements IExecuteSqlService implements IExecuteSqlService
/* */ { {
/* */ @Autowired @Autowired
/* */ private ExecuteSqlMapper executeSqlMapper; private ExecuteSqlMapper executeSqlMapper;
/* */ @Autowired @Autowired
/* */ public JdbcTemplate jdbcTemplate; public JdbcTemplate jdbcTemplate;
/* */
/* */ public String getSingle(String sql) { public String getSingle(String sql) {
/* 22 */ List<LinkedHashMap<String, Object>> selectResult = this.executeSqlMapper.select(sql); List<LinkedHashMap<String, Object>> selectResult = this.executeSqlMapper.select(sql);
/* 23 */ if (selectResult.isEmpty() || selectResult.get(0) == null) { if (selectResult.isEmpty() || selectResult.get(0) == null) {
/* 24 */ return ""; return "";
/* */ } }
/* 26 */ return ((LinkedHashMap)selectResult.get(0)).values().iterator().next().toString(); return ((LinkedHashMap)selectResult.get(0)).values().iterator().next().toString();
/* */ } }
/* */
/* */
/* */
/* */ public List<LinkedHashMap<String, Object>> queryList(String sql) { public List<LinkedHashMap<String, Object>> queryList(String sql) {
/* 32 */ return this.executeSqlMapper.select(sql); return this.executeSqlMapper.select(sql);
/* */ } }
/* */
/* */
/* */ public LinkedHashMap<String, Object> getOne(String sql) { public LinkedHashMap<String, Object> getOne(String sql) {
/* 37 */ return this.executeSqlMapper.select(sql).get(0); return this.executeSqlMapper.select(sql).get(0);
/* */ } }
/* */
/* */
/* */ public boolean insert(String sql) { public boolean insert(String sql) {
/* */ try { try {
/* 43 */ this.executeSqlMapper.insert(sql); this.executeSqlMapper.insert(sql);
/* 44 */ return true; return true;
/* 45 */ } catch (Exception e) { } catch (Exception e) {
/* 46 */ e.printStackTrace(); e.printStackTrace();
/* 47 */ return false; return false;
/* */ } }
/* */ } }
/* */
/* */
/* */ public boolean batchInsert(List<String> sql) { public boolean batchInsert(List<String> sql) {
/* 53 */ return insert(StringUtils.join(sql, ';')); return insert(StringUtils.join(sql, ';'));
/* */ } }
/* */
/* */
/* */ public boolean update(String sql) { public boolean update(String sql) {
/* */ try { try {
/* 59 */ this.executeSqlMapper.update(sql); this.executeSqlMapper.update(sql);
/* 60 */ return true; return true;
/* 61 */ } catch (Exception e) { } catch (Exception e) {
/* 62 */ e.printStackTrace(); e.printStackTrace();
/* 63 */ return false; return false;
/* */ } }
/* */ } }
/* */
/* */
/* */ public boolean batchUpdate(List<String> sql) { public boolean batchUpdate(List<String> sql) {
/* 69 */ return update(StringUtils.join(sql, ';')); return update(StringUtils.join(sql, ';'));
/* */ } }
/* */
/* */
/* */ public boolean delete(String sql) { public boolean delete(String sql) {
/* */ try { try {
/* 75 */ this.executeSqlMapper.delete(sql); this.executeSqlMapper.delete(sql);
/* 76 */ return true; return true;
/* 77 */ } catch (Exception e) { } catch (Exception e) {
/* 78 */ e.printStackTrace(); e.printStackTrace();
/* 79 */ return false; return false;
/* */ } }
/* */ } }
/* */
/* */
/* */ public boolean batchDelete(List<String> sql) { public boolean batchDelete(List<String> sql) {
/* 85 */ return delete(StringUtils.join(sql, ';')); return delete(StringUtils.join(sql, ';'));
/* */ } }
/* */
/* */
/* */ public void jdbcTemplateExecute(String sql) throws Exception { public void jdbcTemplateExecute(String sql) throws Exception {
/* 90 */ this.jdbcTemplate.execute(sql); this.jdbcTemplate.execute(sql);
/* */ } }
/* */
/* */
/* */ public Integer jdbcTemplateQueryCount(String sql) { public Integer jdbcTemplateQueryCount(String sql) {
/* 95 */ return (Integer)this.jdbcTemplate.queryForObject(sql, Integer.class); return (Integer)this.jdbcTemplate.queryForObject(sql, Integer.class);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\common\service\ExecuteSqlServiceImpl.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\common\service\ExecuteSqlServiceImpl.class

@ -1,64 +1,64 @@
/* */ package com.archive.project.dajs.gsbdr.controller package com.archive.project.dajs.gsbdr.controller
; ;
/* */
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.page.TableDataInfo; import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.dajs.gsbdr.service.IGsbdrService; import com.archive.project.dajs.gsbdr.service.IGsbdrService;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import java.util.ArrayList; import java.util.ArrayList;
/* */ import java.util.List; import java.util.List;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller @Controller
/* */ @RequestMapping({"/dajs/gsbdr"}) @RequestMapping({"/dajs/gsbdr"})
/* */ public class GsbdrController public class GsbdrController
/* */ extends BaseController extends BaseController
/* */ { {
/* 31 */ private String prefix = "dajs/gsbdr"; private String prefix = "dajs/gsbdr";
/* */
/* */
/* */ @Autowired @Autowired
/* */ private IGsbdrService gsbdrService; private IGsbdrService gsbdrService;
/* */
/* */
/* */
/* */ @RequiresPermissions({"dajs:gsbdr"}) @RequiresPermissions({"dajs:gsbdr"})
/* */ @GetMapping @GetMapping
/* */ public String gsbdr(ModelMap mmap) { public String gsbdr(ModelMap mmap) {
/* 42 */ return this.prefix + "/gsbdr"; return this.prefix + "/gsbdr";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/list"}) @GetMapping({"/list"})
/* */ @ResponseBody @ResponseBody
/* */ public TableDataInfo list(String key, int page, int size) throws IOException { public TableDataInfo list(String key, int page, int size) throws IOException {
/* 54 */ startPage(); startPage();
/* */
/* 56 */ List<Object> list = new ArrayList(); List<Object> list = new ArrayList();
/* 57 */ return getDataTable(list); return getDataTable(list);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dajs\gsbdr\controller\GsbdrController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dajs\gsbdr\controller\GsbdrController.class

@ -1,164 +1,164 @@
/* */ package com.archive.project.system.user.controller package com.archive.project.system.user.controller
; ;
/* */
/* */ import com.archive.common.utils.CookieUtils; import com.archive.common.utils.CookieUtils;
/* */ import com.archive.common.utils.DateUtils; import com.archive.common.utils.DateUtils;
/* */ import com.archive.common.utils.ServletUtils; import com.archive.common.utils.ServletUtils;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.text.Convert; import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.config.ArchiveConfig; import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.shiro.service.PasswordService; import com.archive.framework.shiro.service.PasswordService;
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult; import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.project.system.config.service.IConfigService; import com.archive.project.system.config.service.IConfigService;
/* */ import com.archive.project.system.menu.domain.Menu; import com.archive.project.system.menu.domain.Menu;
/* */ import com.archive.project.system.menu.service.IMenuService; import com.archive.project.system.menu.service.IMenuService;
/* */ import com.archive.project.system.user.domain.User; import com.archive.project.system.user.domain.User;
/* */ import java.util.Date; import java.util.Date;
/* */ import java.util.List; import java.util.List;
/* */ import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
/* */ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller @Controller
/* */ public class IndexController public class IndexController
/* */ extends BaseController extends BaseController
/* */ { {
/* */ @Autowired @Autowired
/* */ private IMenuService menuService; private IMenuService menuService;
/* */ @Autowired @Autowired
/* */ private IConfigService configService; private IConfigService configService;
/* */ @Autowired @Autowired
/* */ private PasswordService passwordService; private PasswordService passwordService;
/* */ @Autowired @Autowired
/* */ private ArchiveConfig archiveConfig; private ArchiveConfig archiveConfig;
/* */
/* */ @GetMapping({"/index"}) @GetMapping({"/index"})
/* */ public String index(ModelMap mmap) { public String index(ModelMap mmap) {
/* 53 */ String systemName = this.configService.selectConfigByKey("archive.SystemName"); String systemName = this.configService.selectConfigByKey("archive.SystemName");
/* */
/* 55 */ User user = getSysUser(); User user = getSysUser();
/* */
/* 57 */ List<Menu> menus = this.menuService.selectMenusByUser(user); List<Menu> menus = this.menuService.selectMenusByUser(user);
/* 58 */ mmap.put("menus", menus); mmap.put("menus", menus);
/* 59 */ mmap.put("user", user); mmap.put("user", user);
/* 60 */ mmap.put("sideTheme", this.configService.selectConfigByKey("sys.index.sideTheme")); mmap.put("sideTheme", this.configService.selectConfigByKey("sys.index.sideTheme"));
/* 61 */ mmap.put("skinName", this.configService.selectConfigByKey("sys.index.skinName")); mmap.put("skinName", this.configService.selectConfigByKey("sys.index.skinName"));
/* 62 */ mmap.put("ignoreFooter", this.configService.selectConfigByKey("sys.index.ignoreFooter")); mmap.put("ignoreFooter", this.configService.selectConfigByKey("sys.index.ignoreFooter"));
/* 63 */ mmap.put("copyrightYear", this.archiveConfig.getCopyrightYear()); mmap.put("copyrightYear", this.archiveConfig.getCopyrightYear());
/* 64 */ mmap.put("demoEnabled", Boolean.valueOf(this.archiveConfig.isDemoEnabled())); mmap.put("demoEnabled", Boolean.valueOf(this.archiveConfig.isDemoEnabled()));
/* 65 */ mmap.put("isDefaultModifyPwd", Boolean.valueOf(initPasswordIsModify(user.getPwdUpdateDate()))); mmap.put("isDefaultModifyPwd", Boolean.valueOf(initPasswordIsModify(user.getPwdUpdateDate())));
/* 66 */ mmap.put("isPasswordExpired", Boolean.valueOf(passwordIsExpiration(user.getPwdUpdateDate()))); mmap.put("isPasswordExpired", Boolean.valueOf(passwordIsExpiration(user.getPwdUpdateDate())));
/* 67 */ mmap.put("SystemName", systemName); mmap.put("SystemName", systemName);
/* */
/* 69 */ String menuStyle = this.configService.selectConfigByKey("sys.index.menuStyle"); String menuStyle = this.configService.selectConfigByKey("sys.index.menuStyle");
/* */
/* 71 */ String indexStyle = ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")) ? "index" : menuStyle; String indexStyle = ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")) ? "index" : menuStyle;
/* */
/* */
/* 74 */ Cookie[] cookies = ServletUtils.getRequest().getCookies(); Cookie[] cookies = ServletUtils.getRequest().getCookies();
/* 75 */ for (Cookie cookie : cookies) { for (Cookie cookie : cookies) {
/* */
/* 77 */ if (StringUtils.isNotEmpty(cookie.getName()) && "nav-style".equalsIgnoreCase(cookie.getName())) { if (StringUtils.isNotEmpty(cookie.getName()) && "nav-style".equalsIgnoreCase(cookie.getName())) {
/* */
/* 79 */ indexStyle = cookie.getValue(); indexStyle = cookie.getValue();
/* */ break; break;
/* */ } }
/* */ } }
/* 83 */ String webIndex = "topnav".equalsIgnoreCase(indexStyle) ? "index-topnav" : "index"; String webIndex = "topnav".equalsIgnoreCase(indexStyle) ? "index-topnav" : "index";
/* 84 */ return webIndex; return webIndex;
/* */ } }
/* */
/* */
/* */
/* */ @GetMapping({"/lockscreen"}) @GetMapping({"/lockscreen"})
/* */ public String lockscreen(ModelMap mmap) { public String lockscreen(ModelMap mmap) {
/* 91 */ mmap.put("user", getSysUser()); mmap.put("user", getSysUser());
/* 92 */ ServletUtils.getSession().setAttribute("lockscreen", Boolean.valueOf(true)); ServletUtils.getSession().setAttribute("lockscreen", Boolean.valueOf(true));
/* 93 */ return "lock"; return "lock";
/* */ } }
/* */
/* */
/* */
/* */ @PostMapping({"/unlockscreen"}) @PostMapping({"/unlockscreen"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult unlockscreen(String password) { public AjaxResult unlockscreen(String password) {
/* 101 */ User user = getSysUser(); User user = getSysUser();
/* 102 */ if (StringUtils.isNull(user)) if (StringUtils.isNull(user))
/* */ { {
/* 104 */ return AjaxResult.error("服务器超时,请重新登陆"); return AjaxResult.error("服务器超时,请重新登陆");
/* */ } }
/* 106 */ if (this.passwordService.matches(user, password)) { if (this.passwordService.matches(user, password)) {
/* */
/* 108 */ ServletUtils.getSession().removeAttribute("lockscreen"); ServletUtils.getSession().removeAttribute("lockscreen");
/* 109 */ return AjaxResult.success(); return AjaxResult.success();
/* */ } }
/* 111 */ return AjaxResult.error("密码不正确,请重新输入。"); return AjaxResult.error("密码不正确,请重新输入。");
/* */ } }
/* */
/* */
/* */
/* */ @GetMapping({"/system/switchSkin"}) @GetMapping({"/system/switchSkin"})
/* */ public String switchSkin() { public String switchSkin() {
/* 118 */ return "skin"; return "skin";
/* */ } }
/* */
/* */
/* */
/* */ @GetMapping({"/system/menuStyle/{style}"}) @GetMapping({"/system/menuStyle/{style}"})
/* */ public void menuStyle(@PathVariable String style, HttpServletResponse response) { public void menuStyle(@PathVariable String style, HttpServletResponse response) {
/* 125 */ CookieUtils.setCookie(response, "nav-style", style); CookieUtils.setCookie(response, "nav-style", style);
/* */ } }
/* */
/* */
/* */
/* */ @GetMapping({"/system/main"}) @GetMapping({"/system/main"})
/* */ public String main(ModelMap mmap) { public String main(ModelMap mmap) {
/* 132 */ mmap.put("version", this.archiveConfig.getVersion()); mmap.put("version", this.archiveConfig.getVersion());
/* 133 */ return "main"; return "main";
/* */ } }
/* */
/* */
/* */
/* */ public boolean initPasswordIsModify(Date pwdUpdateDate) { public boolean initPasswordIsModify(Date pwdUpdateDate) {
/* 139 */ Integer initPasswordModify = Convert.toInt(this.configService.selectConfigByKey("sys.account.initPasswordModify")); Integer initPasswordModify = Convert.toInt(this.configService.selectConfigByKey("sys.account.initPasswordModify"));
/* 140 */ return (initPasswordModify != null && initPasswordModify.intValue() == 1 && pwdUpdateDate == null); return (initPasswordModify != null && initPasswordModify.intValue() == 1 && pwdUpdateDate == null);
/* */ } }
/* */
/* */
/* */
/* */ public boolean passwordIsExpiration(Date pwdUpdateDate) { public boolean passwordIsExpiration(Date pwdUpdateDate) {
/* 146 */ Integer passwordValidateDays = Convert.toInt(this.configService.selectConfigByKey("sys.account.passwordValidateDays")); Integer passwordValidateDays = Convert.toInt(this.configService.selectConfigByKey("sys.account.passwordValidateDays"));
/* 147 */ if (passwordValidateDays != null && passwordValidateDays.intValue() > 0) { if (passwordValidateDays != null && passwordValidateDays.intValue() > 0) {
/* */
/* 149 */ if (StringUtils.isNull(pwdUpdateDate)) if (StringUtils.isNull(pwdUpdateDate))
/* */ { {
/* */
/* 152 */ return true; return true;
/* */ } }
/* 154 */ Date nowDate = DateUtils.getNowDate(); Date nowDate = DateUtils.getNowDate();
/* 155 */ return (DateUtils.differentDaysByMillisecond(nowDate, pwdUpdateDate) > passwordValidateDays.intValue()); return (DateUtils.differentDaysByMillisecond(nowDate, pwdUpdateDate) > passwordValidateDays.intValue());
/* */ } }
/* 157 */ return false; return false;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\syste\\user\controller\IndexController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\syste\\user\controller\IndexController.class

@ -1,256 +1,256 @@
/* */ package com.archive.project.tool.gen.controller package com.archive.project.tool.gen.controller
; ;
/* */
/* */ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.text.Convert; import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.aspectj.lang.annotation.Log; import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType; import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult; import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.domain.CxSelect; import com.archive.framework.web.domain.CxSelect;
/* */ import com.archive.framework.web.page.TableDataInfo; import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.tool.gen.domain.GenTable; import com.archive.project.tool.gen.domain.GenTable;
/* */ import com.archive.project.tool.gen.domain.GenTableColumn; import com.archive.project.tool.gen.domain.GenTableColumn;
/* */ import com.archive.project.tool.gen.service.IGenTableColumnService; import com.archive.project.tool.gen.service.IGenTableColumnService;
/* */ import com.archive.project.tool.gen.service.IGenTableService; import com.archive.project.tool.gen.service.IGenTableService;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import java.io.OutputStream; import java.io.OutputStream;
/* */ import java.util.ArrayList; import java.util.ArrayList;
/* */ import java.util.List; import java.util.List;
/* */ import java.util.Map; import java.util.Map;
/* */ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/* */ import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
/* */ import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */ @Controller @Controller
/* */ @RequestMapping({"/tool/gen"}) @RequestMapping({"/tool/gen"})
/* */ public class GenController public class GenController
/* */ extends BaseController extends BaseController
/* */ { {
/* 42 */ private String prefix = "tool/gen"; private String prefix = "tool/gen";
/* */
/* */ @Autowired @Autowired
/* */ private IGenTableService genTableService; private IGenTableService genTableService;
/* */
/* */ @Autowired @Autowired
/* */ private IGenTableColumnService genTableColumnService; private IGenTableColumnService genTableColumnService;
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:view"}) @RequiresPermissions({"tool:gen:view"})
/* */ @GetMapping @GetMapping
/* */ public String gen() { public String gen() {
/* 54 */ return this.prefix + "/gen"; return this.prefix + "/gen";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:list"}) @RequiresPermissions({"tool:gen:list"})
/* */ @PostMapping({"/list"}) @PostMapping({"/list"})
/* */ @ResponseBody @ResponseBody
/* */ public TableDataInfo genList(GenTable genTable) { public TableDataInfo genList(GenTable genTable) {
/* 65 */ startPage(); startPage();
/* 66 */ List<GenTable> list = this.genTableService.selectGenTableList(genTable); List<GenTable> list = this.genTableService.selectGenTableList(genTable);
/* 67 */ return getDataTable(list); return getDataTable(list);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:list"}) @RequiresPermissions({"tool:gen:list"})
/* */ @PostMapping({"/db/list"}) @PostMapping({"/db/list"})
/* */ @ResponseBody @ResponseBody
/* */ public TableDataInfo dataList(GenTable genTable) { public TableDataInfo dataList(GenTable genTable) {
/* 78 */ startPage(); startPage();
/* 79 */ List<GenTable> list = this.genTableService.selectDbTableList(genTable); List<GenTable> list = this.genTableService.selectDbTableList(genTable);
/* 80 */ return getDataTable(list); return getDataTable(list);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:list"}) @RequiresPermissions({"tool:gen:list"})
/* */ @PostMapping({"/column/list"}) @PostMapping({"/column/list"})
/* */ @ResponseBody @ResponseBody
/* */ public TableDataInfo columnList(GenTableColumn genTableColumn) { public TableDataInfo columnList(GenTableColumn genTableColumn) {
/* 91 */ TableDataInfo dataInfo = new TableDataInfo(); TableDataInfo dataInfo = new TableDataInfo();
/* 92 */ List<GenTableColumn> list = this.genTableColumnService.selectGenTableColumnListByTableId(genTableColumn); List<GenTableColumn> list = this.genTableColumnService.selectGenTableColumnListByTableId(genTableColumn);
/* 93 */ dataInfo.setRows(list); dataInfo.setRows(list);
/* 94 */ dataInfo.setTotal(list.size()); dataInfo.setTotal(list.size());
/* 95 */ return dataInfo; return dataInfo;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:list"}) @RequiresPermissions({"tool:gen:list"})
/* */ @GetMapping({"/importTable"}) @GetMapping({"/importTable"})
/* */ public String importTable() { public String importTable() {
/* 105 */ return this.prefix + "/importTable"; return this.prefix + "/importTable";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:list"}) @RequiresPermissions({"tool:gen:list"})
/* */ @Log(title = "代码生成", businessType = BusinessType.IMPORT) @Log(title = "代码生成", businessType = BusinessType.IMPORT)
/* */ @PostMapping({"/importTable"}) @PostMapping({"/importTable"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult importTableSave(String tables) { public AjaxResult importTableSave(String tables) {
/* 117 */ String[] tableNames = Convert.toStrArray(tables); String[] tableNames = Convert.toStrArray(tables);
/* */
/* 119 */ List<GenTable> tableList = this.genTableService.selectDbTableListByNames(tableNames); List<GenTable> tableList = this.genTableService.selectDbTableListByNames(tableNames);
/* 120 */ this.genTableService.importGenTable(tableList); this.genTableService.importGenTable(tableList);
/* 121 */ return AjaxResult.success(); return AjaxResult.success();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/edit/{tableId}"}) @GetMapping({"/edit/{tableId}"})
/* */ public String edit(@PathVariable("tableId") Long tableId, ModelMap mmap) { public String edit(@PathVariable("tableId") Long tableId, ModelMap mmap) {
/* 130 */ GenTable table = this.genTableService.selectGenTableById(tableId); GenTable table = this.genTableService.selectGenTableById(tableId);
/* 131 */ List<GenTable> genTables = this.genTableService.selectGenTableAll(); List<GenTable> genTables = this.genTableService.selectGenTableAll();
/* 132 */ List<CxSelect> cxSelect = new ArrayList<>(); List<CxSelect> cxSelect = new ArrayList<>();
/* 133 */ for (GenTable genTable : genTables) { for (GenTable genTable : genTables) {
/* */
/* 135 */ if (!StringUtils.equals(table.getTableName(), genTable.getTableName())) { if (!StringUtils.equals(table.getTableName(), genTable.getTableName())) {
/* */
/* 137 */ CxSelect cxTable = new CxSelect(genTable.getTableName(), genTable.getTableName() + '' + genTable.getTableComment()); CxSelect cxTable = new CxSelect(genTable.getTableName(), genTable.getTableName() + '' + genTable.getTableComment());
/* 138 */ List<CxSelect> cxColumns = new ArrayList<>(); List<CxSelect> cxColumns = new ArrayList<>();
/* 139 */ for (GenTableColumn tableColumn : genTable.getColumns()) for (GenTableColumn tableColumn : genTable.getColumns())
/* */ { {
/* 141 */ cxColumns.add(new CxSelect(tableColumn.getColumnName(), tableColumn.getColumnName() + '' + tableColumn.getColumnComment())); cxColumns.add(new CxSelect(tableColumn.getColumnName(), tableColumn.getColumnName() + '' + tableColumn.getColumnComment()));
/* */ } }
/* 143 */ cxTable.setS(cxColumns); cxTable.setS(cxColumns);
/* 144 */ cxSelect.add(cxTable); cxSelect.add(cxTable);
/* */ } }
/* */ } }
/* 147 */ mmap.put("table", table); mmap.put("table", table);
/* 148 */ mmap.put("data", JSON.toJSON(cxSelect)); mmap.put("data", JSON.toJSON(cxSelect));
/* 149 */ return this.prefix + "/edit"; return this.prefix + "/edit";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:edit"}) @RequiresPermissions({"tool:gen:edit"})
/* */ @Log(title = "代码生成", businessType = BusinessType.UPDATE) @Log(title = "代码生成", businessType = BusinessType.UPDATE)
/* */ @PostMapping({"/edit"}) @PostMapping({"/edit"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult editSave(@Validated GenTable genTable) { public AjaxResult editSave(@Validated GenTable genTable) {
/* 161 */ this.genTableService.validateEdit(genTable); this.genTableService.validateEdit(genTable);
/* 162 */ this.genTableService.updateGenTable(genTable); this.genTableService.updateGenTable(genTable);
/* 163 */ return AjaxResult.success(); return AjaxResult.success();
/* */ } }
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:remove"}) @RequiresPermissions({"tool:gen:remove"})
/* */ @Log(title = "代码生成", businessType = BusinessType.DELETE) @Log(title = "代码生成", businessType = BusinessType.DELETE)
/* */ @PostMapping({"/remove"}) @PostMapping({"/remove"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult remove(String ids) { public AjaxResult remove(String ids) {
/* 172 */ this.genTableService.deleteGenTableByIds(ids); this.genTableService.deleteGenTableByIds(ids);
/* 173 */ return AjaxResult.success(); return AjaxResult.success();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:preview"}) @RequiresPermissions({"tool:gen:preview"})
/* */ @GetMapping({"/preview/{tableId}"}) @GetMapping({"/preview/{tableId}"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException { public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException {
/* 184 */ Map<String, String> dataMap = this.genTableService.previewCode(tableId); Map<String, String> dataMap = this.genTableService.previewCode(tableId);
/* 185 */ return AjaxResult.success(dataMap); return AjaxResult.success(dataMap);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:code"}) @RequiresPermissions({"tool:gen:code"})
/* */ @Log(title = "代码生成", businessType = BusinessType.GENCODE) @Log(title = "代码生成", businessType = BusinessType.GENCODE)
/* */ @GetMapping({"/download/{tableName}"}) @GetMapping({"/download/{tableName}"})
/* */ public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException {
/* 196 */ byte[] data = this.genTableService.downloadCode(tableName); byte[] data = this.genTableService.downloadCode(tableName);
/* 197 */ genCode(response, data); genCode(response, data);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:code"}) @RequiresPermissions({"tool:gen:code"})
/* */ @Log(title = "代码生成", businessType = BusinessType.GENCODE) @Log(title = "代码生成", businessType = BusinessType.GENCODE)
/* */ @GetMapping({"/genCode/{tableName}"}) @GetMapping({"/genCode/{tableName}"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult genCode(@PathVariable("tableName") String tableName) { public AjaxResult genCode(@PathVariable("tableName") String tableName) {
/* 209 */ this.genTableService.generatorCode(tableName); this.genTableService.generatorCode(tableName);
/* 210 */ return AjaxResult.success(); return AjaxResult.success();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:edit"}) @RequiresPermissions({"tool:gen:edit"})
/* */ @Log(title = "代码生成", businessType = BusinessType.UPDATE) @Log(title = "代码生成", businessType = BusinessType.UPDATE)
/* */ @GetMapping({"/synchDb/{tableName}"}) @GetMapping({"/synchDb/{tableName}"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult synchDb(@PathVariable("tableName") String tableName) { public AjaxResult synchDb(@PathVariable("tableName") String tableName) {
/* 222 */ this.genTableService.synchDb(tableName); this.genTableService.synchDb(tableName);
/* 223 */ return AjaxResult.success(); return AjaxResult.success();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"tool:gen:code"}) @RequiresPermissions({"tool:gen:code"})
/* */ @Log(title = "代码生成", businessType = BusinessType.GENCODE) @Log(title = "代码生成", businessType = BusinessType.GENCODE)
/* */ @GetMapping({"/batchGenCode"}) @GetMapping({"/batchGenCode"})
/* */ @ResponseBody @ResponseBody
/* */ public void batchGenCode(HttpServletResponse response, String tables) throws IOException { public void batchGenCode(HttpServletResponse response, String tables) throws IOException {
/* 235 */ String[] tableNames = Convert.toStrArray(tables); String[] tableNames = Convert.toStrArray(tables);
/* 236 */ byte[] data = this.genTableService.downloadCode(tableNames); byte[] data = this.genTableService.downloadCode(tableNames);
/* 237 */ genCode(response, data); genCode(response, data);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private void genCode(HttpServletResponse response, byte[] data) throws IOException { private void genCode(HttpServletResponse response, byte[] data) throws IOException {
/* 245 */ response.reset(); response.reset();
/* 246 */ response.setHeader("Content-Disposition", "attachment; filename=\"archive.zip\""); response.setHeader("Content-Disposition", "attachment; filename=\"archive.zip\"");
/* 247 */ response.addHeader("Content-Length", "" + data.length); response.addHeader("Content-Length", "" + data.length);
/* 248 */ response.setContentType("application/octet-stream; charset=UTF-8"); response.setContentType("application/octet-stream; charset=UTF-8");
/* 249 */ IOUtils.write(data, (OutputStream)response.getOutputStream()); IOUtils.write(data, (OutputStream)response.getOutputStream());
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\controller\GenController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\controller\GenController.class

@ -1,377 +1,377 @@
/* */ package com.archive.project.tool.gen.domain package com.archive.project.tool.gen.domain
; ;
/* */
/* */ import com.archive.common.constant.GenConstants; import com.archive.common.constant.GenConstants;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.web.domain.BaseEntity; import com.archive.framework.web.domain.BaseEntity;
/* */ import com.archive.project.tool.gen.domain.GenTableColumn; import com.archive.project.tool.gen.domain.GenTableColumn;
/* */ import java.util.List; import java.util.List;
/* */ import javax.validation.Valid; import javax.validation.Valid;
/* */ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
/* */ import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class GenTable public class GenTable
/* */ extends BaseEntity extends BaseEntity
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */ private Long tableId; private Long tableId;
/* */ @NotBlank(message = "表名称不能为空") @NotBlank(message = "表名称不能为空")
/* */ private String tableName; private String tableName;
/* */ @NotBlank(message = "表描述不能为空") @NotBlank(message = "表描述不能为空")
/* */ private String tableComment; private String tableComment;
/* */ private String subTableName; private String subTableName;
/* */ private String subTableFkName; private String subTableFkName;
/* */ @NotBlank(message = "实体类名称不能为空") @NotBlank(message = "实体类名称不能为空")
/* */ private String className; private String className;
/* */ private String tplCategory; private String tplCategory;
/* */ @NotBlank(message = "生成包路径不能为空") @NotBlank(message = "生成包路径不能为空")
/* */ private String packageName; private String packageName;
/* */ @NotBlank(message = "生成模块名不能为空") @NotBlank(message = "生成模块名不能为空")
/* */ private String moduleName; private String moduleName;
/* */ @NotBlank(message = "生成业务名不能为空") @NotBlank(message = "生成业务名不能为空")
/* */ private String businessName; private String businessName;
/* */ @NotBlank(message = "生成功能名不能为空") @NotBlank(message = "生成功能名不能为空")
/* */ private String functionName; private String functionName;
/* */ @NotBlank(message = "作者不能为空") @NotBlank(message = "作者不能为空")
/* */ private String functionAuthor; private String functionAuthor;
/* */ private String genType; private String genType;
/* */ private String genPath; private String genPath;
/* */ private GenTableColumn pkColumn; private GenTableColumn pkColumn;
/* */ private com.archive.project.tool.gen.domain.GenTable subTable; private com.archive.project.tool.gen.domain.GenTable subTable;
/* */ @Valid @Valid
/* */ private List<GenTableColumn> columns; private List<GenTableColumn> columns;
/* */ private String options; private String options;
/* */ private String treeCode; private String treeCode;
/* */ private String treeParentCode; private String treeParentCode;
/* */ private String treeName; private String treeName;
/* */ private String parentMenuId; private String parentMenuId;
/* */ private String parentMenuName; private String parentMenuName;
/* */
/* */ public Long getTableId() { public Long getTableId() {
/* 100 */ return this.tableId; return this.tableId;
/* */ } }
/* */
/* */
/* */ public void setTableId(Long tableId) { public void setTableId(Long tableId) {
/* 105 */ this.tableId = tableId; this.tableId = tableId;
/* */ } }
/* */
/* */
/* */ public String getTableName() { public String getTableName() {
/* 110 */ return this.tableName; return this.tableName;
/* */ } }
/* */
/* */
/* */ public void setTableName(String tableName) { public void setTableName(String tableName) {
/* 115 */ this.tableName = tableName; this.tableName = tableName;
/* */ } }
/* */
/* */
/* */ public String getTableComment() { public String getTableComment() {
/* 120 */ return this.tableComment; return this.tableComment;
/* */ } }
/* */
/* */
/* */ public void setTableComment(String tableComment) { public void setTableComment(String tableComment) {
/* 125 */ this.tableComment = tableComment; this.tableComment = tableComment;
/* */ } }
/* */
/* */
/* */ public String getSubTableName() { public String getSubTableName() {
/* 130 */ return this.subTableName; return this.subTableName;
/* */ } }
/* */
/* */
/* */ public void setSubTableName(String subTableName) { public void setSubTableName(String subTableName) {
/* 135 */ this.subTableName = subTableName; this.subTableName = subTableName;
/* */ } }
/* */
/* */
/* */ public String getSubTableFkName() { public String getSubTableFkName() {
/* 140 */ return this.subTableFkName; return this.subTableFkName;
/* */ } }
/* */
/* */
/* */ public void setSubTableFkName(String subTableFkName) { public void setSubTableFkName(String subTableFkName) {
/* 145 */ this.subTableFkName = subTableFkName; this.subTableFkName = subTableFkName;
/* */ } }
/* */
/* */
/* */ public String getClassName() { public String getClassName() {
/* 150 */ return this.className; return this.className;
/* */ } }
/* */
/* */
/* */ public void setClassName(String className) { public void setClassName(String className) {
/* 155 */ this.className = className; this.className = className;
/* */ } }
/* */
/* */
/* */ public String getTplCategory() { public String getTplCategory() {
/* 160 */ return this.tplCategory; return this.tplCategory;
/* */ } }
/* */
/* */
/* */ public void setTplCategory(String tplCategory) { public void setTplCategory(String tplCategory) {
/* 165 */ this.tplCategory = tplCategory; this.tplCategory = tplCategory;
/* */ } }
/* */
/* */
/* */ public String getPackageName() { public String getPackageName() {
/* 170 */ return this.packageName; return this.packageName;
/* */ } }
/* */
/* */
/* */ public void setPackageName(String packageName) { public void setPackageName(String packageName) {
/* 175 */ this.packageName = packageName; this.packageName = packageName;
/* */ } }
/* */
/* */
/* */ public String getModuleName() { public String getModuleName() {
/* 180 */ return this.moduleName; return this.moduleName;
/* */ } }
/* */
/* */
/* */ public void setModuleName(String moduleName) { public void setModuleName(String moduleName) {
/* 185 */ this.moduleName = moduleName; this.moduleName = moduleName;
/* */ } }
/* */
/* */
/* */ public String getBusinessName() { public String getBusinessName() {
/* 190 */ return this.businessName; return this.businessName;
/* */ } }
/* */
/* */
/* */ public void setBusinessName(String businessName) { public void setBusinessName(String businessName) {
/* 195 */ this.businessName = businessName; this.businessName = businessName;
/* */ } }
/* */
/* */
/* */ public String getFunctionName() { public String getFunctionName() {
/* 200 */ return this.functionName; return this.functionName;
/* */ } }
/* */
/* */
/* */ public void setFunctionName(String functionName) { public void setFunctionName(String functionName) {
/* 205 */ this.functionName = functionName; this.functionName = functionName;
/* */ } }
/* */
/* */
/* */ public String getFunctionAuthor() { public String getFunctionAuthor() {
/* 210 */ return this.functionAuthor; return this.functionAuthor;
/* */ } }
/* */
/* */
/* */ public void setFunctionAuthor(String functionAuthor) { public void setFunctionAuthor(String functionAuthor) {
/* 215 */ this.functionAuthor = functionAuthor; this.functionAuthor = functionAuthor;
/* */ } }
/* */
/* */
/* */ public String getGenType() { public String getGenType() {
/* 220 */ return this.genType; return this.genType;
/* */ } }
/* */
/* */
/* */ public void setGenType(String genType) { public void setGenType(String genType) {
/* 225 */ this.genType = genType; this.genType = genType;
/* */ } }
/* */
/* */
/* */ public String getGenPath() { public String getGenPath() {
/* 230 */ return this.genPath; return this.genPath;
/* */ } }
/* */
/* */
/* */ public void setGenPath(String genPath) { public void setGenPath(String genPath) {
/* 235 */ this.genPath = genPath; this.genPath = genPath;
/* */ } }
/* */
/* */
/* */ public GenTableColumn getPkColumn() { public GenTableColumn getPkColumn() {
/* 240 */ return this.pkColumn; return this.pkColumn;
/* */ } }
/* */
/* */
/* */ public void setPkColumn(GenTableColumn pkColumn) { public void setPkColumn(GenTableColumn pkColumn) {
/* 245 */ this.pkColumn = pkColumn; this.pkColumn = pkColumn;
/* */ } }
/* */
/* */
/* */ public com.archive.project.tool.gen.domain.GenTable getSubTable() { public com.archive.project.tool.gen.domain.GenTable getSubTable() {
/* 250 */ return this.subTable; return this.subTable;
/* */ } }
/* */
/* */
/* */ public void setSubTable(com.archive.project.tool.gen.domain.GenTable subTable) { public void setSubTable(com.archive.project.tool.gen.domain.GenTable subTable) {
/* 255 */ this.subTable = subTable; this.subTable = subTable;
/* */ } }
/* */
/* */
/* */ public List<GenTableColumn> getColumns() { public List<GenTableColumn> getColumns() {
/* 260 */ return this.columns; return this.columns;
/* */ } }
/* */
/* */
/* */ public void setColumns(List<GenTableColumn> columns) { public void setColumns(List<GenTableColumn> columns) {
/* 265 */ this.columns = columns; this.columns = columns;
/* */ } }
/* */
/* */
/* */ public String getOptions() { public String getOptions() {
/* 270 */ return this.options; return this.options;
/* */ } }
/* */
/* */
/* */ public void setOptions(String options) { public void setOptions(String options) {
/* 275 */ this.options = options; this.options = options;
/* */ } }
/* */
/* */
/* */ public String getTreeCode() { public String getTreeCode() {
/* 280 */ return this.treeCode; return this.treeCode;
/* */ } }
/* */
/* */
/* */ public void setTreeCode(String treeCode) { public void setTreeCode(String treeCode) {
/* 285 */ this.treeCode = treeCode; this.treeCode = treeCode;
/* */ } }
/* */
/* */
/* */ public String getTreeParentCode() { public String getTreeParentCode() {
/* 290 */ return this.treeParentCode; return this.treeParentCode;
/* */ } }
/* */
/* */
/* */ public void setTreeParentCode(String treeParentCode) { public void setTreeParentCode(String treeParentCode) {
/* 295 */ this.treeParentCode = treeParentCode; this.treeParentCode = treeParentCode;
/* */ } }
/* */
/* */
/* */ public String getTreeName() { public String getTreeName() {
/* 300 */ return this.treeName; return this.treeName;
/* */ } }
/* */
/* */
/* */ public void setTreeName(String treeName) { public void setTreeName(String treeName) {
/* 305 */ this.treeName = treeName; this.treeName = treeName;
/* */ } }
/* */
/* */
/* */ public String getParentMenuId() { public String getParentMenuId() {
/* 310 */ return this.parentMenuId; return this.parentMenuId;
/* */ } }
/* */
/* */
/* */ public void setParentMenuId(String parentMenuId) { public void setParentMenuId(String parentMenuId) {
/* 315 */ this.parentMenuId = parentMenuId; this.parentMenuId = parentMenuId;
/* */ } }
/* */
/* */
/* */ public String getParentMenuName() { public String getParentMenuName() {
/* 320 */ return this.parentMenuName; return this.parentMenuName;
/* */ } }
/* */
/* */
/* */ public void setParentMenuName(String parentMenuName) { public void setParentMenuName(String parentMenuName) {
/* 325 */ this.parentMenuName = parentMenuName; this.parentMenuName = parentMenuName;
/* */ } }
/* */
/* */
/* */ public boolean isSub() { public boolean isSub() {
/* 330 */ return isSub(this.tplCategory); return isSub(this.tplCategory);
/* */ } }
/* */
/* */
/* */ public static boolean isSub(String tplCategory) { public static boolean isSub(String tplCategory) {
/* 335 */ return (tplCategory != null && StringUtils.equals("sub", tplCategory)); return (tplCategory != null && StringUtils.equals("sub", tplCategory));
/* */ } }
/* */
/* */
/* */ public boolean isTree() { public boolean isTree() {
/* 340 */ return isTree(this.tplCategory); return isTree(this.tplCategory);
/* */ } }
/* */
/* */
/* */ public static boolean isTree(String tplCategory) { public static boolean isTree(String tplCategory) {
/* 345 */ return (tplCategory != null && StringUtils.equals("tree", tplCategory)); return (tplCategory != null && StringUtils.equals("tree", tplCategory));
/* */ } }
/* */
/* */
/* */ public boolean isCrud() { public boolean isCrud() {
/* 350 */ return isCrud(this.tplCategory); return isCrud(this.tplCategory);
/* */ } }
/* */
/* */
/* */ public static boolean isCrud(String tplCategory) { public static boolean isCrud(String tplCategory) {
/* 355 */ return (tplCategory != null && StringUtils.equals("crud", tplCategory)); return (tplCategory != null && StringUtils.equals("crud", tplCategory));
/* */ } }
/* */
/* */
/* */ public boolean isSuperColumn(String javaField) { public boolean isSuperColumn(String javaField) {
/* 360 */ return isSuperColumn(this.tplCategory, javaField); return isSuperColumn(this.tplCategory, javaField);
/* */ } }
/* */
/* */
/* */ public static boolean isSuperColumn(String tplCategory, String javaField) { public static boolean isSuperColumn(String tplCategory, String javaField) {
/* 365 */ if (isTree(tplCategory)) if (isTree(tplCategory))
/* */ { {
/* 367 */ return StringUtils.equalsAnyIgnoreCase(javaField, return StringUtils.equalsAnyIgnoreCase(javaField,
/* 368 */ (CharSequence[])ArrayUtils.addAll((Object[])GenConstants.TREE_ENTITY, (Object[])GenConstants.BASE_ENTITY)); (CharSequence[])ArrayUtils.addAll((Object[])GenConstants.TREE_ENTITY, (Object[])GenConstants.BASE_ENTITY));
/* */ } }
/* 370 */ return StringUtils.equalsAnyIgnoreCase(javaField, (CharSequence[])GenConstants.BASE_ENTITY); return StringUtils.equalsAnyIgnoreCase(javaField, (CharSequence[])GenConstants.BASE_ENTITY);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\domain\GenTable.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\domain\GenTable.class

@ -1,377 +1,377 @@
/* */ package com.archive.project.tool.gen.domain package com.archive.project.tool.gen.domain
; ;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.web.domain.BaseEntity; import com.archive.framework.web.domain.BaseEntity;
/* */ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class GenTableColumn public class GenTableColumn
/* */ extends BaseEntity extends BaseEntity
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */ private Long columnId; private Long columnId;
/* */ private Long tableId; private Long tableId;
/* */ private String columnName; private String columnName;
/* */ private String columnComment; private String columnComment;
/* */ private String columnType; private String columnType;
/* */ private String javaType; private String javaType;
/* */ @NotBlank(message = "Java属性不能为空") @NotBlank(message = "Java属性不能为空")
/* */ private String javaField; private String javaField;
/* */ private String isPk; private String isPk;
/* */ private String isIncrement; private String isIncrement;
/* */ private String isRequired; private String isRequired;
/* */ private String isInsert; private String isInsert;
/* */ private String isEdit; private String isEdit;
/* */ private String isList; private String isList;
/* */ private String isQuery; private String isQuery;
/* */ private String queryType; private String queryType;
/* */ private String htmlType; private String htmlType;
/* */ private String dictType; private String dictType;
/* */ private Integer sort; private Integer sort;
/* */
/* */ public void setColumnId(Long columnId) { public void setColumnId(Long columnId) {
/* 73 */ this.columnId = columnId; this.columnId = columnId;
/* */ } }
/* */
/* */
/* */ public Long getColumnId() { public Long getColumnId() {
/* 78 */ return this.columnId; return this.columnId;
/* */ } }
/* */
/* */
/* */ public void setTableId(Long tableId) { public void setTableId(Long tableId) {
/* 83 */ this.tableId = tableId; this.tableId = tableId;
/* */ } }
/* */
/* */
/* */ public Long getTableId() { public Long getTableId() {
/* 88 */ return this.tableId; return this.tableId;
/* */ } }
/* */
/* */
/* */ public void setColumnName(String columnName) { public void setColumnName(String columnName) {
/* 93 */ this.columnName = columnName; this.columnName = columnName;
/* */ } }
/* */
/* */
/* */ public String getColumnName() { public String getColumnName() {
/* 98 */ return this.columnName; return this.columnName;
/* */ } }
/* */
/* */
/* */ public void setColumnComment(String columnComment) { public void setColumnComment(String columnComment) {
/* 103 */ this.columnComment = columnComment; this.columnComment = columnComment;
/* */ } }
/* */
/* */
/* */ public String getColumnComment() { public String getColumnComment() {
/* 108 */ return this.columnComment; return this.columnComment;
/* */ } }
/* */
/* */
/* */ public void setColumnType(String columnType) { public void setColumnType(String columnType) {
/* 113 */ this.columnType = columnType; this.columnType = columnType;
/* */ } }
/* */
/* */
/* */ public String getColumnType() { public String getColumnType() {
/* 118 */ return this.columnType; return this.columnType;
/* */ } }
/* */
/* */
/* */ public void setJavaType(String javaType) { public void setJavaType(String javaType) {
/* 123 */ this.javaType = javaType; this.javaType = javaType;
/* */ } }
/* */
/* */
/* */ public String getJavaType() { public String getJavaType() {
/* 128 */ return this.javaType; return this.javaType;
/* */ } }
/* */
/* */
/* */ public void setJavaField(String javaField) { public void setJavaField(String javaField) {
/* 133 */ this.javaField = javaField; this.javaField = javaField;
/* */ } }
/* */
/* */
/* */ public String getJavaField() { public String getJavaField() {
/* 138 */ return this.javaField; return this.javaField;
/* */ } }
/* */
/* */
/* */ public String getCapJavaField() { public String getCapJavaField() {
/* 143 */ return StringUtils.capitalize(this.javaField); return StringUtils.capitalize(this.javaField);
/* */ } }
/* */
/* */
/* */ public void setIsPk(String isPk) { public void setIsPk(String isPk) {
/* 148 */ this.isPk = isPk; this.isPk = isPk;
/* */ } }
/* */
/* */
/* */ public String getIsPk() { public String getIsPk() {
/* 153 */ return this.isPk; return this.isPk;
/* */ } }
/* */
/* */
/* */ public boolean isPk() { public boolean isPk() {
/* 158 */ return isPk(this.isPk); return isPk(this.isPk);
/* */ } }
/* */
/* */
/* */ public boolean isPk(String isPk) { public boolean isPk(String isPk) {
/* 163 */ return (isPk != null && StringUtils.equals("1", isPk)); return (isPk != null && StringUtils.equals("1", isPk));
/* */ } }
/* */
/* */
/* */ public String getIsIncrement() { public String getIsIncrement() {
/* 168 */ return this.isIncrement; return this.isIncrement;
/* */ } }
/* */
/* */
/* */ public void setIsIncrement(String isIncrement) { public void setIsIncrement(String isIncrement) {
/* 173 */ this.isIncrement = isIncrement; this.isIncrement = isIncrement;
/* */ } }
/* */
/* */
/* */ public boolean isIncrement() { public boolean isIncrement() {
/* 178 */ return isIncrement(this.isIncrement); return isIncrement(this.isIncrement);
/* */ } }
/* */
/* */
/* */ public boolean isIncrement(String isIncrement) { public boolean isIncrement(String isIncrement) {
/* 183 */ return (isIncrement != null && StringUtils.equals("1", isIncrement)); return (isIncrement != null && StringUtils.equals("1", isIncrement));
/* */ } }
/* */
/* */
/* */ public void setIsRequired(String isRequired) { public void setIsRequired(String isRequired) {
/* 188 */ this.isRequired = isRequired; this.isRequired = isRequired;
/* */ } }
/* */
/* */
/* */ public String getIsRequired() { public String getIsRequired() {
/* 193 */ return this.isRequired; return this.isRequired;
/* */ } }
/* */
/* */
/* */ public boolean isRequired() { public boolean isRequired() {
/* 198 */ return isRequired(this.isRequired); return isRequired(this.isRequired);
/* */ } }
/* */
/* */
/* */ public boolean isRequired(String isRequired) { public boolean isRequired(String isRequired) {
/* 203 */ return (isRequired != null && StringUtils.equals("1", isRequired)); return (isRequired != null && StringUtils.equals("1", isRequired));
/* */ } }
/* */
/* */
/* */ public void setIsInsert(String isInsert) { public void setIsInsert(String isInsert) {
/* 208 */ this.isInsert = isInsert; this.isInsert = isInsert;
/* */ } }
/* */
/* */
/* */ public String getIsInsert() { public String getIsInsert() {
/* 213 */ return this.isInsert; return this.isInsert;
/* */ } }
/* */
/* */
/* */ public boolean isInsert() { public boolean isInsert() {
/* 218 */ return isInsert(this.isInsert); return isInsert(this.isInsert);
/* */ } }
/* */
/* */
/* */ public boolean isInsert(String isInsert) { public boolean isInsert(String isInsert) {
/* 223 */ return (isInsert != null && StringUtils.equals("1", isInsert)); return (isInsert != null && StringUtils.equals("1", isInsert));
/* */ } }
/* */
/* */
/* */ public void setIsEdit(String isEdit) { public void setIsEdit(String isEdit) {
/* 228 */ this.isEdit = isEdit; this.isEdit = isEdit;
/* */ } }
/* */
/* */
/* */ public String getIsEdit() { public String getIsEdit() {
/* 233 */ return this.isEdit; return this.isEdit;
/* */ } }
/* */
/* */
/* */ public boolean isEdit() { public boolean isEdit() {
/* 238 */ return isInsert(this.isEdit); return isInsert(this.isEdit);
/* */ } }
/* */
/* */
/* */ public boolean isEdit(String isEdit) { public boolean isEdit(String isEdit) {
/* 243 */ return (isEdit != null && StringUtils.equals("1", isEdit)); return (isEdit != null && StringUtils.equals("1", isEdit));
/* */ } }
/* */
/* */
/* */ public void setIsList(String isList) { public void setIsList(String isList) {
/* 248 */ this.isList = isList; this.isList = isList;
/* */ } }
/* */
/* */
/* */ public String getIsList() { public String getIsList() {
/* 253 */ return this.isList; return this.isList;
/* */ } }
/* */
/* */
/* */ public boolean isList() { public boolean isList() {
/* 258 */ return isList(this.isList); return isList(this.isList);
/* */ } }
/* */
/* */
/* */ public boolean isList(String isList) { public boolean isList(String isList) {
/* 263 */ return (isList != null && StringUtils.equals("1", isList)); return (isList != null && StringUtils.equals("1", isList));
/* */ } }
/* */
/* */
/* */ public void setIsQuery(String isQuery) { public void setIsQuery(String isQuery) {
/* 268 */ this.isQuery = isQuery; this.isQuery = isQuery;
/* */ } }
/* */
/* */
/* */ public String getIsQuery() { public String getIsQuery() {
/* 273 */ return this.isQuery; return this.isQuery;
/* */ } }
/* */
/* */
/* */ public boolean isQuery() { public boolean isQuery() {
/* 278 */ return isQuery(this.isQuery); return isQuery(this.isQuery);
/* */ } }
/* */
/* */
/* */ public boolean isQuery(String isQuery) { public boolean isQuery(String isQuery) {
/* 283 */ return (isQuery != null && StringUtils.equals("1", isQuery)); return (isQuery != null && StringUtils.equals("1", isQuery));
/* */ } }
/* */
/* */
/* */ public void setQueryType(String queryType) { public void setQueryType(String queryType) {
/* 288 */ this.queryType = queryType; this.queryType = queryType;
/* */ } }
/* */
/* */
/* */ public String getQueryType() { public String getQueryType() {
/* 293 */ return this.queryType; return this.queryType;
/* */ } }
/* */
/* */
/* */ public String getHtmlType() { public String getHtmlType() {
/* 298 */ return this.htmlType; return this.htmlType;
/* */ } }
/* */
/* */
/* */ public void setHtmlType(String htmlType) { public void setHtmlType(String htmlType) {
/* 303 */ this.htmlType = htmlType; this.htmlType = htmlType;
/* */ } }
/* */
/* */
/* */ public void setDictType(String dictType) { public void setDictType(String dictType) {
/* 308 */ this.dictType = dictType; this.dictType = dictType;
/* */ } }
/* */
/* */
/* */ public String getDictType() { public String getDictType() {
/* 313 */ return this.dictType; return this.dictType;
/* */ } }
/* */
/* */
/* */ public void setSort(Integer sort) { public void setSort(Integer sort) {
/* 318 */ this.sort = sort; this.sort = sort;
/* */ } }
/* */
/* */
/* */ public Integer getSort() { public Integer getSort() {
/* 323 */ return this.sort; return this.sort;
/* */ } }
/* */
/* */
/* */ public boolean isSuperColumn() { public boolean isSuperColumn() {
/* 328 */ return isSuperColumn(this.javaField); return isSuperColumn(this.javaField);
/* */ } }
/* */
/* */
/* */ public static boolean isSuperColumn(String javaField) { public static boolean isSuperColumn(String javaField) {
/* 333 */ return StringUtils.equalsAnyIgnoreCase(javaField, new CharSequence[] { "createBy", "createTime", "updateBy", "updateTime", "remark", "parentName", "parentId", "orderNum", "ancestors" }); return StringUtils.equalsAnyIgnoreCase(javaField, new CharSequence[] { "createBy", "createTime", "updateBy", "updateTime", "remark", "parentName", "parentId", "orderNum", "ancestors" });
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean isUsableColumn() { public boolean isUsableColumn() {
/* 342 */ return isUsableColumn(this.javaField); return isUsableColumn(this.javaField);
/* */ } }
/* */
/* */
/* */
/* */ public static boolean isUsableColumn(String javaField) { public static boolean isUsableColumn(String javaField) {
/* 348 */ return StringUtils.equalsAnyIgnoreCase(javaField, new CharSequence[] { "parentId", "orderNum", "remark" }); return StringUtils.equalsAnyIgnoreCase(javaField, new CharSequence[] { "parentId", "orderNum", "remark" });
/* */ } }
/* */
/* */
/* */ public String readConverterExp() { public String readConverterExp() {
/* 353 */ String remarks = StringUtils.substringBetween(this.columnComment, "", ""); String remarks = StringUtils.substringBetween(this.columnComment, "", "");
/* 354 */ StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
/* 355 */ if (StringUtils.isNotEmpty(remarks)) { if (StringUtils.isNotEmpty(remarks)) {
/* */
/* 357 */ for (String value : remarks.split(" ")) { for (String value : remarks.split(" ")) {
/* */
/* 359 */ if (StringUtils.isNotEmpty(value)) { if (StringUtils.isNotEmpty(value)) {
/* */
/* 361 */ Object startStr = value.subSequence(0, 1); Object startStr = value.subSequence(0, 1);
/* 362 */ String endStr = value.substring(1); String endStr = value.substring(1);
/* 363 */ sb.append("").append(startStr).append("=").append(endStr).append(","); sb.append("").append(startStr).append("=").append(endStr).append(",");
/* */ } }
/* */ } }
/* 366 */ return sb.deleteCharAt(sb.length() - 1).toString(); return sb.deleteCharAt(sb.length() - 1).toString();
/* */ } }
/* */
/* */
/* 370 */ return this.columnComment; return this.columnComment;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\domain\GenTableColumn.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\domain\GenTableColumn.class

@ -1,73 +1,73 @@
/* */ package com.archive.project.tool.gen.service package com.archive.project.tool.gen.service
; ;
/* */
/* */ import com.archive.common.utils.text.Convert; import com.archive.common.utils.text.Convert;
/* */ import com.archive.project.tool.gen.domain.GenTableColumn; import com.archive.project.tool.gen.domain.GenTableColumn;
/* */ import com.archive.project.tool.gen.mapper.GenTableColumnMapper; import com.archive.project.tool.gen.mapper.GenTableColumnMapper;
/* */ import com.archive.project.tool.gen.service.IGenTableColumnService; import com.archive.project.tool.gen.service.IGenTableColumnService;
/* */ import java.util.List; import java.util.List;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service @Service
/* */ public class GenTableColumnServiceImpl public class GenTableColumnServiceImpl
/* */ implements IGenTableColumnService implements IGenTableColumnService
/* */ { {
/* */ @Autowired @Autowired
/* */ private GenTableColumnMapper genTableColumnMapper; private GenTableColumnMapper genTableColumnMapper;
/* */
/* */ public List<GenTableColumn> selectGenTableColumnListByTableId(GenTableColumn genTableColumn) { public List<GenTableColumn> selectGenTableColumnListByTableId(GenTableColumn genTableColumn) {
/* 30 */ return this.genTableColumnMapper.selectGenTableColumnListByTableId(genTableColumn); return this.genTableColumnMapper.selectGenTableColumnListByTableId(genTableColumn);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int insertGenTableColumn(GenTableColumn genTableColumn) { public int insertGenTableColumn(GenTableColumn genTableColumn) {
/* 42 */ return this.genTableColumnMapper.insertGenTableColumn(genTableColumn); return this.genTableColumnMapper.insertGenTableColumn(genTableColumn);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int updateGenTableColumn(GenTableColumn genTableColumn) { public int updateGenTableColumn(GenTableColumn genTableColumn) {
/* 54 */ return this.genTableColumnMapper.updateGenTableColumn(genTableColumn); return this.genTableColumnMapper.updateGenTableColumn(genTableColumn);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteGenTableColumnByIds(String ids) { public int deleteGenTableColumnByIds(String ids) {
/* 66 */ return this.genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); return this.genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\service\GenTableColumnServiceImpl.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\gen\service\GenTableColumnServiceImpl.class

@ -1,257 +1,257 @@
/* */ package com.archive.project.tool.gen.util package com.archive.project.tool.gen.util
; ;
/* */
/* */ import com.archive.common.constant.GenConstants; import com.archive.common.constant.GenConstants;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.config.GenConfig; import com.archive.framework.config.GenConfig;
/* */ import com.archive.project.tool.gen.domain.GenTable; import com.archive.project.tool.gen.domain.GenTable;
/* */ import com.archive.project.tool.gen.domain.GenTableColumn; import com.archive.project.tool.gen.domain.GenTableColumn;
/* */ import java.util.Arrays; import java.util.Arrays;
/* */ import org.apache.commons.lang3.RegExUtils; import org.apache.commons.lang3.RegExUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class GenUtils public class GenUtils
/* */ { {
/* */ public static void initTable(GenTable genTable, String operName) { public static void initTable(GenTable genTable, String operName) {
/* 23 */ genTable.setClassName(convertClassName(genTable.getTableName())); genTable.setClassName(convertClassName(genTable.getTableName()));
/* 24 */ genTable.setPackageName(GenConfig.getPackageName()); genTable.setPackageName(GenConfig.getPackageName());
/* 25 */ genTable.setModuleName(getModuleName(GenConfig.getPackageName())); genTable.setModuleName(getModuleName(GenConfig.getPackageName()));
/* 26 */ genTable.setBusinessName(getBusinessName(genTable.getTableName())); genTable.setBusinessName(getBusinessName(genTable.getTableName()));
/* 27 */ genTable.setFunctionName(replaceText(genTable.getTableComment())); genTable.setFunctionName(replaceText(genTable.getTableComment()));
/* 28 */ genTable.setFunctionAuthor(GenConfig.getAuthor()); genTable.setFunctionAuthor(GenConfig.getAuthor());
/* 29 */ genTable.setCreateBy(operName); genTable.setCreateBy(operName);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static void initColumnField(GenTableColumn column, GenTable table) { public static void initColumnField(GenTableColumn column, GenTable table) {
/* 37 */ String dataType = getDbType(column.getColumnType()); String dataType = getDbType(column.getColumnType());
/* 38 */ String columnName = column.getColumnName(); String columnName = column.getColumnName();
/* 39 */ column.setTableId(table.getTableId()); column.setTableId(table.getTableId());
/* 40 */ column.setCreateBy(table.getCreateBy()); column.setCreateBy(table.getCreateBy());
/* */
/* 42 */ column.setJavaField(StringUtils.toCamelCase(columnName)); column.setJavaField(StringUtils.toCamelCase(columnName));
/* */
/* 44 */ column.setJavaType("String"); column.setJavaType("String");
/* */
/* 46 */ if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) {
/* */
/* */
/* 49 */ Integer columnLength = getColumnLength(column.getColumnType()); Integer columnLength = getColumnLength(column.getColumnType());
/* 50 */ String htmlType = (columnLength.intValue() >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) ? "textarea" : "input"; String htmlType = (columnLength.intValue() >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) ? "textarea" : "input";
/* 51 */ column.setHtmlType(htmlType); column.setHtmlType(htmlType);
/* */ } }
/* 53 */ else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) { else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) {
/* */
/* 55 */ column.setJavaType("Date"); column.setJavaType("Date");
/* 56 */ column.setHtmlType("datetime"); column.setHtmlType("datetime");
/* */ } }
/* 58 */ else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) { else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) {
/* */
/* 60 */ column.setHtmlType("input"); column.setHtmlType("input");
/* */
/* */
/* 63 */ String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ",");
/* 64 */ if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) {
/* */
/* 66 */ column.setJavaType("BigDecimal"); column.setJavaType("BigDecimal");
/* */
/* */ } }
/* 69 */ else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) { else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) {
/* */
/* 71 */ column.setJavaType("Integer"); column.setJavaType("Integer");
/* */
/* */ } }
/* */ else { else {
/* */
/* 76 */ column.setJavaType("Long"); column.setJavaType("Long");
/* */ } }
/* */ } }
/* */
/* */
/* 81 */ column.setIsInsert("1"); column.setIsInsert("1");
/* */
/* */
/* 84 */ if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk())
/* */ { {
/* 86 */ column.setIsEdit("1"); column.setIsEdit("1");
/* */ } }
/* */
/* 89 */ if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk())
/* */ { {
/* 91 */ column.setIsList("1"); column.setIsList("1");
/* */ } }
/* */
/* 94 */ if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk())
/* */ { {
/* 96 */ column.setIsQuery("1"); column.setIsQuery("1");
/* */ } }
/* */
/* */
/* 100 */ if (StringUtils.endsWithIgnoreCase(columnName, "name")) if (StringUtils.endsWithIgnoreCase(columnName, "name"))
/* */ { {
/* 102 */ column.setQueryType("LIKE"); column.setQueryType("LIKE");
/* */ } }
/* */
/* 105 */ if (StringUtils.endsWithIgnoreCase(columnName, "status")) { if (StringUtils.endsWithIgnoreCase(columnName, "status")) {
/* */
/* 107 */ column.setHtmlType("radio"); column.setHtmlType("radio");
/* */
/* */ } }
/* 110 */ else if (StringUtils.endsWithIgnoreCase(columnName, "type") || else if (StringUtils.endsWithIgnoreCase(columnName, "type") ||
/* 111 */ StringUtils.endsWithIgnoreCase(columnName, "sex")) { StringUtils.endsWithIgnoreCase(columnName, "sex")) {
/* */
/* 113 */ column.setHtmlType("select"); column.setHtmlType("select");
/* */
/* */ } }
/* 116 */ else if (StringUtils.endsWithIgnoreCase(columnName, "file")) { else if (StringUtils.endsWithIgnoreCase(columnName, "file")) {
/* */
/* 118 */ column.setHtmlType("upload"); column.setHtmlType("upload");
/* */
/* */ } }
/* 121 */ else if (StringUtils.endsWithIgnoreCase(columnName, "content")) { else if (StringUtils.endsWithIgnoreCase(columnName, "content")) {
/* */
/* 123 */ column.setHtmlType("summernote"); column.setHtmlType("summernote");
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean arraysContains(String[] arr, String targetValue) { public static boolean arraysContains(String[] arr, String targetValue) {
/* 136 */ return Arrays.<String>asList(arr).contains(targetValue); return Arrays.<String>asList(arr).contains(targetValue);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getModuleName(String packageName) { public static String getModuleName(String packageName) {
/* 147 */ int lastIndex = packageName.lastIndexOf("."); int lastIndex = packageName.lastIndexOf(".");
/* 148 */ int nameLength = packageName.length(); int nameLength = packageName.length();
/* 149 */ String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength); String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength);
/* 150 */ return moduleName; return moduleName;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getBusinessName(String tableName) { public static String getBusinessName(String tableName) {
/* 161 */ int lastIndex = tableName.lastIndexOf("_"); int lastIndex = tableName.lastIndexOf("_");
/* 162 */ int nameLength = tableName.length(); int nameLength = tableName.length();
/* 163 */ String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength); String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength);
/* 164 */ return businessName; return businessName;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String convertClassName(String tableName) { public static String convertClassName(String tableName) {
/* 175 */ boolean autoRemovePre = GenConfig.getAutoRemovePre(); boolean autoRemovePre = GenConfig.getAutoRemovePre();
/* 176 */ String tablePrefix = GenConfig.getTablePrefix(); String tablePrefix = GenConfig.getTablePrefix();
/* 177 */ if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) {
/* */
/* 179 */ String[] searchList = StringUtils.split(tablePrefix, ","); String[] searchList = StringUtils.split(tablePrefix, ",");
/* 180 */ tableName = replaceFirst(tableName, searchList); tableName = replaceFirst(tableName, searchList);
/* */ } }
/* 182 */ return StringUtils.convertToCamelCase(tableName); return StringUtils.convertToCamelCase(tableName);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String replaceFirst(String replacementm, String[] searchList) { public static String replaceFirst(String replacementm, String[] searchList) {
/* 194 */ String text = replacementm; String text = replacementm;
/* 195 */ for (String searchString : searchList) { for (String searchString : searchList) {
/* */
/* 197 */ if (replacementm.startsWith(searchString)) { if (replacementm.startsWith(searchString)) {
/* */
/* 199 */ text = replacementm.replaceFirst(searchString, ""); text = replacementm.replaceFirst(searchString, "");
/* */ break; break;
/* */ } }
/* */ } }
/* 203 */ return text; return text;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String replaceText(String text) { public static String replaceText(String text) {
/* 214 */ return RegExUtils.replaceAll(text, "(?:表|Tale)", ""); return RegExUtils.replaceAll(text, "(?:表|Tale)", "");
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getDbType(String columnType) { public static String getDbType(String columnType) {
/* 225 */ if (StringUtils.indexOf(columnType, "(") > 0) if (StringUtils.indexOf(columnType, "(") > 0)
/* */ { {
/* 227 */ return StringUtils.substringBefore(columnType, "("); return StringUtils.substringBefore(columnType, "(");
/* */ } }
/* */
/* */
/* 231 */ return columnType; return columnType;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Integer getColumnLength(String columnType) { public static Integer getColumnLength(String columnType) {
/* 243 */ if (StringUtils.indexOf(columnType, "(") > 0) { if (StringUtils.indexOf(columnType, "(") > 0) {
/* */
/* 245 */ String length = StringUtils.substringBetween(columnType, "(", ")"); String length = StringUtils.substringBetween(columnType, "(", ")");
/* 246 */ return Integer.valueOf(length); return Integer.valueOf(length);
/* */ } }
/* */
/* */
/* 250 */ return Integer.valueOf(0); return Integer.valueOf(0);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\ge\\util\GenUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\ge\\util\GenUtils.class

Loading…
Cancel
Save