New file |
| | |
| | | package com.yeshi.fanli.controller.apph5;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/apph5/v1/share")
|
| | | public class AppH5ShareController {
|
| | |
|
| | | |
| | | @Resource
|
| | | private UserShareGoodsGroupService userShareGoodsGroupService;
|
| | | |
| | | @Resource
|
| | | private UserShareGoodsRecordService userShareGoodsRecordService;
|
| | | |
| | | /**
|
| | | * 分享商品详情
|
| | | * @param callback
|
| | | * @param shareId 分享id
|
| | | * @param source 来源
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDetail")
|
| | | public void getDetail(String callback, Long shareId, String source, String fingerprint, PrintWriter out) {
|
| | | |
| | | try {
|
| | | |
| | | if (shareId == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不正确"));
|
| | | return;
|
| | | }
|
| | | // 获取商品信息
|
| | | JSONObject data = userShareGoodsRecordService.getGoodsGroup(shareId);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | |
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | }
|