Kneshi Chen
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # URI-D-01 Offer to sell 列表頁 / 搜尋API ###### tags: `CP頁` `API` > [name=Tony Fan, Kenshi Chen] ## 內容 ### 相關頁面 * Offer to sell 列表頁/ 搜尋結果頁 * 網址 : https://hackmd.io/s6C1TmmnTDCUXSgoM61q7Q * Offer to sell 首頁 * 網址 : https://hackmd.io/emFxf9h0TSi4dPDKDFAIAA ### 程式 - com/hyweb/tt/cms/front/service/searchpagedata/TradePostSearchListPageData.java - com/hyweb/tt/cms/cm/idol/tradepost/* ### Input JSON Path #### 規格 - path : `${TT-API網址}/trade-posts/search/{did}` - method : POST - query : 無 - body : ``` { "keyword": <keyword>, "options" : <options>, // 0|1|2 "subWord": <subWord>, "groups": [ { "groupKey": <groupKey>, "groupValue": <groupValue> }, { "groupKey": <groupKey>, "groupValue": <groupValue> }, ... ], "postCategory" : <postCategory>, "postContinent" : <postContinent>, "postCountry" : <postCountry>, "postStartDate": <postStartDate>, "postEndDate": <postEndDate>, "rangeSize": <rangeSize>, // 10|20|30 "currpage": <currpage>, "sort": <sort>, // asc|desc "searchAesUrl": <searchAesUrl>, //Y|N "groupAesUrl": <groupAesUrl>, //Y|N "showIdolUrl": <showIdolUrl> } ``` #### 輸入參數說明 以下說明輸入的body (json format)的各個attribute。 輸入欄位 | 欄位名稱 | 欄位說明 | 型態 | 說明 | 是否可為空值| | -------- | -------- | -------- | -------- |-------- | | keyword | 關鍵字 | String | | 是| | options | 搜尋類型 | int | | 是| | subWord | 再搜尋關鍵字 | String | | 是| | groups | 後分類 | [`後分類條件欄位(Array Object)`](#後分類條件欄位(groups)) | | 是| | postCategory | 商機產業別 | int | | 是| | postContinent | 發送者公司註冊洲別 | int | | 是| | postCountry | 發送者公司註冊國家 | int | | 是| | postStartDate | 商機張貼開始日期 | int(日期) | valid date start | 是| | postEndDate | 商機張貼結束日期 | int(日期) | valid date end | 是| | rangeSize | 每頁最大顯示個數 | int | | 是| | currpage | 查詢頁數 | int | | 是| | sort | 排序方式 | String | Post Date(DB對應:audit_date) desc 或 asc | 是| | searchAesUrl | 是否回傳searchAesUrl:{Y/N} | String | | 是| | groupAesUrl | 是否回傳groupAesUrl:{Y/N} | String | | 是| | showIdolUrl | 顯示回傳idolUrl | String | 除錯使用:輸入一組key,符合則顯示解碼後的searchAesUrl和groupAesUrl,預設不顯示 | 是| * options : 預設為0 * 0: Match all words <br/> * 1: With the exact phrase <br/> * 2: Match any word * ![](https://i.imgur.com/C6tWVEJ.png) * rangeSize:{10/20/30} * 預設:10 * searchAesUrl:{Y/N} * groupAesUrl:{Y/N} * sort:預設desc * desc : 依照張貼時間新到舊排序 <br/> * asc : 依照張貼時間舊到新排序 ##### 後分類條件欄位(groups) | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- | -------- | | groupKey | 後分類類別 | String | | | groupValue | 後分類值 | String | | * groupKey : 不同分類對應不同的key名稱 * Categories : post-category = CATALOG_ID_AUTNMPS <br/> * ~~Continent : post-continent = NATION_ID_AUTNMPS~~ <br/> * Country : post-country = BUSINESS_NATION_CODE_AUTNMPS <br/> * ~~Post Date : post-day = POST_DATE~~ * groupValue : 對應不同分類,值範圍如下: * Categories : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-category 查詢出來的清單代碼 <br/> * ~~Continent : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-continent 查詢出來的清單代碼~~ <br/> * Country : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-country 查詢出來的清單代碼 <br/> * ~~Post Date : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-day 查詢出來的清單代碼~~ ### 範例 #### 舊網查詢方式 https://trading-post.taiwantrade.com/tradepost/search?word=company&type=post&sord=desc&group2=BUSINESS_NATION_CODE_AUTNMPS&groupVal2=583&post_sell=sell&post_offerType=1720&post_continent=430&seo_categoryNames=Viet+Nam #### (新)API查詢範例 ```=json https://tt-api.taiwantrade.com/trade-posts/search/701 ``` * 參考 [URI-D-01 測試案例](https://docs.google.com/spreadsheets/d/16ArA8CY3O2JAkmONj0NNoD37xQK3IYodvwEWipyqtno/edit#gid=1093005017) ### Output JSON Path #### 規格 ```=json { "code" : <code>, "errorMsg" : <errorMsg>, "data": { "totalpages": <totalpages>, "currpage": <currpage>, "totalrecords": <totalrecords>, "startRow": <startRow>, "endRow": <endRow>, "rangeSize": <rangeSize>, "rows": [ { "aid": <aid>, "seq": <seq>, "subject": <subject>, "url": <url>, "offerTypeId": <offerTypeId>, "offerType": <offerType>, "companyId": <companyId>, "catalogId": <catalogId>, "catalogName": <catalogName>, "image": <image>, "countryId":<countryId>, "country": <country>, "validBeginDate": <validBeginDate>, "validEndDate": <validEndDate>, "postDate": <postDate>, "postDateDiff": <postDateDiff> }, ... ], "groups": [ { "name": <name>, "count": null, "fieldName": <fieldName>, "id": null, "sort": <sort>, "subItem": [ { "name": <name>, "count": <count>, "fieldName": <fieldName>, "id": <id>, "sort": <sort> }, ... ] }, ... ], "queryUrls": { "searchAesUrl": <searchAesUrl>, "groupAesUrl" <groupAesUrl> } } } ``` #### 輸出參數說明 輸出欄位 | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- | -------- | | code | 代碼 | int | 0表示ok | | errorMsg | 錯誤訊息 | String | | | totalpages | 共計幾頁 | int | N | | currpage | 目前頁次 | int | N | | totalrecords | 總筆數 | int | N | | startRow | 起始筆數 | int | N | | endRow | 結束筆數 | int | N | | rangeSize | 本頁筆數 | int | N | | rows | 資料列表 | [`列表內容欄位(Array Object)`](#列表內容欄位(rows)) | | | groups | 後分類列表 | [`後分類內容欄位(Array Object)`](#後分類內容欄位(groups)) | | | queryUrls | idol url | [`Query Url欄位(Object)`](#QueryUrl欄位) | | ##### 列表內容欄位(rows) | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- | -------- | | aid | 商機 ID | int | N | | seq | trade post 排序 | int | N | | subject | 商機標題 | String | N | | url | 商機(trade post)Cp頁URL(根據輸入的did去組domain,參考TradePostSearchListPageData.java #290) | String | N | | offerTypeId | 商機類型代碼 | int | N | | offerType | 商機類型名稱 | String | N | | companyId | 發送者公司CID | int | N | | catalogId | 商機分類 ID (標準taitra) | int | N | | catalogName | 商機分類 名稱 (標準taitra) | String | N | | image | 圖片URL | String | | | countryId | 發送者公司註冊國家ID | int | | | country | 發送者公司註冊國家 | String | | | validBeginDate | 商機有效起始日期 | int(日期) | | | validEndDate | 商機有效截止日期(即有效日期:Cp頁的valid_date) | int(日期) | | | postDate | 商機張貼日期(audit_date) | int(日期) | | | postDateDiff | 商機張貼日期(格式: x M y D -> 距今過了幾月幾日) | int | | ##### 後分類內容欄位(groups) | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- |-------- | | name | 分類標題(顯示名稱) | String | N | | count | 資料筆數 | int | 固定空值 | | [fieldName](#fieldName--不同分類對應不同的key名稱-亦可作為輸入的-groupKey-去查詢) | 欄位名稱 | String | 對應輸入的groupKey | | ~~groupBy~~ | ~~分類依據~~ | ~~String~~ | ~~同fieldName~~ | | id | 資料ID | String | 固定空值,後分類項目才有值 | | sort | 分類排序 | int | N | | subItem | 分類項目 | [`後分類項目內容欄位(Array Object)`](#後分類項目內容欄位(subItem)) | | ##### 後分類項目內容欄位(subItem) | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- |-------- | | name | 項目名稱(顯示名稱) | String | N | | count | 資料筆數 | int | N (項目資料若為0筆不會回傳) | | fieldName | 欄位(後分類)名稱 | String | | | [id](#id--亦可作為輸入的-groupValue-去查詢-對應不同分類,值範圍如下) | 資料ID(後分類值) | String | | | sort | 項目排序 | int | N | ###### fieldName : 不同分類對應不同的key名稱 (亦可作為[輸入的 groupKey](#後分類條件欄位(groups)) 去查詢) * Categories : post-category = CATALOG_ID_AUTNMPS <br/> * ~~Continent : post-continent = NATION_ID_AUTNMPS~~ <br/> * Country : post-country = BUSINESS_NATION_CODE_AUTNMPS <br/> * ~~Post Date : post-day = POST_DATE~~ ###### id : (亦可作為[輸入的 groupValue](#後分類條件欄位(groups)) 之查詢) 對應不同分類,值範圍如下 * Categories : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-category 查詢出來的清單代碼 <br/> * ~~Continent : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-continent 查詢出來的清單代碼~~ <br/> * Country : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-country 查詢出來的清單代碼 <br/> * ~~Post Date : ([URI054](https://docs.google.com/spreadsheets/d/1I4Zbb8aJw4Ndt-e6Pw3pdBtQMZg1DNlHsRvg7YogstU/edit#gid=0))用post-day 查詢出來的清單代碼~~ ##### QueryUrl欄位 | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- |-------- | | searchAesUrl | trade post列表的 AES url | String | | | groupAesUrl | trade post後分類的 AES url | String | | | ~~productRecommendAesUrl~~ | ~~推薦產品的 AES url~~ | ~~String~~ | ~~帶入<[URI022](https://docs.google.com/spreadsheets/d/1qSanhvMOlmAs7sWO0Sph-WzuqAw-99cdyKv7sVSQU34/edit#gid=0)>的 `uri` ,同時設定`useOnlyUri`: 1~~ | | ~~smallOrderRecommendAesUrl~~ | ~~最小訂購的 AES url~~ | ~~String~~ | ~~帶入<[URI023](https://docs.google.com/spreadsheets/d/1DOD0cXYU4WnQD3WcP6rzkZb7dKxMvfjz0ABykmzeiMU/edit#gid=0)>的 `uri` ,同時指定`useOnlyUri`: 1~~ |

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully