Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/HongRuiTang into 2.0
| | |
| | | Long userId = SecurityUtils.getUserId(); |
| | | TLotteryEvent lotteryEvent = lotteryEventService.getById(id); |
| | | LotteryEventInfoVo vo = new LotteryEventInfoVo(); |
| | | vo.setId(lotteryEvent.getId()); |
| | | vo.setId(lotteryEvent.getId().toString()); |
| | | vo.setName(lotteryEvent.getName()); |
| | | vo.setActivityProfile(lotteryEvent.getActivityProfile()); |
| | | vo.setStartTime(lotteryEvent.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(data.size() > 0){ |
| | | TLotteryEvent tLotteryEvent = data.get(0); |
| | | map.put("lotteryEventId", tLotteryEvent.getId()); |
| | | map.put("lotteryEventId", tLotteryEvent.getId().toString()); |
| | | map.put("name", tLotteryEvent.getActivityProfile()); |
| | | map.put("image", tLotteryEvent.getCoverImage()); |
| | | //将数据添加到普通抽奖列表中 |
| | | TLotteryEventUser lotteryEventUser = new TLotteryEventUser(); |
| | | lotteryEventUser.setId(IdUtils.simpleUUID()); |
| | | lotteryEventUser.setLotteryEventId(tLotteryEvent.getId()); |
| | | lotteryEventUser.setLotteryEventId(tLotteryEvent.getId().toString()); |
| | | lotteryEventUser.setUser_id(SecurityUtils.getUserId()); |
| | | lotteryEventClient.addLotteryEventUser(lotteryEventUser); |
| | | } |
| | |
| | | List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(getLotteryEventList).getData(); |
| | | if(data.size() > 0){ |
| | | TLotteryEvent tLotteryEvent = data.get(0); |
| | | appUserInfoVo.setLotteryEventId(tLotteryEvent.getId()); |
| | | appUserInfoVo.setLotteryEventId(tLotteryEvent.getId().toString()); |
| | | appUserInfoVo.setShareName(tLotteryEvent.getActivityProfile()); |
| | | appUserInfoVo.setShareImage(tLotteryEvent.getCoverImage()); |
| | | } |
| | |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.Base64Utils; |
| | | import org.springframework.util.FileCopyUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | @Override |
| | | public String getWeiXinQrCode(String scene, String path) { |
| | | try { |
| | | File file = wxMaService.getQrcodeService().createWxaCodeUnlimit(scene, path); |
| | | File file = wxMaService.getQrcodeService().createQrcode(path + "?" + scene); |
| | | String url = OBSUploadUtils.uploadLocalFile(file); |
| | | return url; |
| | | } catch (Exception e) { |
| | |
| | | // 创建PutObject请求。 |
| | | result = ossClient.putObject(bucketName,objectName,file); |
| | | // 如果上传成功,则返回200。 |
| | | System.out.println(fileName + "上传返回" + result.getResponse().getStatusCode()); |
| | | return result.getResponse().getUri(); |
| | | return "https://hongruitang.oss-cn-beijing.aliyuncs.com/" + objectName; |
| | | } catch (OSSException oe) { |
| | | System.out.println("Caught an OSSException, which means your request made it to OSS, " |
| | | + "but was rejected with an error response for some reason."); |
| | |
| | | * 刷新client_token |
| | | */ |
| | | public static void refreshToken(RedisService redisService) { |
| | | try { |
| | | Object ks_refresh_token = redisService.getCacheObject("ks_refresh_token"); |
| | | OAuthAccessTokenKsClient client = new OAuthAccessTokenKsClient(KuaiShouConfig.appKey, KuaiShouConfig.appSecret); |
| | | try { |
| | |
| | | redisService.setCacheObject("ks_access_token", token, expiration_time, TimeUnit.SECONDS); |
| | | redisService.setCacheObject("ks_refresh_token", refreshToken, refreshTokenExpiresIn, TimeUnit.SECONDS); |
| | | } catch (KsLocalLifeApiException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } catch (TeaException e) { |
| | | System.out.println(e.getMessage()); |
| | | } catch (Exception e) { |
| | | System.out.println(e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |