package shop_getStoreList_request

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

type ShopGetStoreListRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *ShopGetStoreListParam
}

func (c *ShopGetStoreListRequest) GetUrlPath() string {
	return "/shop/getStoreList"
}

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

}

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

}

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

func (c *ShopGetStoreListRequest) GetParams() *ShopGetStoreListParam {
	return c.Param
}

type ShopGetStoreListParam struct {
	//// 门店名称集合，不支持模糊
	//StoreNameList []string `json:"store_name_list"`
	//// 门店id集合，用于查询门店信息
	//StoreIdList []int64 `json:"store_id_list"`
	//// 门店编码，开发者自定义
	//StoreCodeList []string `json:"store_code_list"`
	//// 绑定状态，1绑定中;2绑定成功;3:资质验证中;4账户认证中;5正常营业(c端可下单)
	//State int64 `json:"state"`
	//// poi审核状态：0无提审;1审核中;2审核成功;3驳回
	//PoiAuditState []int64 `json:"poi_audit_state"`
	//// 省
	//Province string `json:"province"`
	//// 市
	//City string `json:"city"`
	//// 区
	//District string `json:"district"`
	//// 门店poiId集合
	//PoiIdList []int64 `json:"poi_id_list"`
	//// 门店名称，支持模糊查询
	//NameFuzzy string `json:"name_fuzzy"`
	//// 门店编码，支持模糊查询
	//StoreCodeFuzzy string `json:"store_code_fuzzy"`
	//// 资质审核状态，0未提交；1审核中；2审核通过；3驳回
	//QualState int64 `json:"qual_state"`
	//// 账户验证状态，0未提交；1验证中；2通过；3失败
	//RemitState int64 `json:"remit_state"`
	//// 开户状态：0未开户;1已开户
	//OpenAccountState int64 `json:"open_account_state"`
	//// 是否需要poi审核信息，注：只要审核状态的审核不要传true，需要详细的提交信息时传true
	//IsNeedPoiAuditInfo bool `json:"is_need_poi_audit_info"`
	//// 是否需要关联的抖店信息，注：只要shopId不要传true，需要关联店铺名称等信息时传true
	//IsNeedRelShopUser bool `json:"is_need_rel_shop_user"`
	// 第几页(从0开始)
	Page string `json:"page"`
	// 每页条数
	PageSize string `json:"page_size"`
}
