Exemplo n.º 1
0
  @RequestMapping("/jsp/**/picGood_print")
  public @ResponseBody Picture picDetail_GoodPrint(
      Good good,
      @RequestParam(value = "pic_no", required = false) int pic_no,
      HttpSession session) {
    // 좋아요 클릭

    AuthInfo authInfo = (AuthInfo) session.getAttribute("authInfo");

    int mem_no = authInfo.getMem_no();

    good.setMem_no(mem_no);
    good.setPic_no(pic_no);

    int findGood = goodService.findGood(good);

    return goodService.detailPicture(pic_no);
  }
Exemplo n.º 2
0
  @RequestMapping("/jsp/**/picGood_In")
  public @ResponseBody Picture picDetail_Good(
      Good good, @RequestParam(value = "pic_no", required = false) int pic_no) {
    // 좋아요 클릭

    good.setMem_no(1);
    good.setPic_no(pic_no);

    int findGood = goodService.findGood(good);

    if (findGood == 0) {
      goodService.goodInsert(good);
      goodService.plus_good_count(pic_no);
    } else {
      goodService.goodDelete(good);
      goodService.minus_good_count(pic_no);
    }

    return goodService.detailPicture(pic_no);
    // return "picDetail_Good?pic_no=" + pic_no;
    // "redirect:/jsp/basic/picDetail?pic_no="+pic_no;

  }