這篇我們實作upload方法
@Override
public void uploadData(String id,
String key,
Object newValue){
new Thread(() -> {
database.collection("RoomData")
.document(id)
.update(key, newValue)
.addOnSuccessListener(aVoid -> {
callback.uploadSuccess();
})
.addOnFailureListener(e -> {
callback.uploadError();
});
}).start();
}
upload方法參數:
下一篇來實作delete方法