网页浏览中的单个或多个水平滑块会带来麻烦.用户滑动滑块的拇指而不会导致页面视图滑动.
我尝试过的变通方法
在从模型类生成Endpoint之后,我编辑ClassnameEndpoint文件以生成一个方法,该方法将使用修改后的SELECT字符串返回实体列表.
不知何故,这会导致冲突和生成客户端库失败,如下所示:
信息:已成功处理C:\ Users\1177\AndroidStudioProjects\N5\appN5-AppEngine\target/generated-sources/appengine-endpoints\WEB-INF/appengine-web.xml [ERROR] com.google.api.server.spi .config.validation.ApiConfigInvalidException:具有相同休息路径的多个方法"GET eventdata":"listUserEventData"和"listEventData"
这是ClassnameEndpoint.java,它在生成后手动编辑:
注意listEventData和listUserEventData是相同的,但SELECT字符串除外...
那么如何创建一个端点方法来获取所有实体,另一种方法来获取没有冲突的SOME实体?
package sic.example.appn5;
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiNamespace;
import com.google.api.server.spi.response.CollectionResponse;
import com.google.appengine.api.datastore.Cursor;
import com.google.appengine.datanucleus.query.JPACursorHelper;
import java.util.List;
import javax.annotation.Nullable;
import javax.inject.Named;
import javax.persistence.EntityExistsException;
import javax.persistence.EntityNotFoundException;
import javax.persistence.EntityManager;
import javax.persistence.Query;
@Api(name = "eventdataendpoint", namespace = @ApiNamespace(ownerDomain = "example.sic", ownerName = "example.sic", packagePath = "appn5"))
public class EventDataEndpoint {
/**
* This method lists all the entities inserted in datastore.
* It uses HTTP GET method and paging support.
*
* @return …Run Code Online (Sandbox Code Playgroud) rest google-app-engine google-cloud-endpoints android-studio