|
@@ -16,9 +16,9 @@ import com.cdf.httpClient.response.FdkkResponse;
|
|
|
import com.cdf.httpClient.response.cdf.*;
|
|
|
import com.cdf.service.IFdkkUserService;
|
|
|
import com.cdf.service.IHotRelationService;
|
|
|
-import com.cdf.util.FileUtils;
|
|
|
-import com.cdf.util.JwtUtil;
|
|
|
-import com.cdf.util.UploadToOssUtil;
|
|
|
+import com.cdf.util.*;
|
|
|
+import com.google.zxing.client.j2se.MatrixToImageWriter;
|
|
|
+import com.google.zxing.common.BitMatrix;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -28,6 +28,8 @@ import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
@@ -257,4 +259,19 @@ public class FdkkSceneEditService {
|
|
|
}
|
|
|
return tags;
|
|
|
}
|
|
|
+
|
|
|
+ public void downQrCode(HttpServletRequest request, HttpServletResponse response, String num) {
|
|
|
+ String longUrl;
|
|
|
+ try {
|
|
|
+ longUrl = "http://vr.cdfmembers.com/index.html?m=" +num;
|
|
|
+ // 转换成短url
|
|
|
+ String shortUrl = ShortNetAddressUtil.generateShortUrl(longUrl);
|
|
|
+ // 生成二维码
|
|
|
+ BitMatrix qRcodeImg = QRCodeUtil.generateQRCodeStream(shortUrl, response);
|
|
|
+ // 将二维码输出到页面中
|
|
|
+ MatrixToImageWriter.writeToStream(qRcodeImg, "png", response.getOutputStream());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|