package com.miaxis.app.controller.order;

import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.page.ResponsePageInfo;
import com.miaxis.order.domain.OrderInfo;
import com.miaxis.order.service.IOrderInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 【订单信息】Controller
 *
 * @author miaxis
 * @date 2022-06-07
 */
@RestController
@RequestMapping(Constants.OPEN_PREFIX+"/order/info")
@Api(tags={"【APP-订单信息】"})
public class OrderInfoController extends BaseController{
    @Autowired
    private IOrderInfoService orderInfoService;


    /**
     * 查询订单信息列表
     */
    @GetMapping("/list")
    @ApiOperation("查询订单信息列表")
        @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
    })
    public ResponsePageInfo<OrderInfo> list(@ModelAttribute OrderInfo orderInfo){
        startPage();
        List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderInfo);
        return toResponsePageInfo(list);
    }










}
