| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyExtraService userMoneyExtraService;
|
| | |
|
| | | @RequestMapping(value = "testimg")
|
| | | public void testImg(HttpServletRequest request, PrintWriter out) {
|
| | | long startTime = System.currentTimeMillis();
|
| | |
|
| | | List<String> list = new ArrayList<>();
|
| | | for (int i = 0; i < 10; i++) {
|
| | | list.add("i" + i);
|
| | | }
|
| | |
|
| | | try {
|
| | | final TaoBaoGoodsBrief goods = redisManager.getTaoBaoGoodsBrief(569823237075L);
|
| | | } catch (TaobaoGoodsDownException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | String url = "http://www.baidu.com";
|
| | | list.parallelStream().forEach(ids -> {
|
| | | InputStream portrait = HttpUtil.getAsInputStream(
|
| | | "https://wwc.alicdn.com/avatar/getAvatar.do?userId=1889722423&width=160&height=160&type=sns");
|
| | | System.out.println(ids + "开始时间:" + System.currentTimeMillis());
|
| | | String uid = "123";
|
| | | String auctionId = "test-" + ids;
|
| | |
|
| | | String destPath = FileUtil.getCacheDir() + "/" + auctionId + ".jpg";
|
| | |
|
| | | String shareImgPath = FileUtil.getCacheDir() + "/share_" + uid + "_" + auctionId + ".png";
|
| | |
|
| | | try {
|
| | | QRCodeUtil.getInstance(500).encode(url, destPath);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | long startDTime = System.currentTimeMillis();
|
| | |
|
| | | /*
|
| | | * try { //ImageUtil.drawGoodsShareImg(new FileInputStream(new
|
| | | * File(destPath)), portrait, goods, shareImgPath); } catch
|
| | | * (FileNotFoundException e) { e.printStackTrace(); }
|
| | | */
|
| | | System.out.println(System.currentTimeMillis() - startDTime);
|
| | |
|
| | | String shareImgUrl = COSManager.getInstance()
|
| | | .uploadFile(new File(shareImgPath), "share_" + uid + "_" + auctionId + ".png").getUrl();
|
| | | System.out.println(ids + "结束时间:" + System.currentTimeMillis());
|
| | | });
|
| | | System.out.println("整体耗时:" + (System.currentTimeMillis() - startTime));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @RequestMapping(value = "kefu")
|
| | | public void kefu(HttpServletRequest request, PrintWriter out) {
|
| | |
| | | }
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | } |
| | | }
|