@Override
 protected void doExecute() throws Exception {
   if (S.isInvalidValue(shopFavoritedIn)) {
     throw new IncorrectInputParameterException("is_user_shop_favorited_in is null or empty");
   }
   long beginTime = System.currentTimeMillis();
   JSONObject content = new JSONObject(shopFavoritedIn);
   final String userId = content.optString(ShopFavoriteKey.OWN_USER_KEY, null);
   if (S.isInvalidValue(userId)) {
     throw new IncorrectInputParameterException("User id is null or empty");
   }
   List<String> ownerList = shopFavoriteDAOR.getAllShopIdsByUserId(userId);
   List<String> sourceList = new ArrayList<String>();
   JSONArray idArray = content.getJSONArray(ShopFavoriteKey.OWN_ID_SET_KEY);
   for (int i = 0; i < idArray.length(); i++) {
     JSONObject singleObject = idArray.getJSONObject(i);
     final String shopId = singleObject.optString(ShopFavoriteKey.OWN_ID_KEY, null);
     if (S.isInvalidValue(shopId)) {
       continue;
     }
     sourceList.add(shopId);
   }
   result = getOwnResult(S.SUCCESS_CODE, S.EMPTY_STR, sourceList, ownerList);
   long endTime = System.currentTimeMillis();
   long costTime = endTime - beginTime;
   LOGGER.info("isUserShopFavorited cost>>>" + costTime);
 }
 @Override
 protected void doExecute() throws Exception {
   if (S.isInvalidValue(userId) || !S.isTaobaoUser(userId)) {
     throw new IncorrectInputParameterException("User id is invalid");
   }
   long beginTime = System.currentTimeMillis();
   productCollectTaobaoDAOW.deleteProductsByUserId(userId);
   long endTime = System.currentTimeMillis();
   long costTime = endTime - beginTime;
   LOGGER.info("removeTaobaoProductCollect cost>>>" + costTime);
 }
Exemple #3
0
 @Override
 protected ModelAndView handleRequestInternal(
     HttpServletRequest request, HttpServletResponse response) throws Exception {
   final String userAgent = request.getHeader(S.USER_AGENT);
   LOGGER.info("User agent info is < " + userAgent + " >");
   if (!S.isInvalidValue(userAgent) && userAgent.contains(S.WINDOWS_8)) {
     return new ModelAndView(windows8ViewName);
   }
   return new ModelAndView(universalViewName);
 }
Exemple #4
0
 protected void uploadUserQQInfo(
     final String token, final String expiresIn, final String nick, final String openId)
     throws DomainException {
   final String userId = new StringBuffer(QQKey.USER_PREFIX).append(openId).toString();
   Map<String, String> parameters = new HashMap<String, String>();
   parameters.put(QQKey.USER_ID, userId);
   parameters.put(QQKey.TOKEN, token);
   parameters.put(QQKey.TOKEN_EXPIRE, expiresIn);
   parameters.put(QQKey.USER_NICK, nick);
   parameters.put(S.PLATFORM, S.MOBILE_PLATFORM);
   S.verifyParametersNotNull(parameters);
   qqUserInfoService.uploadUserInfo(parameters, qqConfiguration.getUploadUrl());
 }
Exemple #5
0
 protected void updateHeadUrlIfNecessary(String openId, String thirdHeadUrl) {
   try {
     long beginTime = System.currentTimeMillis();
     if (S.isInvalidValue(thirdHeadUrl)) {
       return;
     }
     final String userId = new StringBuffer(QQKey.USER_PREFIX).append(openId).toString();
     qqUserInfoService.updateBasicInfo(userId, thirdHeadUrl, userInfoUrl, updateBasicInfoUrl);
     long endTime = System.currentTimeMillis();
     long costTime = endTime - beginTime;
     LOGGER.info("update qq head url cost>>>" + costTime);
   } catch (Exception e) {
     LOGGER.info("update qq head url error:" + e.getMessage());
   }
 }