|  | @@ -5,25 +5,9 @@ logging.config.dictConfig(LOG_CONF)
 | 
	
		
			
				|  |  |  import time
 | 
	
		
			
				|  |  |  import requests
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -# from sync_amz_data.public.amz_ad_client import shop_infos
 | 
	
		
			
				|  |  | +from sync_amz_data.public.amz_ad_client import shop_infos
 | 
	
		
			
				|  |  |  from sync_amz_data.DataTransform.Data_ETL import Common_ETLMethod,SP_ETL,SB_ETL,SD_ETL
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -def shop_infos(profile_id):
 | 
	
		
			
				|  |  | -    resp_rel = requests.get("http://192.168.1.225/api/ad_manage/profiles/",headers={"X-Token": "da4ab6bc5cbf1dfa"})
 | 
	
		
			
				|  |  | -    data = resp_rel.json().get("data")
 | 
	
		
			
				|  |  | -    profile_info = {}
 | 
	
		
			
				|  |  | -    for info in data:
 | 
	
		
			
				|  |  | -        if info.get("profile_id") in [int(profile_id),str(profile_id)]:
 | 
	
		
			
				|  |  | -            profile_info["profile_id"] = profile_id
 | 
	
		
			
				|  |  | -            profile_info["refresh_token"] = info.get("refresh_token")
 | 
	
		
			
				|  |  | -            profile_info["account_name"] = info.get("account_name")
 | 
	
		
			
				|  |  | -            profile_info["advertiser_id"] = info.get("advertiser_id")
 | 
	
		
			
				|  |  | -            profile_info["country_code"] = info.get("country_code")
 | 
	
		
			
				|  |  | -            profile_info["marketplace_str_id"] =info.get("marketplace_str_id")
 | 
	
		
			
				|  |  | -            profile_info["time_zone"] = info.get("time_zone")
 | 
	
		
			
				|  |  | -            return profile_info
 | 
	
		
			
				|  |  | -    return resp_rel.text
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  def amz_report(conn,AWS_CREDENTIALS,para=None):
 | 
	
		
			
				|  |  |      refresh_token = shop_infos(AWS_CREDENTIALS['profile_id'])['refresh_token']
 | 
	
		
			
				|  |  |      AWS_CREDENTIALS['refresh_token'] = refresh_token
 | 
	
	
		
			
				|  | @@ -88,7 +72,6 @@ def amz_report(conn,AWS_CREDENTIALS,para=None):
 | 
	
		
			
				|  |  |      # sd_report.reportV2_targets_matchedTarget_t2_ETL(conn,params=para)
 | 
	
		
			
				|  |  |      # sd_report.reportV2_targets_matchedTarget_t3_ETL(conn,params=para)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  if __name__ == '__main__':
 | 
	
		
			
				|  |  |      # AccountTask("3006125408623189").do({"record": "portfolios"})
 | 
	
		
			
				|  |  |      AWS_CREDENTIALS = {
 |