Exemple #1
0
 /**
  * @Method saveCustomization
  *
  * @exception 保存定制订单要求JSON
  * @param artwork 艺术品
  * @param shop_id 店铺ID
  * @param category_id 分类ID
  * @param request 请求
  * @param response 响应
  * @return JSON
  * @author echo
  * @time 2016年1月17日
  */
 @RequestMapping("/mall/saveCustomization.json")
 @ResponseBody
 public JSON saveCustomization(
     Artwork artwork,
     Long shop_id,
     Long category_id,
     HttpServletRequest request,
     HttpServletResponse response) {
   HttpSession session = request.getSession();
   User user = (User) session.getAttribute("user");
   System.out.println(user);
   System.out.println(artwork);
   artwork.setContent("测试数据是否到数据库!");
   return shopService.saveOrUpdateArtwork(artwork, shop_id, category_id, user);
 }
Exemple #2
0
  /**
   * @Method toCustomizationPage
   *
   * @exception 进入定制订单要求填写页面
   * @param shop_id 店铺ID
   * @param artwork_id 艺术品ID
   * @param request 请求
   * @param response 响应
   * @return JSON
   * @author echo
   * @time 2016年1月17日
   */
  @RequestMapping("/mall/jsp/artMall/shop/customizationPage")
  @isUser
  public String toCustomizationPage(
      String shop_id, String artwork_id, HttpServletRequest request, HttpServletResponse response) {

    if (shop_id != null && (Integer.parseInt(shop_id) != 0 || !shop_id.equals(""))) {
      request.setAttribute("shop_id", shop_id);
    } else {
      return "/mall/index";
    }
    if (artwork_id != null && (Integer.parseInt(artwork_id) != 0 || artwork_id.equals(""))) {
      request.setAttribute("artwork_id", artwork_id);
      Artwork artwork = shopService.getArtworkByIdForArtist(Long.parseLong(artwork_id));
      request.setAttribute("artwork", artwork);
    } else {
      request.setAttribute("artwork_id", 0);
    }
    return "/mall/jsp/artMall/shop/customizationPage";
  }