commit e9984539d354e0e4696d57670ac2025bfa918ece Author: leo Date: Sun Oct 20 13:01:05 2024 +0800 新增 1020_舌苔API_測試 diff --git a/1020_%E8%88%8C%E8%8B%94API_%E6%B8%AC%E8%A9%A6.md b/1020_%E8%88%8C%E8%8B%94API_%E6%B8%AC%E8%A9%A6.md new file mode 100644 index 0000000..3819442 --- /dev/null +++ b/1020_%E8%88%8C%E8%8B%94API_%E6%B8%AC%E8%A9%A6.md @@ -0,0 +1,77 @@ +# API相關 +## 上傳資料 + +### 上傳暫存資料(演算法抓完之後就進行刪除了) +``` +URL : http://211.22.135.143:7500/api/Tongue_analysis_tw_1 +Method : POST +Content-Type: application/json +data:{ + "img_name": 120241019105623, + "test_id": user_id, + "test_analyst": " ", + "test_time": " ", + "test_date": " ", + "img": img_base64, + "data_creat_time": "2023-01-11T12:53:25.381Z" + } + +``` +### 上傳永久資料(上傳後會永久保存) +``` +URL : http://211.22.135.143:7500/api/Tongue_analysis_tw +Method : POST +Content-Type: application/json +data:{ + "img_name": 120241019105623, + "test_id": user_id, + "test_analyst": " ", + "test_time": " ", + "test_date": " ", + "img": img_base64, + "data_creat_time": "2023-01-11T12:53:25.381Z" + } + +``` +img需要轉base64的格式 +如以下操作 + +![](http://140.125.21.65:8418/TCM/Tongue/raw/branch/master/img/%E5%9C%96%E7%89%871.png) + +轉換完成後,並將數據打包成JSON +如下圖所示 + +![](http://140.125.21.65:8418/TCM/Tongue/raw/branch/master/img/%E5%9C%96%E7%89%872.png) + +要有圖片(base64格式)、圖片名稱、及使用者ID + +等待演算法完成,再進行抓取資料 + +![](http://140.125.21.65:8418/TCM/Tongue/raw/branch/master/img/%E5%9C%96%E7%89%873.png) + + + +``` + +URL : http://211.22.135.143:7500/api/Tongue_analysis_detail/img_name-120241019105623.jpg +Method : GET +Content-Type: application/json + + + +``` +記得在img_name後加上".jpg" + +若有資料後,即可直接去獲取資料 +``` +URL : http://211.22.135.143:7500/api/Tongue_analysis_detail/120241019105623.jpg +Method : GET +Content-Type: application/json +``` + +![](http://140.125.21.65:8418/TCM/Tongue/raw/branch/master/img/%E5%9C%96%E7%89%874.png) + +以下是測試時使用到的API + +![](http://140.125.21.65:8418/TCM/Tongue/raw/branch/master/img/%E5%9C%96%E7%89%875.png) +