springboot酒店管理系统java酒店预订系统酒店预订平台源码

springboot酒店管理系统java酒店预订系统酒店预订平台源码,第1张

springboot酒店管理系统java酒店预订系统酒店预订平台源码

开发工具:idea (eclipse) 环境:jdk1.8  mysql5.7
数据库库连接工具 navcat

 

 

 

package priv.jesse.mall.web.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import priv.jesse.mall.entity.Order;
import priv.jesse.mall.entity.OrderItem;
import priv.jesse.mall.entity.pojo.ResultBean;
import priv.jesse.mall.service.OrderService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@Controller
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    
    @RequestMapping("/toList.html")
    public String toOrderList() {
        return "mall/order/list";
    }

    
    @RequestMapping("/list.do")
    @ResponseBody
    public ResultBean> listData(HttpServletRequest request) {
        List orders = orderService.findUserOrder(request);
        return new ResultBean<>(orders);
    }

    
    @RequestMapping("/getDetail.do")
    @ResponseBody
    public ResultBean> getDetail(int orderId) {
        List orderItems = orderService.findItems(orderId);
        return new ResultBean<>(orderItems);
    }

    
    @RequestMapping("/submit.do")
    public void submit(String name,
                       String phone,
                       String addr,
                       HttpServletRequest request,
                       HttpServletResponse response) throws Exception {
        orderService.submit(name, phone, addr, request, response);
    }

    
    @RequestMapping("pay.do")
    @ResponseBody
    public ResultBean pay(int orderId, HttpServletResponse response) throws IOException {
        orderService.pay(orderId);
        return new ResultBean<>(true);
    }

    
    @RequestMapping("receive.do")
    @ResponseBody
    public ResultBean receive(int orderId, HttpServletResponse response) throws IOException {
        orderService.receive(orderId);
        return new ResultBean<>(true);
    }


}

 

 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5685686.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存