Gluon mobile 如何获取GluonObservableObject以移除带有Gluon Connect的对象?
我想从服务器上的数据库中删除一个对象。我正在使用Gluon mobile 如何获取GluonObservableObject以移除带有Gluon Connect的对象?,gluon-mobile,Gluon Mobile,我想从服务器上的数据库中删除一个对象。我正在使用 RestClient del = RestClient.create().method("DELETE") .host("http://localhost:8080/host") .path("path"); DataProvider.removeObject(???, del.createO
RestClient del = RestClient.create().method("DELETE")
.host("http://localhost:8080/host")
.path("path");
DataProvider.removeObject(???,
del.createObjectDataRemover(MyClass.class)
我需要以某种方式获得一个GluonObservableObject
,但我不知道该怎么做,因为它没有我可以使用的构造函数。我也不明白为什么我需要传递一个GluonObservableObject
,而不是像storeObject
那样传递对象本身。我有一个要存储/删除的对象-我传递它
我还尝试从GluonObservableList
中检索对象,但它们也只是对象而不是可观察对象
如何删除对象?
DataProvider.removeObject
用于从数据源而不是数据库中删除对象。你检查过样品了吗?有一个NoteService::remove
方法从数据库中删除该项,该方法由ListHandler::removietem
调用。您可以在服务器中实现这些方法,然后只需要一个GET/POST-RestClient,路径为“/remove/{id}”
@JoséPereda,谢谢。我不应该使用DELETE来请求删除而不是GET/POST吗?那么,您也可以使用@DELETE
来定义REST端点。