s
This commit is contained in:
@@ -22,3 +22,28 @@ func (a *API) CreateStore(createStoreParam *CreateStoreParam) (err error) {
|
||||
_, err = a.AccessAPI("v2/chain_store", TestURL, 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 int `json:"service_code"`
|
||||
Status int `json:"status"` //1关店,2开店
|
||||
}
|
||||
|
||||
func (a *API) GetStore(storeID int) (getStoreResult *GetStoreResult, err error) {
|
||||
result, err := a.AccessAPI("v2/chain_store/query", TestURL, map[string]interface{}{
|
||||
"chain_store_code": []string{utils.Int2Str(storeID)},
|
||||
}, true)
|
||||
if err == nil {
|
||||
var results []*GetStoreResult
|
||||
utils.Map2StructByJson(result["data"], results, false)
|
||||
getStoreResult = results[0]
|
||||
}
|
||||
return getStoreResult, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user