Skip to content

Instantly share code, notes, and snippets.

@y56
Created May 3, 2021 09:01
Show Gist options
  • Save y56/728a9a3cf1a060ca16947ecc35360518 to your computer and use it in GitHub Desktop.
Save y56/728a9a3cf1a060ca16947ecc35360518 to your computer and use it in GitHub Desktop.
to test defaultValue: Sequelize.NOW
token='goodToken'
curl -D - -X POST http://localhost:3030/orders \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en-US,zh-TW;q=0.5' --compressed \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer '"$token"'' \
-H 'Origin: https://10.10.10.10:8080' \
-H 'Connection: keep-alive' \
--data '{
"campaign_id":"fake行銷活動ID_1",
"campaign_name": "fake行銷活動名稱",
"start_timestamp": "2021-02-01",
"end_timestamp": "2021-04-30",
"is_by_aics": "false",
"campaign_start": "2021-02-01",
"campaign_end": "2021-05-04",
"ads": [
{
"id": "fake廣告素材ID_1",
"name": "fake廣告素材名稱",
"placement_id": "fake版位ID_1",
"placement_name": "fake版位名稱",
"type": "image",
"ad_url": "https://www.ptt.cc/bbs/Gossiping/M.1612841882.A.9B8.html",
"material_url": "https://i.imgur.com/HWPARu1.jpg",
"category": "fake大分類",
"subcategory": "fake小分類",
"source": "fake廣告來源"
}
]
}
'
curl -D - -X POST http://localhost:3030/orders \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en-US,zh-TW;q=0.5' --compressed \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer '"$token"'' \
-H 'Origin: https://10.10.10.10:8080' \
-H 'Connection: keep-alive' \
--data '{
"campaign_id":"fake行銷活動ID_1",
"campaign_name": "fake行銷活動名稱",
"start_timestamp": "2021-02-01",
"end_timestamp": "2021-04-30",
"is_by_aics": "false",
"campaign_start": "2021-02-01",
"campaign_end": "2021-05-04",
"ads": [
{
"id": "fake廣告素材ID_2",
"name": "fake廣告素材名稱",
"placement_id": "fake版位ID_1",
"placement_name": "fake版位名稱",
"type": "image",
"ad_url": "https://www.ptt.cc/bbs/Gossiping/M.1612841882.A.9B8.html",
"material_url": "https://i.imgur.com/HWPARu1.jpg",
"category": "fake大分類",
"subcategory": "fake小分類",
"source": "fake廣告來源"
}
]
}
'
curl -D - -X POST http://localhost:3030/orders \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en-US,zh-TW;q=0.5' --compressed \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer '"$token"'' \
-H 'Origin: https://10.10.10.10:8080' \
-H 'Connection: keep-alive' \
--data '{
"campaign_id":"fake行銷活動ID_1",
"campaign_name": "fake行銷活動名稱",
"start_timestamp": "2021-02-01",
"end_timestamp": "2021-04-30",
"is_by_aics": "false",
"campaign_start": "2021-02-01",
"campaign_end": "2021-05-04",
"ads": [
{
"id": "fake廣告素材ID_3",
"name": "fake廣告素材名稱",
"placement_id": "fake版位ID_1",
"placement_name": "fake版位名稱",
"type": "image",
"ad_url": "https://www.ptt.cc/bbs/Gossiping/M.1612841882.A.9B8.html",
"material_url": "https://i.imgur.com/HWPARu1.jpg",
"category": "fake大分類",
"subcategory": "fake小分類",
"source": "fake廣告來源"
}
]
}
'
kgdashboard=> select * from ad_placement;select * from ad; select * from campaign;select * from campaign_placement;select * from placement;
id | ad_id | placement_id
--------------------------------------+------------------+--------------
5ca8b4bc-5f4a-4f46-b0e4-c1b7d28b8bbf | fake廣告素材ID_1 | fake版位ID_1
7ceeb666-0300-4569-8611-b6b6fc4e67df | fake廣告素材ID_2 | fake版位ID_1
e20862d1-b320-427e-90a1-4211632015e0 | fake廣告素材ID_3 | fake版位ID_1
(3 rows)
id | name | campaign_id | type | ad_url | material_url | category | subcategory | source | is_by_aics | create_timestamp | update_timestamp
------------------+------------------+------------------+-------+----------------------------------------------------------+---------------------------------+------------+-------------+--------------+------------+----------------------------+------------------
fake廣告素材ID_1 | fake廣告素材名稱 | fake行銷活動ID_1 | image | https://www.ptt.cc/bbs/Gossiping/M.1612841882.A.9B8.html | https://i.imgur.com/HWPARu1.jpg | fake大分類 | fake小分類 | fake廣告來源 | f | 2021-05-03 08:53:41.081+00 |
fake廣告素材ID_2 | fake廣告素材名稱 | fake行銷活動ID_1 | image | https://www.ptt.cc/bbs/Gossiping/M.1612841882.A.9B8.html | https://i.imgur.com/HWPARu1.jpg | fake大分類 | fake小分類 | fake廣告來源 | f | 2021-05-03 08:54:51.463+00 |
fake廣告素材ID_3 | fake廣告素材名稱 | fake行銷活動ID_1 | image | https://www.ptt.cc/bbs/Gossiping/M.1612841882.A.9B8.html | https://i.imgur.com/HWPARu1.jpg | fake大分類 | fake小分類 | fake廣告來源 | f | 2021-05-03 08:55:18.479+00 |
(3 rows)
id | name | start_timestamp | end_timestamp | is_by_aics | create_timestamp | update_timestamp
------------------+------------------+------------------------+------------------------+------------+----------------------------+------------------
fake行銷活動ID_1 | fake行銷活動名稱 | 2021-02-01 00:00:00+00 | 2021-04-30 00:00:00+00 | f | 2021-05-03 08:53:38.935+00 |
(1 row)
id | campaign_id | placement_id
--------------------------------------+------------------+--------------
c16fc548-f3e6-40f3-8877-9203cc4666fa | fake行銷活動ID_1 | fake版位ID_1
(1 row)
^
id | name | is_by_aics | create_timestamp | update_timestamp
--------------+--------------+------------+----------------------------+------------------
fake版位ID_1 | fake版位名稱 | f | 2021-05-03 08:53:41.209+00 |
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment