package instantShopping_reportRiderLocation_request

import (
	"encoding/json"
	"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/instantShopping_reportRiderLocation/response"
	"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
)

type InstantShoppingReportRiderLocationRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *InstantShoppingReportRiderLocationParam
}

func (c *InstantShoppingReportRiderLocationRequest) GetUrlPath() string {
	return "/instantShopping/reportRiderLocation"
}

func New() *InstantShoppingReportRiderLocationRequest {
	request := &InstantShoppingReportRiderLocationRequest{
		Param: &InstantShoppingReportRiderLocationParam{},
	}
	request.SetConfig(doudian_sdk.GlobalConfig)
	request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
	return request

}

func (c *InstantShoppingReportRiderLocationRequest) Execute(accessToken *doudian_sdk.AccessToken) (*instantShopping_reportRiderLocation_response.InstantShoppingReportRiderLocationResponse, error) {
	responseJson, err := c.GetClient().Request(c, accessToken)
	if err != nil {
		return nil, err
	}
	response := &instantShopping_reportRiderLocation_response.InstantShoppingReportRiderLocationResponse{}
	_ = json.Unmarshal([]byte(responseJson), response)
	return response, nil

}

func (c *InstantShoppingReportRiderLocationRequest) GetParamObject() interface{} {
	return c.Param
}

func (c *InstantShoppingReportRiderLocationRequest) GetParams() *InstantShoppingReportRiderLocationParam {
	return c.Param
}

type InstantShoppingReportRiderLocationParam struct {
	// 抖音电商shop order单id
	ShopOrderId string `json:"shop_order_id"`
	// 三方运力服务商
	DistributionCode string `json:"distribution_code"`
	// 三方运单号
	DistributionDeliveryId string `json:"distribution_delivery_id"`
	// 骑手姓名；
	RiderName string `json:"rider_name"`
	// 骑手手机号类型，0是真实号，1是隐私号
	RiderPhoneType int32 `json:"rider_phone_type"`
	// 骑手电话；
	RiderPhone string `json:"rider_phone"`
	// 骑手经度，高德坐标系
	RiderLongitude string `json:"rider_longitude"`
	// 骑手维度，高德坐标系
	RiderLatitude string `json:"rider_latitude"`
	// 骑手上报时间戳
	ReportTime int64 `json:"report_time"`
}
