| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.jsoup.Jsoup;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityShareResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 动态
|
| | |
| | | imgList.add(uploadResult.getUrl());
|
| | | data.put("shareImgs", imgList);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | activityService.addShareCount(activityId, 1);
|
| | | } catch (UserShareGoodsRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | } catch (ActivityException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 分享商品
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "sharegoodsv2", method = RequestMethod.POST)
|
| | | public void shareGoodsV2(AcceptData acceptData, long uid, long activityId, PrintWriter out) {
|
| | | try {
|
| | | JSONObject data = activityService.shareGoodsV2(uid, activityId);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | activityService.addShareCount(activityId, 1);
|
| | | } catch (UserShareGoodsRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | } catch (ActivityException e) {
|
| | | out.print(JsonUtil.loadFalseResult("分享失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | data.put("shareTitle", result.getTitle());
|
| | | data.put("shareImgs", result.getImgList());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserShareGoodsRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | } catch (ActivityException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | }
|
| | |
| | | data.put("shareTitle", result.getTitle());
|
| | | data.put("shareImgs", imgList);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | activityService.addShareCount(activityId, 1);
|
| | | } catch (ActivityException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | }
|