File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 26
26
27
27
@task
28
28
def send_post_request_HOMEPLUS_task (category_id ):
29
- return send_post_request (category_id )
29
+ return send_post_request ('HP' , category_id )
30
30
31
31
# TaskFlow API로 task 정의
32
32
@task
Original file line number Diff line number Diff line change 26
26
27
27
@task
28
28
def send_post_request_OASIS_task ():
29
- return send_post_request ()
29
+ return send_post_request ('OA' )
30
30
31
31
# TaskFlow API로 task 정의
32
32
@task
Original file line number Diff line number Diff line change @@ -29,9 +29,13 @@ def collect_task_results(**context):
29
29
context ['ti' ].xcom_push (key = 'email_body' , value = email_body )
30
30
31
31
# HTTP POST 요청 함수
32
- def send_post_request (categoryId ):
32
+ def send_post_request (platform , categoryId ):
33
33
load_dotenv ()
34
- url = os .getenv ("HOMEPLUS_SERVICE_URL" )
34
+ url = ""
35
+ if platform == 'HP' :
36
+ url = os .getenv ("HOMEPLUS_SERVICE_URL" )
37
+ elif platform == 'OA' :
38
+ url = os .getenv ("OASIS_SERVICE_URL" )
35
39
headers = {"Content-Type" : "application/json" }
36
40
data = json .dumps ({"category_id" : categoryId })
37
41
response = requests .post (url , headers = headers , data = data )
You can’t perform that action at this time.
0 commit comments