package cn.wisenergy.web.admin.controller.app;

import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.OrderInfo;
import cn.wisenergy.model.dto.OrderInfoQuery;
import cn.wisenergy.service.app.OrderService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "订单管理")
@Slf4j
@RestController
public class OrderController {

    @Autowired
    private OrderService orderService;

    @ApiOperation(value = "获取订单分页列表", notes = "获取订单分页列表", httpMethod = "GET")
    @ApiImplicitParam(name = "query", value = "查询条件", dataType = "OrderInfoQuery")
    @RequestMapping("admin/order/findBypage")
    public R<PageInfo<OrderInfo>> findByPage(OrderInfoQuery query){
        return orderService.findByPage(query);
    }
}
