-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #835 from alex-smile/esb_db_update
esb 优化 db 查询
- Loading branch information
Showing
21 changed files
with
451 additions
and
141 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS | ||
Community Edition) available. | ||
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. | ||
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at http://opensource.org/licenses/MIT | ||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations under the License. | ||
""" | ||
|
||
import os | ||
|
||
from common.constants import API_TYPE_Q | ||
from components.component import Component | ||
|
||
from .toolkit import configs | ||
|
||
|
||
class Echo(Component): | ||
sys_name = configs.SYSTEM_NAME | ||
api_type = API_TYPE_Q | ||
|
||
def handle(self): | ||
result = self.outgoing.http_client.request( | ||
self.request.wsgi_request.method, | ||
host=os.environ.get("ESB_ECHO_HOST"), | ||
path="/echo/", | ||
params=self.request.kwargs if self.request.wsgi_request.method == "GET" else None, | ||
data=self.request.kwargs if self.request.wsgi_request.method == "POST" else None, | ||
) | ||
self.response.payload = {"result": True, "data": result} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS | ||
Community Edition) available. | ||
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. | ||
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at http://opensource.org/licenses/MIT | ||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations under the License. | ||
""" | ||
|
||
import os | ||
|
||
from common.constants import API_TYPE_Q | ||
from components.component import Component | ||
|
||
from .toolkit import configs | ||
|
||
|
||
class Sleep(Component): | ||
sys_name = configs.SYSTEM_NAME | ||
api_type = API_TYPE_Q | ||
|
||
def handle(self): | ||
sleep = self.request.kwargs.get("sleep", 1000) | ||
result = self.outgoing.http_client.request( | ||
self.request.wsgi_request.method, | ||
host=os.environ.get("ESB_ECHO_HOST"), | ||
path="/sleep/%s/" % sleep, | ||
response_type="text", | ||
) | ||
self.response.payload = { | ||
"result": True, | ||
"data": {}, | ||
"message": result, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.