同步系统化参数,同步每日数据

This commit is contained in:
gqh
2022-09-29 17:35:20 +08:00
parent d9e6f45bc4
commit 28d76109e7
9 changed files with 551 additions and 157 deletions

View File

@@ -0,0 +1 @@
from. import common

28
sf_base/commons/common.py Normal file
View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api
import time
import hashlib
class Common(models.Model):
_name = 'sf.sync.common'
_description = u'公用类'
def get_headers(self,token,mrs_secret_key):
'''
获取requests中的heardes参数
'''
timestamp = int(time.time())
check_str = '%s%s%s' % (token, timestamp, mrs_secret_key)
check_mrs_str = hashlib.sha1(check_str.encode('utf-8')).hexdigest()
headers = {'TOKEN': token,
'TIMESTAMP': str(timestamp),
'checkstr': check_mrs_str}
return headers