package shop_getStoreDetail_request

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

type ShopGetStoreDetailRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *ShopGetStoreDetailParam
}

func (c *ShopGetStoreDetailRequest) GetUrlPath() string {
	return "/shop/getStoreDetail"
}

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

}

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

}

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

func (c *ShopGetStoreDetailRequest) GetParams() *ShopGetStoreDetailParam {
	return c.Param
}

type ShopGetStoreDetailParam struct {
	// 门店ID
	StoreId string `json:"store_id"`
	//StoreId int64 `json:"store_id"`
	// 是否需要poi审核信息，注：只要审核状态的审核不要传true，需要详细的提交信息时传true
	IsNeedPoiAuditInfo bool `json:"is_need_poi_audit_info"`
	// 是否需要关联的抖店信息，注：只要shopId不要传true，需要关联店铺名称等信息时传true
	IsNeedRelShopUser bool `json:"is_need_rel_shop_user"`
	// 是否需要负责人信息
	IsNeedChargeInfo bool `json:"is_need_charge_info"`
}
