# -*- coding: utf-8 -*- # !/usr/bin/env python from library.jdopen.client.api.base import BaseJdOpenAPI class JdOpenShop(BaseJdOpenAPI): def create_shop( self, customerNum, shopName, address, oneIndustry, twoIndustry, mobilePhone, mapLng=None, mapLat=None, microBizType=None ): """ 创建店铺 """ url = "/v1/agent/declare/shopinfo/create" data = { "agentNum": self.agentNum, "customerNum": customerNum, "shopName": shopName, "address": address, "oneIndustry": oneIndustry, "twoIndustry": twoIndustry, "mobilePhone": mobilePhone, "mapLng": mapLng, "mapLat": mapLat, "microBizType": microBizType } sendData = {_k: _v for _k, _v in data.items() if _v is not None} return self._post(url=url, data=sendData) def modify_shop( self, shopNum, customerNum, shopName, address, oneIndustry, twoIndustry, mobilePhone, mapLng = None, mapLat = None, microBizType = None ): """ 修改店铺 """ url = "/v1/agent/declare/shopinfo/modify" data = { "shopNum": shopNum, "agentNum": self.agentNum, "customerNum": customerNum, "shopName": shopName, "address": address, "oneIndustry": oneIndustry, "twoIndustry": twoIndustry, "mobilePhone": mobilePhone, "mapLng": mapLng, "mapLat": mapLat, "microBizType": microBizType } sendData = {_k: _v for _k, _v in data.items() if _v is not None} return self._post(url=url, data=sendData) def get_shop(self, customerNum): """ 获取店铺信息 """ return self._get(url="/v1/agent/declare/shop/list/{}".format(customerNum))