|
@@ -488,4 +488,53 @@ public class ProductInfoHandler {
|
|
|
}
|
|
|
request.getRequestDispatcher(NameUtils.WECHAT_SHOP_PRODUCT_DESC_PAGE).forward(request, response);return;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有产品类型
|
|
|
+ * @param request
|
|
|
+ * @return list
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping("/selectProductType")
|
|
|
+ public ResultMsg selectProductType(HttpServletRequest request) throws Exception {
|
|
|
+ ResultMsg remsg=new ResultMsg();
|
|
|
+ //查询所有产品类型
|
|
|
+ List<ProductType> productTypeList = productInfoService.selectProductType();
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("productTypeList", productTypeList);
|
|
|
+ remsg.setMessage(ResultInfo.SUCCESSINFO);
|
|
|
+ remsg.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
+ remsg.setStatus(true);
|
|
|
+ remsg.setData(map);
|
|
|
+ return remsg;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有产品颜色
|
|
|
+ * @param request
|
|
|
+ * @return list
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping("/selectProductColor")
|
|
|
+ public ResultMsg selectProductColor(HttpServletRequest request,@RequestParam("productId") Integer productId) throws Exception {
|
|
|
+ ResultMsg remsg=new ResultMsg();
|
|
|
+ // 校验数据
|
|
|
+ if (productId == null || "".equals(productId)) {
|
|
|
+ remsg.setMessage(ResultInfo.loginOutError);
|
|
|
+ return remsg;
|
|
|
+ }
|
|
|
+ //查询所有产品颜色
|
|
|
+ List<ProductColor> productColorList = productInfoService.selectColorByPid(productId);
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("productColorList", productColorList);
|
|
|
+ remsg.setMessage(ResultInfo.SUCCESSINFO);
|
|
|
+ remsg.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
+ remsg.setStatus(true);
|
|
|
+ remsg.setData(map);
|
|
|
+ return remsg;
|
|
|
+ }
|
|
|
}
|