src/com/service/cartService.java
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.service;
import javax.servlet.http.HttpSession;
import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;
import com.util.Cart;
public class cartService
{
public String modiNum(int goodsId,int quantity)
{
String result="";
try
{
Thread.sleep(1000);
} catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
/*if(liuService.getGoods(goodsId).getKucun()<quantity)
{
result="no";
}
else
{*/
WebContext ctx = WebContextFactory.get();
HttpSession session=ctx.getSession();
Cart cart=(Cart)session.getAttribute("cart");
cart.updateCart(goodsId, quantity);
session.setAttribute("cart", cart);
result="yes";
/*}*/
return result;
}
public String delGoodsFromCart(int goodsId)
{
WebContext ctx = WebContextFactory.get();
HttpSession session=ctx.getSession();
Cart cart=(Cart)session.getAttribute("cart");
cart.delGoods(goodsId);
session.setAttribute("cart", cart);
return "yes";
}
public String clearCart()
{
try
{
Thread.sleep(1000);
} catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
后面还有 10 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
