项目作者: baldapps

项目描述 :
Project template to use a Java App Engine as endpoint for Google actions.
高级语言: Java
项目地址: git://github.com/baldapps/google-actions.git
创建时间: 2017-06-10T17:59:08Z
项目社区:https://github.com/baldapps/google-actions

开源协议:GNU General Public License v3.0

下载


Java App Engine Google Action Endpoint

Project template to use a Java App Engine as endpoint
for Google actions.

Features

  • Google Actions Framework to manage requests and responses
    directly from Google or via DialogFlow
  • Google Actions Api v2
  • DialogFlow end point (v1 and v2 support)
  • Account linking Framework implementing implicit flow and
    authorization code flow

Requirements

Initialize the Google Cloud SDK using:

  1. gcloud init

This skeleton is ready to run.

Maven

Run Locally

  1. mvn appengine:run

Deploy

  1. mvn appengine:deploy

Test Only

  1. mvn test

What you need to change in this project template

Class AppConfiguration: change the data for your project, assign
username and password to DialogFlow so each request is authenticated

You can extend the DFWebhookServletV2 to use DialogFlow v2 API, an example is
the DummyDFServletV2.

For account linking you can extend AuthServlet and TokenServlet.
You can see examples like DummyAuthServlet and DummyTokenServlet.

In order to use the OAuth2 for account linking you need to generate
tokens. There are several ways to generate a token. According to
Google docs you can create a json object and the use symmetric
encryption or you can simply generate random numbers. In the latter
case you need to save the information in the datastore using
Objectify.

If you use Objectify you need to implement the method register
in the class OfyHelper.