package superm_applyPlatformPickUp_request

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

type SupermApplyPlatformPickUpRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *SupermApplyPlatformPickUpParam
}

func (c *SupermApplyPlatformPickUpRequest) GetUrlPath() string {
	return "/superm/applyPlatformPickUp"
}

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

}

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

}

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

func (c *SupermApplyPlatformPickUpRequest) GetParams() *SupermApplyPlatformPickUpParam {
	return c.Param
}

type SupermApplyPlatformPickUpParam struct {
	AfterSaleID int64 `json:"afterSaleID"` //售后单ID
	//SelectedCalendarPeriod *CalendarPeriod `json:"selectedCalendarPeriod"` //选择的时间段
}
type CalendarPeriod struct {
	TimeBeginTs int64 `json:"timeBeginTs"`
	TimeEndTs   int64 `json:"timeEndTs"`
}
