Skip to content

Commit

Permalink
add test cases for #20
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeiminds committed Nov 16, 2018
1 parent 763e0db commit 44c44ec
Show file tree
Hide file tree
Showing 5 changed files with 361 additions and 12 deletions.
21 changes: 18 additions & 3 deletions services/ubill/describe_order_detail_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,52 @@ type DescribeOrderDetailInfoRequest struct {

//开始时间,UNIX time format
BeginTime *int `required:"true"`

//结束时间,时间跨度不超过3个月
EndTime *int `required:"true"`
EndTime *int `required:"true"`

Regions []string `required:"true"`

//产品类型,默认全部的产品类型
ResourceTypes []string `required:"false"`

//订单类型,默认全部订单类型
OrderTypes []string `required:"false"`

//付费类型,默认全部的计费方式
ChargeTypes []string

//订单状态,默认选中全部的可选参数
OrderStates []string `required:"false"`

//是否开过发票,默认选中全部的可选参数
Invoiceds []string `required:"false"`

//返回数据长度,默认25
Limit *int `required:"false"`

//数据偏移量,默认0
Offset *int `required:"false"`

//资源ID
ResourceIDs []string `required:"false"`
ResourceIds []string `required:"false"`

//交易单号,该字段存在时,可以不传BeginTime和EndTime
TradeNos []string `required:"false"`

//true表示查询全部,默认全部,其他选项按照项目自查询
QueryAll *string `required:"false"`
}

// DescribeOrderDetailInfoResponse is response schema for DescribeOrderDetailInfo action
type DescribeOrderDetailInfoResponse struct {
response.CommonBase

//json格式的订单信息
OrderInfo []OrderInfo `json:"order_info"`
OrderInfos []OrderInfo
}

// NewDescribeOrderDetailInfoRequest will create request of DescribeOrderDetailInfo action.
func (c *UBillClient) NewDescribeOrderDetailInfoRequest() *DescribeOrderDetailInfoRequest {
req := &DescribeOrderDetailInfoRequest{}

Expand All @@ -53,6 +67,7 @@ func (c *UBillClient) NewDescribeOrderDetailInfoRequest() *DescribeOrderDetailIn
return req
}

// DescribeOrderDetailInfo - 获取订单信息
func (c *UBillClient) DescribeOrderDetailInfo(req *DescribeOrderDetailInfoRequest) (*DescribeOrderDetailInfoResponse, error) {
var err error
var res DescribeOrderDetailInfoResponse
Expand Down
15 changes: 7 additions & 8 deletions services/ubill/types_ubill_order_infos.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@ package ubill

type OrderInfo struct {
OrderNo string `json:"OrderNo"`
ReourceId string
OrderType string
ChargeType string
ResourceId string
ResourceTag string
ResourceTag []ResourceTag
OrderState string
CreateTime string
CreateTime int
Amount string //订单总金额
AmountReal string //现金账户金额
AmountFree string //赠送账户金额(元)
AmountCoupon string //优惠金额
CouponCode string //如果AmountCoupon不为0,显示代金券号码
ResourceType string
UpdateTime string
Quantity int64 //计费周期数
Count int64 //资源数量
UpdateTime int
Quantity string //计费周期数
Count int //资源数量
Invoiced string //是否开过发票
StartTime string //开始时间
EndTime string //结束时间
StartTime int //开始时间
EndTime int //结束时间
OrderDetails []OrderDetail
RegionId string //region
TradeNo string //交易号
Expand Down
Loading

0 comments on commit 44c44ec

Please sign in to comment.