package fnpsapi import ( "git.rosy.net.cn/baseapi/utils" ) type CreateStoreParam struct { ChainStoreCode string `json:"chain_store_code,omitempty"` ChainStoreName string `json:"chain_store_name,omitempty"` ChainStoreType int `json:"chain_store_type,omitempty"` MerchantCode string `json:"merchant_code,omitempty"` ContactPhone string `json:"contact_phone,omitempty"` Address string `json:"address,omitempty"` PositionSource int `json:"position_source,omitempty"` Longitude string `json:"longitude,omitempty"` Latitude string `json:"latitude,omitempty"` ServiceCode string `json:"service_code,omitempty"` } func (a *API) CreateStore(createStoreParam *CreateStoreParam) (err error) { params := utils.Struct2FlatMap(createStoreParam) _, err = a.AccessAPI("v2/chain_store", URL, params, true) return err } type GetStoreResult struct { ChainStoreCode string `json:"chain_store_code"` ChainStoreName string `json:"chain_store_name"` Address string `json:"address"` Latitude string `json:"latitude"` Longitude string `json:"longitude"` PositionSource int `json:"position_source"` City string `json:"city"` ContactPhone string `json:"contact_phone"` ServiceCode string `json:"service_code"` Status int `json:"status"` //1关店,2开店 } func (a *API) GetStore(storeID string) (getStoreResult *GetStoreResult, err error) { result, err := a.AccessAPI("v2/chain_store/query", URL, map[string]interface{}{ "chain_store_code": []string{storeID}, }, true) if err == nil { utils.Map2StructByJson(result["data"].([]interface{})[0], &getStoreResult, false) } return getStoreResult, err }