From ff0cdc0f2aaf60327f6d094c3cde02391f2493ea Mon Sep 17 00:00:00 2001 From: xiangwbs Date: Sun, 11 Mar 2018 10:54:12 +0800 Subject: [PATCH] merge --- .../main/java/com/xwbing/util/QRCodeUtils.java | 9 ++++++--- .../resources/file/{0000001.png => QRCode.png} | Bin boot-service/src/main/resources/file/logo.png | Bin 0 -> 170 bytes .../resources/file/{0000001.png => QRCode.png} | Bin 4 files changed, 6 insertions(+), 3 deletions(-) rename boot-service/src/main/resources/file/{0000001.png => QRCode.png} (100%) create mode 100644 boot-service/src/main/resources/file/logo.png rename boot-web/src/main/resources/file/{0000001.png => QRCode.png} (100%) diff --git a/boot-service/src/main/java/com/xwbing/util/QRCodeUtils.java b/boot-service/src/main/java/com/xwbing/util/QRCodeUtils.java index 4021fb6..6149912 100644 --- a/boot-service/src/main/java/com/xwbing/util/QRCodeUtils.java +++ b/boot-service/src/main/java/com/xwbing/util/QRCodeUtils.java @@ -10,6 +10,7 @@ import com.xwbing.exception.UtilException; import org.apache.commons.io.output.ByteArrayOutputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.core.io.ClassPathResource; import javax.imageio.ImageIO; import java.awt.*; @@ -295,10 +296,12 @@ public class QRCodeUtils { // String tomcatHome = System.getProperty("catalina.home"); // String name="QRcode"; // File output=new File(tomcatHome+File.separator+"file"+File.separator+name+".png"); - File image = new File("C:/Users/ThinkPad/Desktop/xwbing.png"); + ClassPathResource file = new ClassPathResource("file"); + String path = file.getFile().getAbsolutePath(); + File image = new File(path+File.separator+"logo.png"); FileInputStream logo=new FileInputStream(image); - File out = new File("C:/Users/ThinkPad/Desktop/bbb.png"); - createCodeLogo(out,"aaaa",logo,""); + File out = new File(path+File.separator+"QRCode.png"); + createCodeLogo(out,"java生成的二維碼",logo,""); } } diff --git a/boot-service/src/main/resources/file/0000001.png b/boot-service/src/main/resources/file/QRCode.png similarity index 100% rename from boot-service/src/main/resources/file/0000001.png rename to boot-service/src/main/resources/file/QRCode.png diff --git a/boot-service/src/main/resources/file/logo.png b/boot-service/src/main/resources/file/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e63f562716caff7efb2c103dc6e66020e7f56ddc GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^vLMU|BpB*mL@feRg`O^sAr-fhfBgUdpP$X-QFDhg z>*4ROKZ^3iH|aBVu5eHg5W>{>y&&`1CdQ z68kt=nS6gnahkZkyUXA9etT+T)!{g%&W3sNJn>G>jY->s8kTwZAKW1B!oZMqDn!Of R?REjk5uUDoF6*2UngHQ+JnR4f literal 0 HcmV?d00001 diff --git a/boot-web/src/main/resources/file/0000001.png b/boot-web/src/main/resources/file/QRCode.png similarity index 100% rename from boot-web/src/main/resources/file/0000001.png rename to boot-web/src/main/resources/file/QRCode.png