Subversion Repositories SmartDukaan

Rev

Rev 8168 | Rev 8362 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8168 Rev 8182
Line 6... Line 6...
6
from shop2020.config.client.ConfigClient import ConfigClient
6
from shop2020.config.client.ConfigClient import ConfigClient
7
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_category, \
7
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_category, \
8
    to_t_source_item_pricing, to_t_product_notification_request, \
8
    to_t_source_item_pricing, to_t_product_notification_request, \
9
    to_t_product_notification_request_count, to_t_voucher_item_mapping, to_t_insurer, \
9
    to_t_product_notification_request_count, to_t_voucher_item_mapping, to_t_insurer, \
10
    to_t_banner, to_t_banner_map, to_t_product_notification_request_count, \
10
    to_t_banner, to_t_banner_map, to_t_product_notification_request_count, \
11
    to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted
11
    to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted, to_t_ebay_item
12
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
12
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
13
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
13
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
14
    update_item, start_item_on, close_session, retire_item_on, \
14
    update_item, start_item_on, close_session, retire_item_on, \
15
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
15
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
16
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
16
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
Line 40... Line 40...
40
    add_or_update_freebie_for_item, get_all_amazon_listed_items, get_store_pricing, \
40
    add_or_update_freebie_for_item, get_all_amazon_listed_items, get_store_pricing, \
41
    update_store_pricing, get_amazon_item_details, update_amazon_item_details, \
41
    update_store_pricing, get_amazon_item_details, update_amazon_item_details, \
42
    add_amazon_item, get_asin_items, get_all_fba_listed_items, \
42
    add_amazon_item, get_asin_items, get_all_fba_listed_items, \
43
    get_all_nonfba_listed_items, add_or_update_brand_info, get_brand_info, \
43
    get_all_nonfba_listed_items, add_or_update_brand_info, get_brand_info, \
44
    get_items_status, update_item_inventory, update_timestamp_for_amazon_feeds, \
44
    get_items_status, update_item_inventory, update_timestamp_for_amazon_feeds, \
45
    get_all_parent_categories,add_page_view_event,add_cart_event ,update_amazon_attributes_in_bulk
45
    get_all_parent_categories,add_page_view_event,add_cart_event, \
-
 
46
    insert_ebay_item, get_ebay_item, update_ebay_item, update_amazon_attributes_in_bulk
-
 
47
 
46
from shop2020.thriftpy.model.v1.catalog.ttypes import status
48
from shop2020.thriftpy.model.v1.catalog.ttypes import status
47
from shop2020.utils.Utils import log_entry, to_py_date
49
from shop2020.utils.Utils import log_entry, to_py_date
48
import datetime
50
import datetime
49
 
51
 
50
class CatalogServiceHandler:
52
class CatalogServiceHandler:
Line 1166... Line 1168...
1166
    def addCartEvent(self,cartEvent):
1168
    def addCartEvent(self,cartEvent):
1167
        try:
1169
        try:
1168
            add_cart_event(cartEvent)
1170
            add_cart_event(cartEvent)
1169
        finally:
1171
        finally:
1170
            close_session()
1172
            close_session()
-
 
1173
 
-
 
1174
    def addEbayItem(self, ebayItem):
-
 
1175
        try:
-
 
1176
            insert_ebay_item(ebayItem)
-
 
1177
        finally:
-
 
1178
            close_session()
-
 
1179
        
-
 
1180
    def getEbayItem(self, listingId):
-
 
1181
        try:
-
 
1182
            return to_t_ebay_item(get_ebay_item(listingId))
-
 
1183
        finally:
-
 
1184
            close_session()
1171
            
1185
            
-
 
1186
    def updateEbayItem(self, ebayItem):
-
 
1187
        try:
-
 
1188
            update_ebay_item(ebayItem)
-
 
1189
        finally:
-
 
1190
            close_session()
-
 
1191
                
1172
    def updateAmazonAttributesInBulk(self,amazonlisted):
1192
    def updateAmazonAttributesInBulk(self,amazonlisted):
1173
        try:
1193
        try:
1174
            return update_amazon_attributes_in_bulk(amazonlisted)
1194
            return update_amazon_attributes_in_bulk(amazonlisted)
1175
        finally:
1195
        finally:
1176
            close_session()
1196
            close_session()