嗨,我用 mvvm 制作应用程序.... 在存储库类中,我有 3 个功能 1-检查帖子是否喜欢 2-获取用户名 3-获取用户帖子 它是否验证单一责任原则?
public DatabaseReference getPostCallback (String id) {
return FirebaseDatabase.getInstance().getReference("Posts");
}
public String getUserName(String uid){
//Accses database and get name
}
public Boolean isLike(String uid, String postId){
//Check is liked or not
}