景点数据查询

服务器收到景点查询请求后,调用该接口获取景点介绍信息。

接口公共定义

参考Fulfillment接口定义

下面描述的为接口内针对景点的定义,请求参数定义通过inquire.intent.slots传递

响应参数定义通过reply.commands.body.templateContent中返回,下面重点定义这两部分信息。

方法:POST
URL:/travel/scenicInfo

请求

景点数据请求

支持指定景点id查询景点详情信息;

支持指定景点名称查询景点详情信息;

支持指定景点名称和地址位置(国家、省、市、区)查询景点详情信息;

支持指定地址位置(国家、省、市、区)查询景点详情信息;

成员名称

描述

是否必选

类型

取值范围

name

景点名称

否

string

/

country

国家名,如中国

否

string

/

province

省份名,如江苏省

否

string

/

city

城市名,如南京

否

string

/

district

城市下属区名称,如雨花台、雨花台区

否

string

/

county

城市下属县名称,如江宁、江宁县

否

string

/

id

景点ID

否

string

/

limit

请求景点的结果数, 默认为  10

否

string

/

响应

景点介绍数据响应

成员名称

描述

是否必选

类型

取值范围

items

景点介绍数据列表

否

ScenicInfoItems []

/

结构定义

ScenicInfoItems

成员名称

描述

是否必选

类型

取值范围

serviceId

景点ID

是

string

最大长度:32

name

景点名称

是

string

最大长度:64

country

国家名,如中国

否

string

最大长度:32

province

省份名,如江苏省

否

string

最大长度:32

city

城市名,如南京

否

string

最大长度:32

district

城市下属区名称,如雨花台、雨花台区

否

string

最大长度:32

county

城市下属县名称,如江宁、江宁县

否

string

最大长度:32

location

景点的经纬度信息

否

Location

/

address

景点详细地址

否

string

最大长度:128

score

景点评分,如4.8

否

float

/

brief

景点简介

否

string

最大长度:256

recommendation

景点推荐理由

否

string

最大长度:256

ticket

门票价格描述信息,如成人票120元,儿童票60元

否

string

最大长度:256

visitAdvice

游玩建议,如建议游玩2小时

否

string

最大长度:128

openHours

景点开放时间(如:全天)

否

string

最大长度:128

phoneNumber

景点联系电话

否

string

最大长度:128

majorScenic

景区主要景点

否

string

最大长度:64

mainImage

景点主图图片,small中存放图片尺寸为1339*536px

是

Image


imageList

景点图片列表,small中存放图片尺寸为288*192px,

medium中存放图片尺寸为384*256px,

是

Image[]

ImageInfo

最多返回个数:5

moreImagesUrl

景点图库的跳转地址

否

Interaction

Interaction

broadcast

景点语音播报介绍内容

否

string

最大长度:256

detailUrl

景点详情页跳转地址

是

Interaction

Interaction

nearbyInfo

景点附近推荐信息

否

NearbyInfoItems[]

NearbyInfoItem

comments

景点评论信息列表

否

Comment[]

Comment

moreCommentsUrl

更多评论跳转链接

否

Interaction

Interaction

NearbyInfoItem

成员名称

描述

是否必选

类型

取值范围

type

推荐信息类型

是

string

HOTEL,  SCENIC, FOOD, SHOPPING

name

推荐信息名称

是

string

最大长度:64

image

推荐信息相关图片

是

Image

/

detailUrl

推荐信息详情页跳转地址

是

Interaction

/

score

推荐信息评分,如4.8

否

float

/

distance

推荐地点距离景点的距离描述,如682米

否

String

最大长度:64

Comment

成员名称

描述

是否必选

类型

取值范围

nickName

评论者昵称

否

string

最大长度:64

rating

评论评分

否

integer

/

content

评论内容

是

string

最大长度:512

timestamp

评论发布时间戳

否

DateTimeFormatString

DateTimeFormatString

image

评论相关图片

否

ImageInfo[]

ImageInfo

消息样例

请求

  1. {
  2.  "version": "1.0",
  3.  "session": {
  4.    "isNew": "true",
  5.    "sessionId": "123456"
  6.  },
  7.  "endpoint": {
  8.    "auth": {
  9.      "apiAccessToken": "",
  10.      "application": {
  11.        "appId": "da8afea3619a411fb59bf5f673b7ff1e"
  12.      }
  13.    },
  14.    "device": {
  15.      "deviceId": "2906",
  16.      "supportedInterfaces": {}
  17.    },
  18.    "audioPlayer": {
  19.      "token": "",
  20.      "posInMilliSeconds": "",
  21.      "playStatus": ""
  22.    },
  23.    "locale": "zh_CN"
  24.  },
  25.  "header": {
  26.    "type": "IntentRequest",
  27.    "prodPkgName": "com.huawei.intelligent",
  28.    "timestamp": "15869741258"
  29.  },
  30.  "inquire": {
  31.    "inquireId": "efd1f6ca-8fdf-11e8-9eb6-529269fb1459",
  32.    "intent": {
  33.      "name": "",
  34.      "apiKey": "travel-scenicInfo",
  35.      "slots": {
  36.        "name": {
  37.          "name": "name",
  38.          "values": [
  39.            {
  40.              "real": "天安门"
  41.            }
  42.          ]
  43.        },
  44.        "country": {
  45.          "name": "country",
  46.          "slotType": "string",
  47.          "values": [
  48.            {
  49.              "real": "中国"
  50.            }
  51.          ]
  52.        },
  53.        "province": {
  54.          "name": "province",
  55.          "slotType": "string",
  56.          "values": [
  57.            {
  58.              "real": "北京"
  59.            }
  60.          ]
  61.        },
  62.        "city": {
  63.          "name": "city",
  64.          "slotType": "string",
  65.          "values": [
  66.            {
  67.              "real": "北京"
  68.            }
  69.          ]
  70.        }
  71.      },
  72.      "utterance": {
  73.        "original": ""
  74.      }
  75.    }
  76.  }
  77. }

响应

  1. {
  2.  "version": "1.0",
  3.  "reply": {
  4.    "displayText": "displayText",
  5.    "commands": [
  6.      {
  7.        "head": {
  8.          "namespace": "Render",
  9.          "name": "DisplayTemplate"
  10.        },
  11.        "body": {
  12.          "templateType": "travel-scenicInfo",
  13.          "templateContent": {
  14.            "items": [
  15.              {
  16.                "serviceId": "1001",
  17.                "name": "天安门广场",
  18.                "country": "中国",
  19.                "province": "北京",
  20.                "city": "北京市",
  21.                "district": "东城区",
  22.                "county": "string",
  23.                "location": {
  24.                  "locationSystem": "GCJ02",
  25.                  "latitude": "39.909604",
  26.                  "longitude": "116.397228",
  27.                  "poiId": ""
  28.                },
  29.                "address": "北京市东城区东长安街",
  30.                "score": 4.6,
  31.                "brief": "天安门广场是世界上最大的广场",
  32.                "recommendation": "必游景点榜 第3名",
  33.                "ticket": "免费",
  34.                "visitAdvice": "1-3小时",
  35.                "openHours": "05:00-22:00",
  36.                "phoneNumber": "10-63095745",
  37.                "majorScenic": "天安门城楼 外金水桥 天安门华表",
  38.                "mainImage": {
  39.                  "small": {
  40.                    "url": "string",
  41.                    "widthPixels": 0,
  42.                    "heightPixels": 0
  43.                  },
  44.                  "medium": {
  45.                    "url": "string",
  46.                    "widthPixels": 0,
  47.                    "heightPixels": 0
  48.                  },
  49.                  "large": {
  50.                    "url": "string",
  51.                    "widthPixels": 0,
  52.                    "heightPixels": 0
  53.                  }
  54.                },
  55.                "moreImagesUrl": {
  56.                  "webURL": "string",
  57.                  "deepLink": {
  58.                    "url": "string",
  59.                    "appName": "string",
  60.                    "appPackage": "string",
  61.                    "minVersion": 0,
  62.                    "minAndroidAPILevel": 0
  63.                  },
  64.                  "quickApp": {
  65.                    "url": "string",
  66.                    "minPlatformVersion": 0,
  67.                    "minVersion": 0
  68.                  }
  69.                },
  70.                "broadcast": "string",
  71.                "detailUrl": {
  72.                  "webURL": "string",
  73.                  "deepLink": {
  74.                    "url": "string",
  75.                    "appName": "string",
  76.                    "appPackage": "string",
  77.                    "minVersion": 0,
  78.                    "minAndroidAPILevel": 0
  79.                  },
  80.                  "quickApp": {
  81.                    "url": "string",
  82.                    "minPlatformVersion": 0,
  83.                    "minVersion": 0
  84.                  }
  85.                },
  86.                "nearbyInfo": [
  87.                  {
  88.                    "type": "SCENIC",
  89.                    "name": "中国国家博物馆",
  90.                    "image": {
  91.                      "small": {
  92.                        "url": "string",
  93.                        "widthPixels": 0,
  94.                        "heightPixels": 0
  95.                      },
  96.                      "medium": {
  97.                        "url": "string",
  98.                        "widthPixels": 0,
  99.                        "heightPixels": 0
  100.                      },
  101.                      "large": {
  102.                        "url": "string",
  103.                        "widthPixels": 0,
  104.                        "heightPixels": 0
  105.                      }
  106.                    },
  107.                    "detailUrl": {
  108.                      "webURL": "string",
  109.                      "deepLink": {
  110.                        "url": "string",
  111.                        "appName": "string",
  112.                        "appPackage": "string",
  113.                        "minVersion": 0,
  114.                        "minAndroidAPILevel": 0
  115.                      },
  116.                      "quickApp": {
  117.                        "url": "string",
  118.                        "minPlatformVersion": 0,
  119.                        "minVersion": 0
  120.                      }
  121.                    },
  122.                    "score": 4.5,
  123.                    "distance": "362m"
  124.                  },
  125.                  {
  126.                    "type": "FOOD",
  127.                    "name": "北京全聚德(前面店)",
  128.                    "image": {
  129.                      "small": {
  130.                        "url": "string",
  131.                        "widthPixels": 0,
  132.                        "heightPixels": 0
  133.                      },
  134.                      "medium": {
  135.                        "url": "string",
  136.                        "widthPixels": 0,
  137.                        "heightPixels": 0
  138.                      },
  139.                      "large": {
  140.                        "url": "string",
  141.                        "widthPixels": 0,
  142.                        "heightPixels": 0
  143.                      }
  144.                    },
  145.                    "detailUrl": {
  146.                      "webURL": "string",
  147.                      "deepLink": {
  148.                        "url": "string",
  149.                        "appName": "string",
  150.                        "appPackage": "string",
  151.                        "minVersion": 0,
  152.                        "minAndroidAPILevel": 0
  153.                      },
  154.                      "quickApp": {
  155.                        "url": "string",
  156.                        "minPlatformVersion": 0,
  157.                        "minVersion": 0
  158.                      }
  159.                    },
  160.                    "score": 4,
  161.                    "distance": "798m"
  162.                  }
  163.                ],
  164.                "moreCommentsUrl": "",
  165.                "comments": [
  166.                  {
  167.                    "nickName": "string",
  168.                    "rating": 4.5,
  169.                    "content": "string",
  170.                    "timestamp": "20200303101010000",
  171.                    "image": {
  172.                      "small": {
  173.                        "url": "string",
  174.                        "widthPixels": 0,
  175.                        "heightPixels": 0
  176.                      },
  177.                      "medium": {
  178.                        "url": "string",
  179.                        "widthPixels": 0,
  180.                        "heightPixels": 0
  181.                      },
  182.                      "large": {
  183.                        "url": "string",
  184.                        "widthPixels": 0,
  185.                        "heightPixels": 0
  186.                      }
  187.                    }
  188.                  }
  189.                ]
  190.              }
  191.            ]
  192.          }
  193.        }
  194.      }
  195.    ]
  196.  },
  197.  "isEndSession": true,
  198.  "errorCode": "0",
  199.  "errorMessage": "OK"
  200. }