package pposRequest

import (
	"errors"
	"net/url"
)

//停车场 - 上报类请求
func (that *PPOSClient) NewCarParkReportRequest() *CarParkReportCarInRequest {
	return &CarParkReportCarInRequest{
		Request: Request{
			Client:     that,
			apiAddress: "",
		},
	}
}

//接口地址
func (that *CarParkReportCarInRequest) ReportCarIn() *CarParkReportCarInRequest {
	that.apiAddress = "/carpark/carparkBill/reportCarIn"
	return that
}
func (that *CarParkReportCarInRequest) ReportCarOut() *CarParkReportCarInRequest {
	that.apiAddress = "/carpark/carparkBill/reportCarOut"
	return that
}
func (that *CarParkReportCarInRequest) ReportPreCarIn() *CarParkReportCarInRequest {
	that.apiAddress = "/carpark/carparkBill/reportPreCarIn"
	return that
}
func (that *CarParkReportCarInRequest) ReportPreCarOut() *CarParkReportCarInRequest {
	that.apiAddress = "/carpark/carparkBill/reportPreCarOut"
	return that
}
func (that *CarParkReportCarInRequest) ReportParkingFee() *CarParkReportCarInRequest {
	that.apiAddress = "/carpark/carparkBill/reportParkingFee"
	return that
}
func (that *CarParkReportCarInRequest) ReportParkRemainCarport() *CarParkReportCarInRequest {
	that.apiAddress = "/carpark/carparkBill/remainCarport"
	return that
}

//
type CarParkReportCarInRequest struct {
	Request
}

//SetPostParams...
func (that *CarParkReportCarInRequest) SetPostParams(value url.Values) *CarParkReportCarInRequest {
	that.initParams()
	that.params = value
	return that
}

//Params ...
func (that *CarParkReportCarInRequest) Params() (url.Values, error) {
	var m = make(url.Values)
	m = that.params
	return m, nil
}

//Do ...
func (that *CarParkReportCarInRequest) Do() (interface{}, error) {
	if that.apiAddress == "" {
		return "", errors.New("接口不存在")
	}
	_data, _err := that.Client.GetData(that.apiAddress, that)
	if _err != nil {
		return "", _err
	}
	return _data, nil
}
