src/com/shop/controller/OsOrderOperationController.java

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.shop.controller;

import com.shop.po.OsUser;
import com.shop.service.OsOrderService;
import com.shop.vo.OrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * @Author 康健
 * @Date 2017/8/12 22:42
 */
@Controller
@RequestMapping(value = "/uc/order")
public class OsOrderOperationController {

    @Autowired
    private OsOrderService orderService;

    @RequestMapping(value = "/list")
    public String orderUI(HttpSession session, HttpServletRequest request,
                          @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
                          @RequestParam(value = "limit", required = false, defaultValue = "8") Integer limit) {
        OsUser user = (OsUser) session.getAttribute("user");
        List<OrderVO> orderVOs = orderService.getPageOrderByUserId(user.getUserId(), page, limit);
        com.shop.common.PageInfo info = new  com.shop.common.PageInfo(page.intValue(), limit.intValue(), "", "");

        info.setTotal((int) orderService.getL().getTotal());
        request.setAttribute("pageInfo", info);
        request.setAttribute("orderVOs", orderVOs);
        return "/usercenter/user_order";
    }

    @RequestMapping(value = "//{orderNumber}")
    public String orderUI(@PathVariable Long orderNumber, HttpSession session, HttpServletRequest request) {
        OrderVO orderVO = orderService.getOrderByOrderNumber(orderNumber);
        request.setAttribute("orderVO", orderVO);
        return "/usercenter/user_order_view";
    }



    /*@Autowired
    private IOrderService orderService;
    @Autowired
    private IOrderShipmentService orderShipmentService;

    *//**
     * PUT 取消订单
     * @return
     *//*
    @ApiOperation(value = "取消订单", notes = "根据URL传过来的订单编号取消订单")
    @PutMapping(value = "/cancelOrder")
后面还有 31 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。