taobao.product.add 上传一个产品，不包括产品非主图和属性图片
        
        获取类目ID，必需是叶子类目ID；调用taobao.itemcats.get.v2获取 传入关键属性,结构:pid:vid;pid:vid.调用taobao.itemprops.get.v2获取pid, 调用taobao.itempropvalues.get获取vid;如果碰到用户自定义属性,请用customer_props.
1513
def add(self, cid, price, image, name, desc, major, market_time, property_alias, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.product.add')
        request['cid'] = cid
        request['price'] = price
        request['image'] = image
        request['name'] = name
        request['desc'] = desc
        request['major'] = major
        request['market_time'] = market_time
        request['property_alias'] = property_alias
        for k, v in kwargs.iteritems():
            if k not in ('outer_id', 'props', 'binds', 'sale_props', 'customer_props', 'order_by', 'ww_status', 'post_free', 'location_state', 'location_city', 'is_3D', 'start_score', 'end_score', 'start_volume', 'end_volume', 'one_station', 'is_cod', 'is_mall', 'is_prepay', 'genuine_security', 'promoted_service', 'stuff_status', 'start_price', 'end_price', 'page_no', 'page_size', 'auction_flag', 'auto_post', 'has_discount', 'is_xinpin') and v==None: continue
            if k == 'location_state': k = 'location.state'
            if k == 'location_city': k = 'location.city'
            request[k] = v
        self.create(self.execute(request, session)['product'])
        return self
704371
def find(self, item_id, basic=False, **kwargs):
        
        if basic:
            return self.transport.GET(url='/item/%d/basic' % item_id)
        return self.transport.GET(kwargs, url='/item/%d' % item_id)
101210
def item_completed(self, results, item, info):
        '''
        
        '''
        # 处理 results 中的 path 使用缩略图路径替代
        for ok, result in results:
            if not ok:
                continue
            path = result['path']
            path = re.sub(r'full', os.path.join('thumbs', 'kindle'), path)
            result['path'] = path

        # 处理缩略图为灰度图，为便于在电纸书上节省空间
        if info.spider.options.get('img_convert_to_gray'):
            images_store = info.spider.settings.get('IMAGES_STORE')
            for ok, result in results:
                if not ok:
                    continue

                img_path = os.path.join(images_store, result['path'])
                with open(img_path, 'rb+') as fh:
                    output = img.gray_image(fh.read())
                    fh.seek(0)
                    fh.truncate()
                    fh.write(output)

        info.spider._logger.debug(results)
        item = super(MoEarImagesPipeline, self).item_completed(
            results, item, info)
        return item
248493
function props(data, list, val) {

    // 处理子对象
    if (list.length) {
        let name = list.shift();

        // 处理属性
        if (name) {
            name = unescape(name);

            if (!data) {
                data = num.test(name) ? [] : {};
            }

            data[name] = props(data[name], list, val);
        } else {
            data = [...(data || []), props(null, list, val)];
        }

        // 返回子对象
        return data;
    }

    // 返回值
    return val;
}
717818
def recommend_add(self, num_iid, session):
        ''''''
        request = TOPRequest('taobao.item.recommend.add')
        request['num_iid'] = num_iid
        self.create(self.execute(request, session)['item'])
        return self
78373
def update(self, pid, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.fenxiao.product.update')
        request['pid'] = pid
        for k, v in kwargs.iteritems():
            if k not in ('name', 'standard_price', 'cost_price', 'retail_price_low', 'retail_price_high', 'outer_id', 'quantity', 'alarm_number','desc','prov','city','postage_type','postage_id','postage_ordinary','postage_fast','postage_ems','status','sku_ids','sku_cost_prices','sku_quantitys','sku_outer_ids','have_invoice','have_guarantee','discount_id','sku_standard_prices','sku_properties','sku_properties_del','is_authz','pic_path','image','properties','property_alias','input_properties','dealer_cost_price','sku_dealer_cost_prices','category_id') and v==None: continue
            request[k] = v
        self.create(self.execute(request, session), fields=['pid','modified'], models={'modified':TOPDate})
        return self
416156
def get_item(self, item_id):
        
        if self.object_id:
            # reference the current drive_id
            url = self.build_url(
                self._endpoints.get('get_item').format(id=self.object_id,
                                                       item_id=item_id))
        else:
            # we don't know the drive_id so go to the default drive
            url = self.build_url(
                self._endpoints.get('get_item_default').format(item_id=item_id))

        response = self.con.get(url)
        if not response:
            return None

        data = response.json()

        # Everything received from cloud must be passed as self._cloud_data_key
        return self._classifier(data)(parent=self,
                                      **{self._cloud_data_key: data})
1261656
def customers_get(self, session, page_no=1, page_size=10, nicks=None):
        ''''''
        request = TOPRequest('taobao.increment.customers.get')
        request['page_no'] = page_no
        request['page_size'] = page_size
        if nicks!=None: request['nicks'] = nicks
        self.create(self.execute(request, session), fields=['app_customers', 'total_results'], models={'app_customers':AppCustomer})
        return self.app_customers
62023
def get(self, session, fields=None):
        ''''''
        request = TOPRequest('taobao.fenxiao.productcats.get')
        if fields: request['fields'] = fields
        self.create(self.execute(request, session))
        return self.productcats
509306
def get_products(self, product_ids):
        
        if self.product_set_id is None:
            raise ValueError('product_set_id must be specified')
        data = {'ids': product_ids}
        return self.client.get(self.base_url + '/products', json=data)
1094900
def get(self, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.fenxiao.cooperation.get')
        for k, v in kwargs.iteritems():
            if k not in ('status', 'start_date', 'end_date', 'trade_type', 'page_no', 'page_size') and v==None: continue
            request[k] = v
        self.create(self.execute(request, session), fields=['total_results','cooperations'], models={'cooperations':Cooperation})
        return self.cooperations
562548
def add(self, item_numid, collect_type, shared, session):
        ''''''
        request = TOPRequest('taobao.favorite.add')
        request['item_numid'] = item_numid
        request['collect_type'] = collect_type
        request['shared'] = shared
        self.create(self.execute(request, session))
        return self.result
573399
def add(self, num_iid, properties, quantity, price, session, outer_id=None, item_price=None, lang=None):
        ''''''
        request = TOPRequest('taobao.item.sku.add')
        request['num_iid'] = num_iid
        request['properties'] = properties
        request['quantity'] = quantity
        request['price'] = price
        if outer_id!=None:
            request['outer_id'] = outer_id
        if item_price!=None:
            request['item_price'] = item_price
        if lang!=None:
            request['lang'] = lang
        self.create(self.execute(request, session)['sku'])
        return self
475079
def _get_id2parents(id2parents, item_id, item_obj):
    """"""
    if item_id in id2parents:
        return id2parents[item_id]
    parent_ids = set()
    for parent_obj in item_obj.parents:
        parent_id = parent_obj.item_id
        parent_ids.add(parent_id)
        parent_ids |= _get_id2parents(id2parents, parent_id, parent_obj)
    id2parents[item_id] = parent_ids
    return parent_ids
484352
@NoAuth
    @RequestMapping(value = "/item", method = RequestMethod.GET)
    @ResponseBody
    public ValueVo getItem(ConfForm confForm) {

        LOG.info(confForm.toString());

        //
        // 校验
        //
        ConfigFullModel configModel = null;
        try {
            configModel = configValidator4Fetch.verifyConfForm(confForm, false);
        } catch (Exception e) {
            LOG.warn(e.toString());
            return ConfigUtils.getErrorVo(e.getMessage());
        }

        return configFetchMgr.getConfItemByParameter(configModel.getApp().getId(), configModel.getEnv().getId(),
                configModel.getVersion(), configModel.getKey());
    }
1291168
def items_get(self, **kwargs):
        ''''''
        request = TOPRequest('taobao.increment.items.get')
        for k, v in kwargs.iteritems():
            if k not in ('status', 'nick', 'start_modified', 'end_modified', 'page_no', 'page_size') and v==None: continue
            request[k] = v
        self.create(self.execute(request), fields=['notify_items', 'total_results'], models={'notify_items':NotifyItem})
        return self.notify_items
431035
def listurl_get(self, q, **kwargs):
        ''''''
        request = TOPRequest('taobao.taobaoke.listurl.get')
        request['q'] = q
        for k, v in kwargs.iteritems():
            if k not in ('nick', 'outer_code', 'pid') and v==None: continue
            request[k] = v
        self.create(self.execute(request), fields=['taobaoke_item'], models={'taobaoke_item':TaobaokeItem})
        return self.taobaoke_item