Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
jd_data_process
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
92c6fe33
authored
Oct 10, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
modify config
parent
a88ec87f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
update_jd_attr.py
update_jd_attr.py
View file @
92c6fe33
...
...
@@ -11,11 +11,16 @@ from common import request_to_jd_vc
# TODO 通知基石平台告警 ??? 是不是按照原来的方式?? 用is_mapping 字段来进行标识???
config_dev
=
{
"mysql"
:
{
"host"
:
"192.168.1.238"
,
"port"
:
3306
,
"user"
:
"liexin_data_distribution"
,
"password"
:
"liexin_data_distribution#zsyM"
,
"database"
:
"liexin_data_distribution"
},
"redis"
:
{
}
}
config_prod
=
{
...
...
@@ -28,11 +33,11 @@ def update_jd_attr_by_class(conf: dict):
基于lie_shop_attr中的class_id来更新属性
缺少的属性直接添加,改变的属性则进行update
"""
host
=
conf
[
"host"
]
port
=
conf
[
"port"
]
user
=
conf
[
"user"
]
password
=
conf
[
"password"
]
database
=
conf
[
"database"
]
host
=
conf
[
"
mysql"
][
"
host"
]
port
=
conf
[
"
mysql"
][
"
port"
]
user
=
conf
[
"
mysql"
][
"
user"
]
password
=
conf
[
"
mysql"
][
"
password"
]
database
=
conf
[
"
mysql"
][
"
database"
]
db
=
pymysql
.
connect
(
host
=
host
,
port
=
port
,
user
=
user
,
password
=
password
,
database
=
database
)
select_sql
=
"select distinct class_id from lie_shop_attr"
cursor
=
db
.
cursor
()
...
...
@@ -208,7 +213,7 @@ def update_ext_attr_by_class_ids(conf: dict):
def
insert_ext_attr_to_redis
():
def
insert_ext_attr_to_redis
(
class_id
,
attr_id
):
"""
拓展属性存到 redis中
key : jd_ext_attr
...
...
@@ -218,6 +223,7 @@ def insert_ext_attr_to_redis():
if
__name__
==
'__main__'
:
option
=
{
"dev"
,
"prod"
}
if
len
(
sys
.
argv
)
>=
2
and
sys
.
argv
[
1
]
in
option
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment