// Copyright 2019 getensh.com. All rights reserved.
// Use of this source code is governed by getensh.com.
package gd_statistics

type BiGetDashReq struct {
}

type BiDashVehicle struct {
	Count    int64 `json:"count"`
	Increase int64 `json:"increase"`
}

type BiDashCharge struct {
	Charge     int64   `json:"charge"`
	ChargeRate float64 `json:"charge_rage"`
	Increase   float64 `json:"increase"`
}

type BiDashFail struct {
	Fail     int64   `json:"fail"`
	FailRate float64 `json:"fail_rate"`
	Increase float64 `json:"increase"`
}

type BiDash struct {
	VehicleInfo BiDashVehicle `json:"vehicle_info"`
	ChargeInfo  BiDashCharge  `json:"charge_info"`
	FailInfo    BiDashFail    `json:"fail_info"`
}

type BiGetDashReply struct {
	DashInfo BiDash `json:"dash_info"`
}

type BiGetServiceStatusReq struct {
	StartTimestamp    int64   `json:"start_timestamp"`
	EndTimestamp      int64   `json:"end_timestamp"`
	MerchantId        int64   `json:"merchant_id"`
	ApiId             []int64 `json:"api_id"`
	TodayEndTimestamp int64   `json:"today_end_timestamp"`
	TimeType          int     `json:"time_type" description:"0按天1按时"`
}

type ServiceStatus struct {
	TimestampMinute int64   `json:"timestamp_minute"`
	FailCount       int     `json:"fail_count"`
	AvgElapsed      float64 `json:"avg_elapsed"`
}

type BiGetServiceStatusReply struct {
	Infos []ServiceStatus `json:"infos"`
}

type BiGetProviderServiceStatusReq struct {
	StartTimestamp    int64   `json:"start_timestamp"`
	EndTimestamp      int64   `json:"end_timestamp"`
	ProviderApiId     []int64 `json:"provider_api_id"`
	TodayEndTimestamp int64   `json:"today_end_timestamp"`
	TimeType          int     `json:"time_type" description:"0按天1按时"`
}

type BiGetProviderServiceStatusReply struct {
	Infos []ServiceStatus `json:"infos"`
}

type BiGetTrendReq struct {
	StartTimestamp    int64   `json:"start_timestamp"`
	EndTimestamp      int64   `json:"end_timestamp"`
	MerchantId        int64   `json:"merchant_id"`
	TodayEndTimestamp int64   `json:"today_end_timestamp"`
	TimeType          int     `json:"time_type" description:"0按天1按时"`
	ApiId             []int64 `json:"api_id"`
}

type Trend struct {
	Date   string `json:"date"`
	Total  int64  `json:"total"`
	Charge int64  `json:"charge"`
}

type BiGetTrendReply struct {
	Infos              []Trend `json:"infos"`
	TotalMax           int64   `json:"total_max"`
	TotalAvg           int64   `json:"total_avg"`
	TotalMin           int64   `json:"total_min"`
	TotalCurrent       int64   `json:"total_current"`
	ChargeMax          int64   `json:"charge_max"`
	ChargeMin          int64   `json:"charge_min"`
	ChargeAvg          int64   `json:"charge_avg"`
	ChargeCurrent      int64   `json:"charge_current"`
	LastStageTotalAvg  int64   `json:"last_stage_total_avg"`
	LastStageChargeAvg int64   `json:"last_stage_charge_avg"`
}

type BiGetProviderTrendReq struct {
	StartTimestamp    int64   `json:"start_timestamp"`
	EndTimestamp      int64   `json:"end_timestamp"`
	ProviderApiId     []int64 `json:"provider_api_id"`
	TodayEndTimestamp int64   `json:"today_end_timestamp"`
	TimeType          int     `json:"time_type" description:"0按天1按时"`
}

type BiGetProviderTrendReply struct {
	Infos              []Trend `json:"infos"`
	TotalMax           int64   `json:"total_max"`
	TotalAvg           int64   `json:"total_avg"`
	TotalMin           int64   `json:"total_min"`
	TotalCurrent       int64   `json:"total_current"`
	ChargeMax          int64   `json:"charge_max"`
	ChargeAvg          int64   `json:"charge_avg"`
	ChargeMin          int64   `json:"charge_min"`
	ChargeCurrent      int64   `json:"charge_current"`
	LastStageTotalAvg  int64   `json:"last_stage_total_avg"`
	LastStageChargeAvg int64   `json:"last_stage_charge_avg"`
}

type BiGetReportReq struct {
	PageNumber        int      `json:"page_number"`
	Date              []string `json:"date"`
	MerchantId        int64    `json:"merchant_id"`
	ApiId             []int64  `json:"api_id"`
	PageSize          int      `json:"page_size" in:"query"`
	TodayEndTimestamp int64    `json:"today_end_timestamp"`
}

type BiReportInfo struct {
	MerchantName      string `json:"merchant_name"`
	Date              string `json:"date"`
	ApiName           string `json:"api_name"`
	Total             int64  `json:"total"`
	Valid             int64  `json:"valid"`
	ValidRate         string `json:"valid_rate"`
	QueryNoRecord     int64  `json:"query_no_record"`
	QueryNoRecordRate string `json:"query_no_record_rate"`
	Fail              int64  `json:"fail"`
	FailRate          string `json:"fail_rate"`
	Reuse             int64  `json:"reuse"`
	ReuseRate         string `json:"reuse_rate"`
	Charge            int64  `json:"charge"`
	ChargeRate        string `json:"charge_rate"`
	AvgElapsed        string `json:"avg_elapsed"`
}

type BiProviderReportInfo struct {
	ProviderName      string `json:"provider_name"`
	Date              string `json:"date"`
	ProviderApiName   string `json:"provider_api_name"`
	Total             int64  `json:"total"`
	QueryNoRecord     int64  `json:"query_no_record"`
	QueryNoRecordRate string `json:"query_no_record_rate"`
	Fail              int64  `json:"fail"`
	FailRate          string `json:"fail_rate"`
	Charge            int64  `json:"charge"`
	ChargeRate        string `json:"charge_rate"`
	AvgElapsed        string `json:"avg_elapsed"`
}

type BiGetReportReply struct {
	Total    int            `json:"total"`
	PageSize int            `json:"page_size"`
	Infos    []BiReportInfo `json:"bi_report_info"`
	Sum      BiReportInfo   `json:"sum"`
}

type BiGetProviderReportReq struct {
	PageNumber        int      `json:"page_number"`
	Date              []string `json:"date"`
	ProviderApiId     []int64  `json:"provider_api_id"`
	PageSize          int      `json:"page_size" in:"query"`
	TodayEndTimestamp int64    `json:"today_end_timestamp"`
}

type BiGetProviderReportReply struct {
	Total      int                    `json:"total"`
	PageSize   int                    `json:"page_size"`
	Infos      []BiProviderReportInfo `json:"infos"`
	Sum        BiProviderReportInfo   `json:"sum"`
	PageNumber int                    `json:"page_number"`
}

type BiGetDistributionReq struct {
	ApiId             []int64 `json:"api_id"`
	MerchantId        int64   `json:"merchant_id"`
	StartTimestamp    int64   `json:"start_timestamp"`
	EndTimestamp      int64   `json:"end_timestamp"`
	TodayEndTimestamp int64   `json:"today_end_timestamp"`
}

type CodeCount struct {
	Code  string `json:"code"`
	Msg   string `json:"msg"`
	Count int    `json:"count"`
}
type ProviderCount struct {
	ProviderApiName string `json:"provider_api_name"`
	ProviderName    string `json:"provider_name"`
	Count           int    `json:"count"`
	//Success         int    `json:"success"`
	//Query           int    `json:"query"`
	Charge int `json:"charge"`
}

type BiDistribution struct {
	ApiCodeTotal int64 `json:"api_code_total"`
	ApiValid     int   `json:"api_valid"`
	ApiCharge    int   `json:"api_charge"`
	//ApiSuccess   int             `json:"api_success"`
	ApiFail     int         `json:"api_fail"`
	ApiCodeList []CodeCount `json:"api_code_list"`
	//	ProviderList []ProviderCount `provider_list`
}

type BiProviderDistribution struct {
	ProviderCharge int `json:"provider_charge"`
	//ProviderSuccess   int         `json:"provider_success"`
	ProviderFail      int         `json:"provider_fail"`
	ProviderCodeTotal int         `json:"provider_code_total"`
	ProviderCodeList  []CodeCount `json:"provider_code_list"`
}

type BiGetDistributionReply struct {
	Info BiDistribution `json:"info"`
}

type BiGetProviderDistributionReq struct {
	ProviderApiId     []int64 `json:"provider_api_id"`
	StartTimestamp    int64   `json:"start_timestamp"`
	EndTimestamp      int64   `json:"end_timestamp"`
	TodayEndTimestamp int64   `json:"today_end_timestamp"`
}

type BiGetProviderDistributionReply struct {
	Info BiProviderDistribution `json:"info"`
}

type ApiServiceDataInfo struct {
	Valid  int64 `json:"valid"`
	Charge int64 `json:"charge"`
	Reuse  int64 `json:"resue"`
	Fail   int64 `json:"fail"`
}

type ApiServiceAllDataInfo struct {
	Today     ApiServiceDataInfo `json:"today"`
	Yesterday ApiServiceDataInfo `json:"yesterday"`
	Week      ApiServiceDataInfo `json:"week"`
	Month     ApiServiceDataInfo `json:"month"`
}

type ApiServiceConsumeDetail struct {
	ApiName    string `json:"api_name"`
	Rate       string `json:"rate"`
	Charge     int64  `json:"charge"`
	Valid      int64  `json:"valid"`
	ChargeRate string `json:"charge_rate"`
}
type ApiServiceConsumeInfo struct {
	MerchantName string                    `json:"merchant_name"`
	Charge       int64                     `json:"charge"`
	Detail       []ApiServiceConsumeDetail `json:"detail"`
}

type ApiServiceIncomeDetail struct {
	MerchantName string `json:"merchant_name"`
	Rate         string `json:"rate"`
	Charge       int64  `json:"charge"`
	Valid        int64  `json:"valid"`
}

type ApiServiceIncomeInfo struct {
	ApiName string                   `json:"api_name"`
	Charge  int64                    `json:"charge"`
	Detail  []ApiServiceIncomeDetail `json:"detail"`
}

type ApiServiceFailDetail struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Rate string `json:"rate"`
	Fail int64  `json:"fail"`
}

type ApiServiceFailInfo struct {
	ApiName string                 `json:"api_name"`
	Fail    int64                  `json:"fail"`
	Detail  []ApiServiceFailDetail `json:"detail"`
}

type BiGetApiServiceDataInfoReq struct {
	ApiId             int64 `json:"api_id"`
	TodayEndTimestamp int64 `json:"today_end_timestamp"`
}

type BiGetApiServiceDataInfoReply struct {
	Info ApiServiceAllDataInfo `json:"info"`
}

type BiGetApiServiceConsumeInfoReq struct {
	PageNumber        int   `json:"page_number"`
	PageSize          int   `json:"page_size"`
	TimeType          int   `json:"time_type" description:"0 今日 1 昨日 2 本周 3 本月"`
	TodayEndTimestamp int64 `json:"today_end_timestamp"`
}

type BiGetApiServiceConsumeInfoReply struct {
	Infos      []ApiServiceConsumeInfo `json:"infos"`
	Total      int64                   `json:"total"`
	PageNumber int                     `json:"page_number" in:"query"`
	PageSize   int                     `json:"page_size" in:"query"`
}

type BiGetApiServiceIncomeInfoReq struct {
	PageNumber        int   `json:"page_number"`
	PageSize          int   `json:"page_size"`
	TimeType          int   `json:"time_type" description:"0 今日 1 昨日 2 本周 3 本月"`
	TodayEndTimestamp int64 `json:"today_end_timestamp"`
}
type BiGetApiServiceIncomeInfoReply struct {
	Infos      []ApiServiceIncomeInfo `json:"infos"`
	Total      int64                  `json:"total"`
	PageNumber int                    `json:"page_number" in:"query"`
	PageSize   int                    `json:"page_size" in:"query"`
}

type BiGetApiServiceFailInfoReq struct {
	PageNumber        int   `json:"page_number"`
	PageSize          int   `json:"page_size"`
	TimeType          int   `json:"time_type" description:"0 今日 1 昨日 2 本周 3 本月"`
	TodayEndTimestamp int64 `json:"today_end_timestamp"`
}

type BiGetApiServiceFailInfoReply struct {
	Infos      []ApiServiceFailInfo `json:"infos"`
	Total      int64                `json:"total"`
	PageNumber int                  `json:"page_number" in:"query"`
	PageSize   int                  `json:"page_size" in:"query"`
}

type ProviderServiceDataInfo struct {
	Valid  int64 `json:"valid"`
	Charge int64 `json:"charge"`
	Fail   int64 `json:"fail"`
}

type ProviderServiceAllDataInfo struct {
	Today     ProviderServiceDataInfo `json:"today"`
	Yesterday ProviderServiceDataInfo `json:"yesterday"`
	Week      ProviderServiceDataInfo `json:"week"`
	Month     ProviderServiceDataInfo `json:"month"`
}

type ProviderServicePayDetail struct {
	ProviderApiName string `json:"provider_api_name"`
	Rate            string `json:"rate"`
	Charge          int64  `json:"charge"`
	Valid           int64  `json:"valid"`
	ChargeRate      string `json:"charge_rate"`
}

type ProviderServicePayInfo struct {
	ProviderName string                     `json:"provider_name"`
	Charge       int64                      `json:"charge"`
	Detail       []ProviderServicePayDetail `json:"detail"`
}

type ProviderServiceFailDetail struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Rate string `json:"rate"`
	Fail int64  `json:"fail"`
}

type ProviderServiceFailInfo struct {
	ProviderName    string                      `json:"provider_name"`
	ProviderApiName string                      `json:"provider_api_name"`
	Fail            int64                       `json:"fail"`
	Detail          []ProviderServiceFailDetail `json:"detail"`
}

type BiGetProviderServiceDataInfoReq struct {
	ProviderApiId     int64 `json:"provider_api_id"`
	TodayEndTimestamp int64 `json:"today_end_timestamp"`
}

type BiGetProviderServiceDataInfoReply struct {
	Info ProviderServiceAllDataInfo `json:"info"`
}

type BiGetProviderServicePayInfoReq struct {
	PageNumber        int   `json:"page_number"`
	PageSize          int   `json:"page_size"`
	TimeType          int   `json:"time_type" description:"0 今日 1 昨日 2 本周 3 本月"`
	TodayEndTimestamp int64 `json:"today_end_timestamp"`
}

type BiGetProviderServicePayInfoReply struct {
	Infos      []ProviderServicePayInfo `json:"infos"`
	Total      int64                    `json:"total"`
	PageNumber int                      `json:"page_number"`
	PageSize   int                      `json:"page_size"`
}

type BiGetProviderServiceFailInfoReq struct {
	PageNumber        int   `json:"page_number"`
	PageSize          int   `json:"page_size"`
	TimeType          int   `json:"time_type" description:"0 今日 1 昨日 2 本周 3 本月"`
	TodayEndTimestamp int64 `json:"today_end_timestamp"`
}

type BiGetProviderServiceFailInfoReply struct {
	Infos      []ProviderServiceFailInfo `json:"infos"`
	Total      int64                     `json:"total"`
	PageNumber int                       `json:"page_number"`
	PageSize   int                       `json:"page_size"`
}

type BiGetPayDistributionReq struct {
	ApiId             []int64 `json:"api_id"`
	MerchantId        int64   `json:"merchant_id"`
	StartTimestamp    int64   `json:"start_timestamp"`
	EndTimestamp      int64   `json:"end_timestamp"`
	TodayEndTimestamp int64   `json:"today_end_timestamp"`
}

type BiGetPayDistributionReply struct {
	MerchantSumCharge int64           `json:"merchant_sum_charge"`
	ProviderSumCharge int64           `json:"provider_sum_charge"`
	PayInfos          []ProviderCount `json:"pay_infos"`
}
