package com.community.huiju.controller;


import com.community.commom.mode.ResponseBean;
import com.community.commom.session.UserElement;
import com.community.huiju.common.base.BaseController;
import com.community.huiju.service.IBillOrderService;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * <p>
 * 缴费订单表 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-04-18
 */
@RestController
@RequestMapping("/")
@Api(value = "订单 API", description = "订单 API")
public class BillOrderController extends BaseController {

    @Autowired
    private IBillOrderService iBillOrderService;


    @RequestMapping(value = "/bill/order/getByOrderNumberBillInvoice/{orderNumber}", method = RequestMethod.GET)
    @ApiOperation(value = "根据订单查询 缴费单", notes = "根据订单查询 缴费单")
    @ApiImplicitParams({
            @ApiImplicitParam(dataTypeClass = String.class, paramType = "header", name = "X-Auth-Token", value = "Token"),
            @ApiImplicitParam(dataTypeClass = String.class, paramType = "path", name = "orderNumber", value = "订单号")
    })
    public ResponseBean getByOrderNumberBillInvoice(HttpSession session, @PathVariable("orderNumber") String orderNumber) {
        ResponseBean responseBean = new ResponseBean();
        UserElement userElement = getUserElement(session);
        responseBean = iBillOrderService.getByOrderNumberBillInvoice(userElement, orderNumber);
        return responseBean;
    }


}
