浏览代码

修改dockerfile

zengxj 5 年之前
父节点
当前提交
b35275325e

+ 2 - 2
Dockerfile

@@ -1,6 +1,6 @@
 FROM frolvlad/alpine-java
 VOLUME /tmp
 WORKDIR /tmp
-ADD target/diagnosis.jar app.jar
-ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dserver.port=8080","-Dspring.profiles.active=cloud","-jar","app.jar"]
+COPY target/*.jar app.jar
+ENTRYPOINT ["sh", "-c", "java -Dserver.port=8080 -Dspring.profiles.active=cloud ${JAVA_OPTS} -jar app.jar ${0} ${@}"]
 EXPOSE 8080

+ 1 - 0
src/main/java/edu/math/diagnosis/entity/PaperResult.java

@@ -195,6 +195,7 @@ public class PaperResult {
      * "qid":1,
      * "number":1,
      * "options":"A",
+     * "useTime":10,
      * "answer":"B"
      * }]
      */

+ 1 - 1
src/test/java/edu/math/diagnosis/service/StringTest.java

@@ -27,6 +27,6 @@ public class StringTest {
         String text = "ability,ability,subject";
         String[] a = text.split(",");
         String t = "您的%s处于有待开发的阶段。对%s进行专项训练可以帮助您快速提高%s成绩。";
-        System.out.println(String.format(t, a));
+        System.out.println(String.format(t, (Object[]) a));
     }
 }

+ 22 - 22
src/test/java/edu/math/diagnosis/service/WordServiceTest.java

@@ -14,10 +14,10 @@ import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.impl.values.TypeStore;
 import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
 import org.apache.xmlbeans.impl.values.XmlComplexContentImpl;
-import org.freehep.graphicsio.emf.EMF2SVG;
-import org.freehep.graphicsio.emf.EMFConverter;
-import org.freehep.graphicsio.emf.EMFInputStream;
-import org.freehep.graphicsio.emf.EMFRenderer;
+//import org.freehep.graphicsio.emf.EMF2SVG;
+//import org.freehep.graphicsio.emf.EMFConverter;
+//import org.freehep.graphicsio.emf.EMFInputStream;
+//import org.freehep.graphicsio.emf.EMFRenderer;
 import org.junit.Test;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
@@ -303,18 +303,18 @@ public class WordServiceTest {
 
     @Test
     public void testEmf() throws Exception{
-        EMFInputStream inputStream = new EMFInputStream(new FileInputStream("image/bbb.emf"),
-                EMFInputStream.DEFAULT_VERSION);
-        System.out.println("height = " + inputStream.readHeader().getBounds().getHeight());
-        System.out.println("width = " + inputStream.readHeader().getBounds().getWidth());
-//        EMFConverter
-        EMFRenderer emfRenderer = new EMFRenderer(inputStream);
-        final int width = (int)inputStream.readHeader().getBounds().getWidth();
-        final int height = (int)inputStream.readHeader().getBounds().getHeight();
-        System.out.println("width = " + width + " and height = " + height);
-        final BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
-        Graphics2D g2 = (Graphics2D)result.createGraphics();
-        emfRenderer.paint(g2);
+//        EMFInputStream inputStream = new EMFInputStream(new FileInputStream("image/bbb.emf"),
+//                EMFInputStream.DEFAULT_VERSION);
+//        System.out.println("height = " + inputStream.readHeader().getBounds().getHeight());
+//        System.out.println("width = " + inputStream.readHeader().getBounds().getWidth());
+////        EMFConverter
+//        EMFRenderer emfRenderer = new EMFRenderer(inputStream);
+//        final int width = (int)inputStream.readHeader().getBounds().getWidth();
+//        final int height = (int)inputStream.readHeader().getBounds().getHeight();
+//        System.out.println("width = " + width + " and height = " + height);
+//        final BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+//        Graphics2D g2 = (Graphics2D)result.createGraphics();
+//        emfRenderer.paint(g2);
 //        emfRenderer.drawImage(result,0,0,width,height);
 
 //        ByteArrayOutputStream  baos = new ByteArrayOutputStream();
@@ -324,7 +324,7 @@ public class WordServiceTest {
 //        ImageIO.write(result, "png", imageOutputStream);
         // write it as png/jpg/gif, up to you!!!
         File outputfile = new File("D:\\result.png");
-        ImageIO.write(result, "png", outputfile);
+//        ImageIO.write(result, "png", outputfile);
 
 //        JPanel resultPanel = new JPanel() {
 //            /**
@@ -349,10 +349,10 @@ public class WordServiceTest {
 
     @Test
     public void emfTest2() throws Exception{
-        EMFInputStream inputStream = new EMFInputStream(new FileInputStream("image/bbb.emf"),
-                EMFInputStream.DEFAULT_VERSION);
-        System.out.println("height = " + inputStream.readHeader().getBounds().getHeight());
-        System.out.println("width = " + inputStream.readHeader().getBounds().getWidth());
-        EMF2SVG.main(new String[]{"image/aaa.emf","D:\\result.svg"});
+//        EMFInputStream inputStream = new EMFInputStream(new FileInputStream("image/bbb.emf"),
+//                EMFInputStream.DEFAULT_VERSION);
+//        System.out.println("height = " + inputStream.readHeader().getBounds().getHeight());
+//        System.out.println("width = " + inputStream.readHeader().getBounds().getWidth());
+//        EMF2SVG.main(new String[]{"image/aaa.emf","D:\\result.svg"});
     }
 }