package com.fzm.mall.server.front.order.controller;


import com.fzm.mall.server.front.asset.model.po.qo.OrderQO;
import com.fzm.mall.server.front.asset.model.vo.order.OrderPageVo;
import com.fzm.mall.server.front.asset.model.vo.order.OrderVO;
import com.fzm.mall.server.front.base.PageVO;
import com.fzm.mall.server.front.base.ResponseVO;
import com.fzm.mall.server.front.constant.MallResponseEnum;
import com.fzm.mall.server.front.constant.PageConst;
import com.fzm.mall.server.front.goods.model.vo.PageVo;
import com.fzm.mall.server.front.order.model.OrderDetail;
import com.fzm.mall.server.front.order.service.IOrderDetailService;
import com.fzm.mall.server.front.order.service.IOrderService;
import com.fzm.mall.server.front.user.model.Header;
import com.fzm.mall.server.front.valid.LongValid;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * <p>
 * 用户购物订单详情表 前端控制器
 * </p>
 *
 * @author fzm
 * @since 2021-03-03
 */
@Api(tags = "商品订单详情", description = "商品订单详情等")
@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping(value = "/mall/orderDetail", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class OrderDetailController {
    private final IOrderDetailService detailService;

    @ApiOperation(value = "查询未评价详情")
    @PostMapping("/select")
    public ResponseVO<List<OrderDetail>> pageOrder(@ApiIgnore @RequestAttribute Header header) {
        String uid = header.getUid();
        List<OrderDetail> list = detailService.getWaitsByUid(uid);
        return new ResponseVO<>(MallResponseEnum.SUCCESS, list);
    }
}
