Commit b5b4b5c7 authored by isnirp's avatar isnirp

datasource

parent 1f83f2f8
package com.flimbis.qi_data.datasource;
import com.flimbis.qi_data.model.Todos;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Single;
public interface TodoDataSource {
Single<Todos> get(long id);
Observable<List<Todos>> getAll(int page);
Single<Long> create(Todos todo);
Single<Long> update(Todos todo);
Single<Long> delete(long id);
}
package com.flimbis.qi_data.model;
public class Events extends Tasks {
private String id;
private String host;
private String venue;
private String start;
private String end;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getVenue() {
return venue;
}
public void setVenue(String venue) {
this.venue = venue;
}
public String getStart() {
return start;
}
public void setStart(String start) {
this.start = start;
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
}
package com.flimbis.qi_data.model;
public class Tasks {
protected int taskId;
protected String name;
protected String alias;
protected String description;
protected long timestamp;
public int getTaskId() {
return taskId;
}
public void setTaskId(int taskId) {
this.taskId = taskId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
}
package com.flimbis.qi_data.model;
public class Todos extends Tasks {
private String id;
private boolean isComplete;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public boolean isComplete() {
return isComplete;
}
public void setComplete(boolean complete) {
isComplete = complete;
}
}
package com.flimbis.qi_data.repository;
import com.flimbis.qi_core.entity.EventEntity;
import com.flimbis.qi_core.repository.EventRepository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Single;
public class EventRepositoryImpl implements EventRepository {
@Override
public Observable<List<EventEntity>> getAll(int page) {
return null;
}
@Override
public Single<EventEntity> get(long id) {
return null;
}
}
package com.flimbis.qi_data.repository;
import com.flimbis.qi_core.entity.Task;
import com.flimbis.qi_core.repository.TaskRepository;
import com.flimbis.qi_data.datasource.TodoDataSource;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Single;
public class TaskRepositoryImpl implements TaskRepository {
private TodoDataSource dataSource;
public TaskRepositoryImpl(TodoDataSource dataSource) {
this.dataSource = dataSource;
}
@Override
public Observable<List<Task>> getAll(int page) {
return null;
}
@Override
public Single<Task> get(long id) {
return null;
}
}
package com.flimbis.qi_data.repository;
import com.flimbis.qi_core.entity.Todo;
import com.flimbis.qi_core.repository.TodoRepository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Single;
public class TodoRepositoryImpl implements TodoRepository {
@Override
public Single<Long> create(Todo todo) {
return null;
}
@Override
public Single<Long> update(Todo todo) {
return null;
}
@Override
public Single<Long> delete(long id) {
return null;
}
@Override
public Observable<List<Todo>> getAll(int page) {
return null;
}
@Override
public Single<Todo> get(long id) {
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment