| | |
| | | */
|
| | | @RequestMapping(value = "getClass", method = RequestMethod.POST)
|
| | | public void getClass(AcceptData acceptData, Integer cid, PrintWriter out) {
|
| | | try {
|
| | | // ios 只返回子集分类
|
| | | if (cid != null) {
|
| | | List<GoodsClass> list = new ArrayList<GoodsClass>();
|
| | |
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("查询失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 动态商品列表
|
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param cid
|
| | | * @param subId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getList", method = RequestMethod.POST)
|
| | | public void getList(AcceptData acceptData, Integer page, Long cid, Long subId, PrintWriter out) {
|
| | | try {
|
| | | if (cid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("主分类id不能为空"));
|
| | | return;
|
| | |
| | | data.put("count", count);
|
| | | data.put("list", getGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("查询失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享次数
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "shareRecord", method = RequestMethod.POST)
|
| | | public void shareRecord(AcceptData acceptData, String id, Long uid, PrintWriter out) {
|
| | | try {
|
| | | DynamicInfo dynamicInfo = dynamicInfoService.getById(id);
|
| | | if (dynamicInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该动态信息已不存在"));
|
| | |
| | | data.put("shareCount", shareCount +1);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("记录失败"));
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 时间处理
|
| | | * @return
|
| | | */
|
| | | private Gson getGson() {
|
| | | GsonBuilder gb = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder());
|
| | | gb.excludeFieldsWithoutExposeAnnotation();
|