开发者社区> 问答> 正文

创建的OrderAction的java class代码是什么?

已解决

创建的OrderAction的java class代码是什么?

展开
收起
dzuv4lze7fhcm 2022-03-31 20:29:44 612 0
1 条回答
写回答
取消 提交回答
  • 推荐回答

    import java.util.List;

    import org.springframework.beans.factory.annotation.Autowired;

    import org.springframework.stereotype.Controller;

    import cn.sxt.service.orderService;

    import cn.sxt.service. detailservice;

    import cn.sxt.vo.Order;

    @Controller

    @Scope(“prototype”)

    public class OrderAction {

    private List list;

    private List details;

    private int orderId;

    private int detailId;

    @Autowired

    private OrderService orderService;

    @Autowired

    private DetailService detailservice;

    //获取所有订单---getList

    public string list() {

    list = orderService.list();

    return "success";

    }

    //获取订单详情

    public string details() {

    details = detailsService.listByOrderId(orderId);

    return "success";

    }

    //删除订单详情中的一项

    public string delete(){

    detailService.delete(orderid, detailId);

    return "success";l

    }

    public List getList( ) {

    return list;

    }

    public void setList( List list) {

    this.list = list;

    }

    public orderservice getorderService( ) {

    return orderservice;

    }

    public void setOrderService(OrderService orderService) {

    this.orderService = orderService;

    }

    public Detailservice getDetailService( ) {

    return detailservice;

    }

    public void setDetailservice(DetailService detailService) {

    this.detailService = detailservice;

    }

    public List getDetails( ) {

    return details;

    }

    public void setDetails(List details) {

    this.details = details ;

    }

    public int getorderId( ) {

    return orderId;

    }

    public void setOrderId( int orderId) {

    this.orderid = orderId;

    }

    public int getDetailId( ) {

    return detailId;

    }

    public void setDetailId( int detailId) {

    this.detailId = detailId;

    }

    2022-03-31 20:30:41
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载