package param_v1_0

import (
	"gd_management_gateway/params/param_base"
	"gd_management_gateway/rpc_apis/gd_statistics"
)

type LogQueryAccessLogReq struct {
	param_base.BasicParam
	State          int     `json:"state" description:"接口调用状态" require:"false" in:"query"`
	RequestParam   string  `json:"request_param" description:"请求参数" require:"false" in:"query"`
	Search         string  `json:"search" description:"关键字查询" require:"false" in:"query"`
	MerchantId     int64   `json:"merchant_id" description:"商户id" require:"false" in:"query"`
	ApiId          int64   `json:"api_id" description:"api id" require:"false" in:"query"`
	StartTimestamp int64   `json:"start_timestamp" description:"开始时间" require:"false" in:"query"`
	EndTimestamp   int64   `json:"end_timestamp" description:"结束时间" require:"false" in:"query"`
	PageSize       int64   `json:"page_size" description:"页大小" require:"false" in:"query"`
	PageNumber     int64   `json:"page_number" description:"页号" require:"false" in:"query"`
	Code           string  `json:"code" description:"错误码" require:"false" in:"query"`
	Min            float64 `json:"min" description:"最小耗时" require:"false" in:"query"`
	Max            float64 `json:"max" description:"最大耗时" require:"false" in:"query"`
}

type LogQueryAccessLogResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryAccessLogReply `json:"data"`
}

type LogQueryThirdpartAccessLogReq struct {
	param_base.BasicParam
	State          int     `json:"state" description:"接口调用状态" require:"false" in:"query"`
	Search         string  `json:"search" description:"关键字查询" require:"false" in:"query"`
	RequestParam   string  `json:"request_param" description:"请求参数" require:"false" in:"query"`
	ProviderId     int64   `json:"provider_id" description:"三方平台id" require:"false" in:"query"`
	ProviderApiId  int64   `json:"provider_api_id" description:"三方api id" require:"false" in:"query"`
	StartTimestamp int64   `json:"start_timestamp" description:"开始时间" require:"false" in:"query"`
	EndTimestamp   int64   `json:"end_timestamp" description:"结束时间" require:"false" in:"query"`
	PageSize       int64   `json:"page_size" description:"页大小" require:"false" in:"query"`
	PageNumber     int64   `json:"page_number" description:"页号" require:"false" in:"query"`
	Min            float64 `json:"min" description:"最小耗时" require:"false" in:"query"`
	Max            float64 `json:"max" description:"最大耗时" require:"false" in:"query"`
	RawCode        string  `json:"raw_code" description:"原始错误码" require:"false" in:"query"`
}

type LogQueryThirdpartAccessLogResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryThirdpartAccessLogReply `json:"data"`
}

type LogQueryAccessLogCountReq struct {
	param_base.BasicParam
	MerchantId     int64 `json:"merchant_id" description:"商户id" require:"false" in:"query"`
	ApiId          int64 `json:"api_id" description:"api id" require:"false" in:"query"`
	StartTimestamp int64 `json:"start_timestamp" description:"开始时间" require:"false" in:"query"`
	EndTimestamp   int64 `json:"end_timestamp" description:"结束时间" require:"false" in:"query"`
	PageSize       int64 `json:"page_size" description:"页大小" require:"false" in:"query"`
	PageNumber     int64 `json:"page_number" description:"页号" require:"false" in:"query"`
}

type LogQueryAccessLogCountResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryAccessLogCountReply `json:"data"`
}

type LogQueryThirdpartAccessLogCountReq struct {
	param_base.BasicParam
	ProviderId     int64 `json:"provider_id" description:"三方平台id" require:"false" in:"query"`
	ProviderApiId  int64 `json:"provider_api_id" description:"三方api id" require:"false" in:"query"`
	StartTimestamp int64 `json:"start_timestamp" description:"开始时间" require:"false" in:"query"`
	EndTimestamp   int64 `json:"end_timestamp" description:"结束时间" require:"false" in:"query"`
	PageSize       int64 `json:"page_size" description:"页大小" require:"false" in:"query"`
	PageNumber     int64 `json:"page_number" description:"页号" require:"false" in:"query"`
}

type LogQueryThirdpartAccessLogCountResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryThirdpartAccessLogCountReply `json:"data"`
}
type LogQueryAccessLogThirdpartLogReq struct {
	param_base.BasicParam
	AccessId   int64  `json:"access_id" description:"访问日志id" require:"true" in:"query"`
	CreateTime string `json:"create_time" in:"query"`
}

type LogQueryAccessLogThirdpartLogResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryAccessLogThirdpartLogReply `json:"data"`
}

type LogAddInvalidAccessLogReq struct {
	param_base.BasicParam
	MerchantId    int64   `json:"merchant_id"`
	ApiId         int64   `json:"api_id"`
	RemoteAddr    string  `json:"remote_addr"`
	TimeStamp     int64   `json:"time_stamp"`
	Code          int     `json:"code"`
	Msg           string  `json:"msg"`
	RequestParams string  `json:"request_params"`
	Elapsed       float64 `json:"elapsed"`
}

type LogAddInvalidAccessLogResp struct {
	param_base.SimpleResp
}

// 访问接口统计详情
type LogQueryInterfaceCountReq struct {
	param_base.BasicParam
	ApiId          int64 `json:"api_id" description:"基础接口id" require:"false" in:"query"`
	MerchantId     int64 `json:"merchant_id" description:"商户id" require:"false" in:"query"`
	Status         int   `json:"status" require:"false" in:"query"`
	StartTimestamp int64 `json:"start_timestamp" description:"开始时间戳（单位秒）" require:"false" in:"query"`
	EndTimestamp   int64 `json:"end_timestamp" description:"结束时间戳（单位秒）" require:"false" in:"query"`
}

type LogQueryInterfaceCountResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryInterfaceCountReply `json:"data"`
}

type LogQueryUserAccessCountReq struct {
	param_base.BasicParam
	ApiId          int64 `json:"api_id" description:"基础接口id" require:"false" in:"query"`
	MerchantId     int64 `json:"merchant_id" description:"商户id" require:"false" in:"query"`
	StartTimestamp int64 `json:"start_timestamp" description:"开始时间戳（单位秒）" require:"false" in:"query"`
	EndTimestamp   int64 `json:"end_timestamp" description:"结束时间戳（单位秒）" require:"false" in:"query"`
	PageSize       int64 `json:"page_size" description:"页大小" require:"false" in:"query"`
	PageNumber     int64 `json:"page_number" description:"页号" require:"false" in:"query"`
}

type LogQueryUserAccessCountResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryUserAccessCountReply `json:"data"`
}

type LogQueryUserAccessCountExportReq struct {
	param_base.BasicParam
	Export gd_statistics.LogQueryUserAccessCountExportReq `json:"export" description:"导出基本输入" in:"body"`
}

type LogExportInfo struct {
	ExportName     string `json:"export_name"`
	ApiId          int64  `json:"api_id"`
	MerchantId     int64  `json:"merchant_id"`
	StartTimestamp int64  `json:"start_timestamp"`
	EndTimestamp   int64  `json:"end_timestamp"`
	IsParseParam   bool   `json:"is_parse_param"`
	EnglishHeader  bool   `json:"english_header"`
}

type LogQueryUserAccessLogExportReq struct {
	param_base.BasicParam
	Export LogExportInfo `json:"export" description:"导出基本输入" in:"body"`
}

type LogQueryUserAccessLogExportReply struct {
	param_base.SimpleResp
}

type ThirdpartLogExportInfo struct {
	ExportName     string `json:"export_name"`
	ProviderApiId  int64  `json:"provider_api_id"`
	ProviderId     int64  `json:"provider_id"`
	StartTimestamp int64  `json:"start_timestamp"`
	EndTimestamp   int64  `json:"end_timestamp"`
	IsParseParam   bool   `json:"is_parse_param"`
}
type LogQueryUserThirdpartLogExportReq struct {
	param_base.BasicParam
	Export ThirdpartLogExportInfo `json:"export" description:"导出基本输入" in:"body"`
}

type LogQueryUserThirdpartLogExportReply struct {
	param_base.SimpleResp
}

type LogQueryUserAccessCountExportResp struct {
	param_base.SimpleResp
}

type LogQueryProviderCountExportReq struct {
	param_base.BasicParam
	Export gd_statistics.LogQueryProviderCountExportReq `json:"export" description:"导出基本输入" in:"body"`
}

type LogQueryProviderCountExportResp struct {
	param_base.SimpleResp
}

type LogQueryThirdpartAccessCountReq struct {
	param_base.BasicParam
	ProviderApiId  int64 `json:"provider_api_id" require:"false" in:"query"`
	Time           int64 `json:"time" require:"false" in:"query"`
	StartTimestamp int64 `json:"start_timestamp" require:"false" in:"query"`
	EndTimestamp   int64 `json:"end_timestamp" require:"false" in:"query"`
}

type LogQueryThirdpartAccessCountResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryThirdpartAccessCountReply `json:"data"`
}

type LogQueryThirdpartInterfaceCountReq struct {
	param_base.BasicParam
	ProviderApiId  int64 `json:"provider_api_id"   require:"false" in:"query"`
	StartTimestamp int64 `json:"start_timestamp"  require:"false" in:"query"`
	EndTimestamp   int64 `json:"end_timestamp"   require:"false" in:"query"`
	PageSize       int64 `json:"page_size"  require:"false" in:"query"`
	PageNumber     int64 `json:"page_number"  require:"false" in:"query"`
}

type LogQueryThirdpartInterfaceCountResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogQueryThirdpartInterfaceCountReply `json:"data"`
}

type LogExportListReq struct {
	param_base.BasicParam
	PageNumber int64 `json:"page_number" required:"false" in:"query"`
	IsAll      bool  `json:"is_all" required:"false" in:"query"`
	ExportType int   `json:"export_type" required:"false" in:"query"`
}

type LogExportListResp struct {
	param_base.SimpleResp
	Data gd_statistics.LogExportListReply `json:"data"`
}

type LogExportDeleteReq struct {
	param_base.BasicParam
	Id int64 `json:"id" description:"导出id" in:"query"`
}

type LogExportDeleteResp struct {
	param_base.SimpleResp
}

type LogQueryInterfaceAnalyzeResp struct {
	param_base.SimpleResp
	Data []gd_statistics.LogQueryInterfaceAnalyzeError `json:"data"`
}

type ThirdPartyAnalyzeResp struct {
	param_base.SimpleResp
	Data []gd_statistics.LogQueryInterfaceThirdPartyCount `json:"data"`
}

type ThirdPartyInterfaceErrorAnalyzeReq struct {
	param_base.BasicParam
	ProviderApiId  int64 `json:"provider_api_id" description:"数据源接口id" require:"false" in:"query"`
	Status         int   `json:"status" in:"query"`
	StartTimestamp int64 `json:"start_timestamp" description:"开始时间戳（单位秒）" require:"false" in:"query"`
	EndTimestamp   int64 `json:"end_timestamp" description:"结束时间戳（单位秒）" require:"false" in:"query"`
}

type ThirdPartyInterfaceErrorAnalyzeResp struct {
	param_base.SimpleResp
	Data []gd_statistics.ThirdPartyInterfaceErrorAnalyze `json:"data"`
}
