⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 goodsaction.java

📁 基于struts/hibernate/spring 的在线拍卖系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package y2ssh.zhangcuishan.web.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

//import y2ssh.zhangcuishan.biz.BidBiz;
import y2ssh.zhangcuishan.biz.GoodsBiz;
//import y2ssh.zhangcuishan.biz.impl.BidBizImpl;
import y2ssh.zhangcuishan.biz.impl.GoodsBizImpl;
import y2ssh.zhangcuishan.entity.Goods;
import y2ssh.zhangcuishan.util.JbUtils;
import y2ssh.zhangcuishan.web.form.GoodsForm;

/** 
 * MyEclipse Struts
 * Creation date: 08-27-2007
 * 
 * XDoclet definition:
 * @struts.action path="/goods" name="goodsForm" parameter="operate" scope="request"
 */
public class GoodsAction extends BaseAction {
	/*
	 * Generated Methods
	 */
	private GoodsBiz goodsBiz = new GoodsBizImpl();
//	private BidBiz bidBiz = new BidBizImpl();	
	
	public ActionForward toAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		return mapping.findForward("add_goods");
	}
	
	public ActionForward doAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		GoodsForm goodsForm = (GoodsForm) form;
		Goods item = goodsForm.getItem();
		this.goodsBiz.addGoods(item,super.getCurrUserId(request));
		return mapping.findForward("index");
	}
	
//	public ActionForward doBid(ActionMapping mapping, ActionForm form,
//			HttpServletRequest request, HttpServletResponse response) {
//		return mapping.findForward("");
//	}

//	public ActionForward doDeal(ActionMapping mapping, ActionForm form,
//			HttpServletRequest request, HttpServletResponse response) {
//		String key = request.getParameter("bid_id");
//		this.bidBiz.deal(JbUtils.parseLong(key));
//		return mapping.findForward("");
//	}
	
	public ActionForward doDel(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String key = request.getParameter("goods_id");
		this.goodsBiz.delGoods(JbUtils.parseLong(key));
		return mapping.findForward("");
	}
	
	public ActionForward toOnSaleGoodsList(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		List list = this.goodsBiz.getOnSaleGoodsList();
		request.setAttribute("list", list);
		return mapping.findForward("on_sale_list");
	}
	
	public ActionForward toMyGoodsList(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Long userId = super.getCurrUserId(request);
		List list = this.goodsBiz.getMyGoodsList(userId);
		request.setAttribute("list", list);
		return mapping.findForward("my_goods_list");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -