feat: commit for sync

This commit is contained in:
SunZar 2025-02-20 11:18:36 +03:00
parent 386d2a0577
commit ae7a743d41
6 changed files with 15 additions and 29 deletions

View File

@ -1,22 +0,0 @@
package ru.myitschool.work.domain;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.function.Consumer;
import ru.myitschool.work.domain.entities.HistoryEntity;
import ru.myitschool.work.domain.entities.Status;
import ru.myitschool.work.domain.entities.UserEntity;
public interface UserRepository {
//void getAllUsers(@NonNull Consumer<Status<List<UserEntity>>> callback);
//void getUser(@NonNull Integer id, @NonNull Consumer<Status<UserEntity>> callback);
void getAllUserHistory(@NonNull String username, @NonNull Consumer<Status<List<HistoryEntity>>> callback);
//void getVolunteerCenterById(@NonNull Integer id, @NonNull Consumer<Status<HistoryEntity>> callback);
//void isExist(@NonNull String username, @NonNull Consumer<Status<Void>> callback);
//void register(@NonNull String id, @NonNull Consumer<Status<FullUserEntity>> callback);
void login(@NonNull String username, @NonNull String password, @NonNull Consumer<Status<Void>> callback);
}

View File

@ -0,0 +1,4 @@
package ru.myitschool.work.ui.admin;
public class AdminFragment {
}

View File

@ -0,0 +1,4 @@
package ru.myitschool.work.ui.admin;
public class AdminViewModel {
}

View File

@ -58,13 +58,13 @@ public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.ViewHold
public void bind(HistoryEntity item) { public void bind(HistoryEntity item) {
binding.time.setText(item.getTime().toString().substring(0, 10) + " " binding.time.setText(item.getTime().toString().substring(0, 10) + " "
+ item.getTime().toString().substring(11, 16)); + item.getTime().toString().substring(11, 16));
binding.nameReader.setText(item.getNameReader()); binding.nameReader.setText(item.getType());
if (item.getType() == 1){ /*if (item.getType() == 1){
binding.type.setText("QR-code"); binding.type.setText("QR-code");
} }
else{ else{
binding.type.setText("Карта"); binding.type.setText("Карта");
} }*/
} }
} }
} }

View File

@ -40,7 +40,7 @@ public class InformationViewModel extends ViewModel {
public void load() { public void load() {
mutableStateAllUserHistoryLiveData.setValue(new InformationViewModel.State(null, null, false)); mutableStateAllUserHistoryLiveData.setValue(new InformationViewModel.State(null, null, false));
getHistById(username); getHistById();
/*getAllUserHistoryUseCase.execute(username, status -> { /*getAllUserHistoryUseCase.execute(username, status -> {
mutableStateHistoryLiveData.postValue(fromStatus(status)); mutableStateHistoryLiveData.postValue(fromStatus(status));
});*/ });*/

View File

@ -48,8 +48,8 @@ public class ProfileViewModel extends ViewModel {
return; return;
} }
//userCheckCompleted = true; //userCheckCompleted = true;
if (status.getStatusCode() == 200) { /*if (status.getStatusCode() == 200) {
if (status.getValue().g != null) { if (status.getValue() != null) {
GetAllUserHistoryUseCase.execute(status.getValue().getStatus(), status2 -> { GetAllUserHistoryUseCase.execute(status.getValue().getStatus(), status2 -> {
Log.d("taggis", status.getStatusCode() + " " + status.getErrors()); Log.d("taggis", status.getStatusCode() + " " + status.getErrors());
if (status.getStatusCode() == 200 && status.getErrors() == null) { if (status.getStatusCode() == 200 && status.getErrors() == null) {
@ -71,7 +71,7 @@ public class ProfileViewModel extends ViewModel {
false false
)); ));
} }
} }*/
}); });
} }