File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "db_info" : {
3+ "host" : " 127.0.0.1" ,
4+ "user" : " root" ,
5+ "password" : " root" ,
6+ "stall-dbName" : " promotion" ,
7+ "promotion-dbName" : " promotion"
8+ },
9+ "@client_code" : " 1b1dfcc3-26a5-11ed-a331-3c7c3f602b59" ,
10+ "@tenant_code" : " 1e83ff35-26a5-11ed-a331-3c7c3f602b59" ,
11+ "@business_datasource_code" : " dcp_grid" ,
12+ "@stall_datasource_code" : " stall-assistant" ,
13+ "stall" : {
14+ "target-table-list" : [
15+ {
16+ "table-name" : " t_api_m" ,
17+ "api-code-list" : [
18+ " getUptownDataByCode" ,
19+ " getWebsiteDataByCode"
20+ ],
21+ "where_filter" : " client_code=@client_code and tenant_code=@tenant_code and datasource_code=@stall_datasource_code and code in(@api-code-list)" ,
22+ "column_code" : [
23+ " client_code" ,
24+ " tenant_code" ,
25+ " datasource_code" ,
26+ " code" ,
27+ " name" ,
28+ " sql" ,
29+ " create_by" ,
30+ " create_date" ,
31+ " modify_by" ,
32+ " modify_date"
33+ ]
34+ }
35+ ]
36+ },
37+ "promotion" : {
38+ }
39+ }
Original file line number Diff line number Diff line change 1+ import json
2+
3+
4+ class ReadConfig :
5+
6+ def readDBJsonConfig (self ):
7+ with open ("promotion-connect-config.json" , 'r' ) as json_file :
8+ config = json .load (json_file )
9+ print (config )
10+ server = config ['db_info' ]['host' ]
11+ print (server )
12+
13+
14+ if '__main__' == __name__ :
15+ config = ReadConfig ();
16+ config .readDBJsonConfig ()
You can’t perform that action at this time.
0 commit comments