win.doyto.query.service.RestService Maven / Gradle / Ivy
package win.doyto.query.service;
import win.doyto.query.core.PageQuery;
import win.doyto.query.entity.EntityRequest;
import win.doyto.query.entity.EntityResponse;
import win.doyto.query.entity.Persistable;
import java.io.Serializable;
import java.util.List;
/**
* RestService
*
* @author f0rb on 2019-05-28
*/
public interface RestService, I extends Serializable, Q extends PageQuery, R extends EntityRequest, S extends EntityResponse> {
List list(Q q);
long count(Q q);
default PageList page(Q q) {
return new PageList<>(list(q), count(q));
}
S getById(I id);
void deleteById(I id);
void update(I id, R request);
void patch(I id, R request);
void create(R request);
}