package com.ym.mec.web.controller;

import io.swagger.annotations.Api;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ym.mec.biz.dal.entity.TenantPaymentOrder;
import com.ym.mec.biz.dal.page.TenantPaymentOrderQueryInfo;
import com.ym.mec.biz.service.TenantPaymentOrderService;
import com.ym.mec.common.controller.BaseController;

@Api(tags = "租户订单服务")
@RequestMapping("tenantPaymentOrder")
@RestController
public class TenantPaymentOrderController extends BaseController {

    @Autowired
    private TenantPaymentOrderService tenantPaymentOrderService;

    @ApiOperation(value = "分页查询订单")
    @GetMapping("/queryPage")
    public Object queryPage(TenantPaymentOrderQueryInfo queryInfo){
        return succeed(tenantPaymentOrderService.queryTenanPaymentPage(queryInfo));
    }

    @ApiOperation(value = "查询订单明细")
    @GetMapping("/query")
    public Object query(long id){
        TenantPaymentOrder order = tenantPaymentOrderService.get(id);
        if(order == null){
        	return failed("订单不存在");
        }
        return succeed(order);
    }

}
