---
# System prepended metadata

title: 全端Api

---

# 全端Api
## 歷程
### Get
```haskell=
[說明]: 回傳整個資料
[API]: /records
[方法]: Get
[參數]:
[
    {
        "recordId": 1,
        "recordDate": "2021-01-17T16:00:00.000Z",
        "recordCount": 10,
        "userID": 6,
        "walkId": 1165
    },
    {
        "recordId": 2,
        "recordDate": "2021-01-17T16:00:00.000Z",
        "recordCount": 10,
        "userID": 6,
        "walkId": 1165
    }
]

```

```haskell=
[說明]: 回傳單筆資料
[API]: /records/id
[方法]: Get
[參數]:
{
    "recordId": 1,
    "recordDate": "2021-01-17T16:00:00.000Z",
    "recordCount": 10,
    "userID": 6,
    "walkId": 1165
}

```

### Post

```haskell=
[說明]: 新增一筆新資料
[API]: /records
[方法]: Post
[參數]:
[
    {
        "recordId": 1,,//自動產生
        "recordDate": "2021-01-17T16:00:00.000Z",,//自動產生
        "recordCount": 10,
        "userID": 6,
        "walkId": 1165
    },
    {
        "recordId": 2,
        "recordDate": "2021-01-17T16:00:00.000Z",
        "recordCount": 10,
        "userID": 6,
        "walkId": 1165
    }
]
[成功回應]:
{
    "message": "成功新增一筆資料"
}
[失敗回應]:
{
    "message": "新增失敗"
}

```

## 步道
### Get
```haskell=
[說明]: 回傳整個資料
[API]: /walkPlaceList
[方法]: Get
[參數]:
[
    {
        "walkId": 1159,
        "walkPlaceName": "螺山步道",
        "walkCity": "馬祖",
        "walkAddress": "連江縣北竿鄉?里村47號",
        "walkDetial": "每年4、5月間，野百合在林木下、步道旁紛紛盛開，美不勝收，沿岸一處奇岩仿如至聖孔子，靜立海上、聽濤觀海，頗具奇趣。螺山自然步道是一條兼具健身、賞景、觀浪、磯釣等多功能步道，山靜海湧之美盡在眼前，值得您細細體驗與品賞",
        "walkTel": "886-836-56534",
        "walkLength": "750",
        "walkTime": "1",
        "walkPic1": null,
        "walkPic2": null,
        "addressLat": "120.0082105",
        "addressLng": "26.2205924",
        "iconLat1": "120.0081394",
        "iconLng1": "222058817",
        "iconLat2": "120.0081002",
        "iconLng2": "26.22053654",
        "iconLat3": "120.0083472",
        "iconLng3": "226.22045716",
        "iconLat4": "9120.0084358",
        "iconLng4": "8，26.22034347",
        "walkArea": "連江縣",
        "visited": null
    }
]

```

```haskell=
[說明]: 回傳單筆資料
[API]: /walkPlaceList/id
[方法]: Get
[參數]:
{
    "walkId": 1160,
    "walkPlaceName": "壁山步道",
    "walkCity": "馬祖",
    "walkAddress": "連江縣北竿鄉里村47號",
    "walkDetial": "登壁山至觀景台可瞭望塘岐村全貌及由上往下看飛機起降，還可以欣賞晨曦美景，進入霧季時在雲霧繚繞中，猶如置身仙境虛幻飄渺，值得親身體驗。",
    "walkTel": "886-836-56534",
    "walkLength": "730",
    "walkTime": "1",
    "walkPic1": null,
    "walkPic2": null,
    "addressLat": "119.9924357",
    "addressLng": "26.2249062",
    "iconLat1": "119.9925129",
    "iconLng1": "222488041",
    "iconLat2": "119.9926309",
    "iconLng2": "26.22493952",
    "iconLat3": "119.9928698",
    "iconLng3": "26.22492562",
    "iconLat4": "119.9930114",
    "iconLng4": "26.22489231",
    "walkArea": null,
    "visited": null
}

```

### Post

```haskell=
[說明]: 新增一筆資料
[API]: /walkPlaceList
[方法]: Post
[參數]:
[
    {
        "walkId": 1159, ,//自動產生
        "walkPlaceName": "螺山步道",
        "walkCity": "馬祖",
        "walkAddress": "連江縣北竿鄉?里村47號",
        "walkDetial": "每年4、5月間，野百合在林木下、步道旁紛紛盛開，美不勝收，沿岸一處奇岩仿如至聖孔子，靜立海上、聽濤觀海，頗具奇趣。螺山自然步道是一條兼具健身、賞景、觀浪、磯釣等多功能步道，山靜海湧之美盡在眼前，值得您細細體驗與品賞",
        "walkTel": "886-836-56534",
        "walkLength": "750",
        "walkTime": "1",
        "walkPic1": null,
        "walkPic2": null,
        "addressLat": "120.0082105",
        "addressLng": "26.2205924",
        "iconLat1": "120.0081394",
        "iconLng1": "222058817",
        "iconLat2": "120.0081002",
        "iconLng2": "26.22053654",
        "iconLat3": "120.0083472",
        "iconLng3": "226.22045716",
        "iconLat4": "9120.0084358",
        "iconLng4": "8，26.22034347",
        "walkArea": "連江縣",
        "visited": null
    }
]
[成功回應]:
{
    "message": "成功新增一筆資料"
}
[失敗回應]:
{
    "message": "新增失敗"
}
```
```haskell=
[API]: /records/id
[方法]: Put
[參數]:
{
    "walkId": 1160,
    "walkPlaceName": "test",
    "walkCity": "test",
    "walkAddress": "test",
    "walkDetial": "test",
    "walkTel": "test886-2-24991115",
    "walkLength": "test",
    "walkTime": "1",
    "walkPic1": null,
    "walkPic2": null,
    "addressLat": null,
    "addressLng": null,
    "iconLat1": null,
    "iconLng1": null,
    "iconLat2": null,
    "iconLng2": null,
    "iconLat3": null,
    "iconLng3": null,
    "iconLat4": null,
    "iconLng4": "test",
    "walkArea": "test",
    "visited": 100
}

[成功回應]:
{
    "data": {
        "walkId": 1160,
        "walkPlaceName": 1160,
        "walkCity": "彰化",
        "walkAddress": "台北市",
        "walkDetial": "台北市",
        "walkTel": "886-2-24991115",
        "walkLength": 1200,
        "walkTime": 1,
        "walkPic1": null,
        "walkPic2": null,
        "addressLat": null,
        "addressLng": null,
        "iconLat1": null,
        "iconLng1": null,
        "iconLat2": null,
        "iconLng2": null,
        "iconLat3": null,
        "iconLng3": null,
        "iconLat4": null,
        "iconLng4": 1160,
        "visited": 100,
        "walkArea": "台北市"
    },
    "message": "成功更新一筆資料"
}
[失敗回應]:
{
    "message": "更新失敗" + walkId
}
```

## 天氣
### Get
```haskell=
[說明]: 回傳整個資料
[API]: /FWeatherList
[方法]: Get
[參數]:
[
    {
        "weatherId": 89,
        "CityName": "嘉義縣",
        "parameterName": "晴時多雲"
    },
    {
        "weatherId": 90,
        "CityName": "新北市",
        "parameterName": "晴時多雲"
    }
]

```
## 手錶
### Get
```haskell=
[說明]: 回傳整個資料
[API]: /watch
[方法]: Get
[參數]:
[
    {
        "steps": 4443, //步數
        "distanceinmeters": 3142, //距離
        "floorsclimbed": 7, //階梯次數
        "minheartrateinbeatsperminute": 61, //分鐘每分鐘心跳數
        "maxheartrateinbeatsperminute": 137, //每分鐘最大心跳數
        "averageheartrateinbeatsperminute": 81, //每分鐘平均心跳數
        "restingheartrateinbeatsperminute": 69, //每分鐘靜息心跳
        "averagestresslevel": 31, //平均壓力數
        "maxstresslevel": 87, //最大壓力數
        "stressdurationinseconds": 14580,
        "reststressdurationinseconds": 20040,
        "activitystressdurationinseconds": 20220,
        "lowstressdurationinseconds": 8940,
        "mediumstressdurationinseconds": 4860,
        "hightstressdurationinseconds": 780,
        "stressqualifier": "calm_awake",
        "user_id": "k263syug",//用戶id
        "calendardate": "2019/11/8" //紀錄時間
    },
    {
        "steps": 2319,
        "distanceinmeters": 1641,
        "floorsclimbed": 0,
        "minheartrateinbeatsperminute": 52,
        "maxheartrateinbeatsperminute": 103,
        "averageheartrateinbeatsperminute": 69,
        "restingheartrateinbeatsperminute": 61,
        "averagestresslevel": 17,
        "maxstresslevel": 84,
        "stressdurationinseconds": 9480,
        "reststressdurationinseconds": 59880,
        "activitystressdurationinseconds": 8760,
        "lowstressdurationinseconds": 5580,
        "mediumstressdurationinseconds": 3120,
        "hightstressdurationinseconds": 780,
        "stressqualifier": "calm",
        "user_id": "k263syug",
        "calendardate": "2019/11/3"
    }
]

## 會員
### Get
```haskell=
[說明]: 回傳整個資料
[API]: /users
[方法]: Get
[
    {
        "userID": 6,
        "userName": "aaabbbbccc",
        "userEmail": "John@gmail.com",
        "userPassword": "123456",
        "userPic": null,
        "userAllcount": 400,
        "userAge": 1996,
        "userGender": "M",
        "userAuthority": "User",
        "addData": "2021-01-24T16:00:00.000Z",
        "quesion1": 1,
        "question2": 1,
        "question3": 1,
        "question4": 1
    },
    {
        "userID": 25,
        "userName": "John",
        "userEmail": "John@gmail.com",
        "userPassword": "John@gmail.com",
        "userPic": null,
        "userAllcount": null,
        "userAge": 1987,
        "userGender": "F",
        "userAuthority": "",
        "addData": "2021-02-13T16:00:00.000Z",
        "quesion1": null,
        "question2": null,
        "question3": null,
        "question4": null
    }
]
```
```htmlembedded=
[說明]: 回傳單資料
[API]: /users/id
[方法]: Get
{
    "userID": 6,
    "userName": "aaabbbbccc",
    "userEmail": "John@gmail.com",
    "userPassword": "123456",
    "userPic": null,
    "userAllcount": 400,
    "userAge": 1996,
    "userGender": "M",
    "userAuthority": "User",
    "addData": "2021-01-24T16:00:00.000Z",
    "quesion1": 1,
    "question2": 1,
    "question3": 1,
    "question4": 1
}
```


## 登入，登出，註冊
### Get
```haskell=
[說明]: 檢查是否有登入
[API]: /home
[方法]: Get
[參數]:
{
    "userName": "Alic",
    "userPassword": "123456"
}

[成功回應]:
Welcome back

[失敗回應]:
Please login to view this page!
```

```haskell=
[說明]: 登出
[API]: /logout
[方法]: Get
[成功回應]:

登出成功
```
### Post
```haskell=
[說明]: 登入
[API]: /auth
[方法]: POST
[參數]:
{
    "userName": "Alic",
    "userPassword": "123456"
}

[成功回應]:
Welcome back

[失敗回應]:
Incorrect Username and/or Password!

```
```haskell=
[說明]: 註冊會員
[API]: /create
[方法]: POST
[參數]:
    {
        "userID": ,//自動產生
        "userName": "test5",
        "userEmail": "test5@gmail.com",
        "userPassword": "test5@gmail.com",
        "userPic": null,
        "userAllcount": 400,
        "userAge": 1911,
        "userGender": "F",
        "userAuthority": "User",//自動產生
        "addData": "",//自動產生
        "question1": 0,
        "question2": 0,
        "question3": 1,
        "question4": 0
    }

[成功回應]:
{
    "ret_code": 0,
    "ret_msg": "註冊成功"
}

```



