Added filter classes
This commit is contained in:
parent
256de109c3
commit
5b18bb626b
@ -23,7 +23,7 @@ public interface CouponAPI{
|
|||||||
Call<List<Coupon>> list();
|
Call<List<Coupon>> list();
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("coupons")
|
||||||
Call<ArrayList<Coupon>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Coupon>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
@Headers("Content-Type: application/json")
|
@Headers("Content-Type: application/json")
|
||||||
@PUT("coupons/{id}")
|
@PUT("coupons/{id}")
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public interface CustomerAPI {
|
|||||||
@POST("customers/{id}/downloads")
|
@POST("customers/{id}/downloads")
|
||||||
Call<List<Download>> downloads(@Path("id") int id);
|
Call<List<Download>> downloads(@Path("id") int id);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("customers")
|
||||||
Call<ArrayList<Customer>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Customer>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ public interface OrderAPI {
|
|||||||
@POST("orders/batch")
|
@POST("orders/batch")
|
||||||
Call<String> batch(@Body Order body);
|
Call<String> batch(@Body Order body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("orders")
|
||||||
Call<ArrayList<Order>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Order>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ public interface OrderNoteAPI {
|
|||||||
@DELETE("orders/{id}/notes/{note_id}")
|
@DELETE("orders/{id}/notes/{note_id}")
|
||||||
Call<OrderNote> delete(@Path("id") int order_id, @Path("note_id") int note_id, @Query("force") boolean force);
|
Call<OrderNote> delete(@Path("id") int order_id, @Path("note_id") int note_id, @Query("force") boolean force);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("orders/{id}/notes")
|
||||||
Call<ArrayList<OrderNote>> filter(@QueryMap Map<String, String> filter);
|
Call<List<OrderNote>> filter(@Path("id") int order_id, @QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ public interface ProductAttributeAPI {
|
|||||||
@POST("products/attributes/batch")
|
@POST("products/attributes/batch")
|
||||||
Call<String> batch(@Body Attribute body);
|
Call<String> batch(@Body Attribute body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("products/attributes")
|
||||||
Call<ArrayList<Attribute>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Attribute>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@ public interface ProductAttributeTermAPI {
|
|||||||
@POST("products/attributes/batch")
|
@POST("products/attributes/batch")
|
||||||
Call<String> batch(@Body AttributeTerm body);
|
Call<String> batch(@Body AttributeTerm body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("products/attributes/{id}/terms")
|
||||||
Call<ArrayList<AttributeTerm>> filter(@QueryMap Map<String, String> filter);
|
Call<List<AttributeTerm>> filter(@Path("id") int attribute_id, @QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ public interface ProductCategoryAPI {
|
|||||||
@POST("products/categories/batch")
|
@POST("products/categories/batch")
|
||||||
Call<String> batch(@Body Category body);
|
Call<String> batch(@Body Category body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("products/categories")
|
||||||
Call<ArrayList<Category>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Category>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ public interface ProductReviewAPI {
|
|||||||
@POST("products/reviews/batch")
|
@POST("products/reviews/batch")
|
||||||
Call<String> batch(@Body ProductReview body);
|
Call<String> batch(@Body ProductReview body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("products/reviews")
|
||||||
Call<ArrayList<ProductReview>> filter(@QueryMap Map<String, String> filter);
|
Call<List<ProductReview>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ public interface ProductTagAPI {
|
|||||||
@POST("products/tags/batch")
|
@POST("products/tags/batch")
|
||||||
Call<String> batch(@Body Tag body);
|
Call<String> batch(@Body Tag body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("products/tags")
|
||||||
Call<ArrayList<Tag>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Tag>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -38,9 +38,7 @@ public interface ProductVariationAPI {
|
|||||||
@PUT("products/{id}/variations/{variation_id}")
|
@PUT("products/{id}/variations/{variation_id}")
|
||||||
Call<Variation> batch(@Path("id") int product_id, @Path("variation_id") int variation_id, @Body Product body);
|
Call<Variation> batch(@Path("id") int product_id, @Path("variation_id") int variation_id, @Body Product body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("products/{id}/variations")
|
||||||
Call<ArrayList<Variation>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Variation>> filter(@Path("id") int product_id, @QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ public interface RefundAPI {
|
|||||||
@DELETE("orders/{id}/refunds/{refund_id}")
|
@DELETE("orders/{id}/refunds/{refund_id}")
|
||||||
Call<Refund> delete(@Path("id") int order_id, @Path("refund_id") int refund_id, @Query("force") boolean force);
|
Call<Refund> delete(@Path("id") int order_id, @Path("refund_id") int refund_id, @Query("force") boolean force);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("orders/{id}/refunds")
|
||||||
Call<ArrayList<Refund>> filter(@QueryMap Map<String, String> filter);
|
Call<List<Refund>> filter(@Path("id") int order_id, @QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ public interface ShippingClassAPI {
|
|||||||
@POST("products/shipping_classes/batch")
|
@POST("products/shipping_classes/batch")
|
||||||
Call<String> batch(@Body ShippingClass body);
|
Call<String> batch(@Body ShippingClass body);
|
||||||
|
|
||||||
@GET("coupons")
|
@GET("products/shipping_classes")
|
||||||
Call<ArrayList<ShippingClass>> filter(@QueryMap Map<String, String> filter);
|
Call<List<ShippingClass>> filter(@QueryMap Map<String, String> filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class CouponFilter extends ListFilter{
|
||||||
|
|
||||||
|
String code;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
addFilter("code", code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class CustomerFilter extends ListFilter{
|
||||||
|
|
||||||
|
String email;
|
||||||
|
String role;
|
||||||
|
|
||||||
|
//all, administrator, editor, author, contributor, subscriber, customer and shop_manager
|
||||||
|
|
||||||
|
enum Role {
|
||||||
|
ALL{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "all";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ADMINISTRATOR{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "administrator";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
EDITOR{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "editor";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
AUTHOR{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "author";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
CONTRIBUTOR{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "contributor";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
SUBSCRIBER{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "subscriber";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
CUSTOMER{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "customer";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
SHOP_MANAGER{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "shop_manager";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
addFilter("email", email);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(String role) {
|
||||||
|
this.role = role;
|
||||||
|
addFilter("role", role);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(Role role) {
|
||||||
|
this.role = role.toString();
|
||||||
|
addFilter("role", role.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,141 @@
|
|||||||
package me.gilo.woodroid.models.filters;
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class ListFilter {
|
public class ListFilter {
|
||||||
|
|
||||||
|
String context;
|
||||||
|
int page;
|
||||||
|
int per_page;
|
||||||
|
String search;
|
||||||
|
String after;
|
||||||
|
String before;
|
||||||
|
int[] exclude;
|
||||||
|
int[] include;
|
||||||
|
int offset;
|
||||||
|
String order;
|
||||||
|
String orderby;
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, String> filters = new HashMap<>();
|
||||||
|
|
||||||
|
public String getContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContext(String context) {
|
||||||
|
this.context = context;
|
||||||
|
|
||||||
|
addFilter("context", context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(int page) {
|
||||||
|
this.page = page;
|
||||||
|
|
||||||
|
addFilter("page", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPer_page() {
|
||||||
|
return per_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPer_page(int per_page) {
|
||||||
|
this.per_page = per_page;
|
||||||
|
|
||||||
|
addFilter("per_page", per_page);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearch() {
|
||||||
|
return search;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearch(String search) {
|
||||||
|
this.search = search;
|
||||||
|
|
||||||
|
addFilter("search", search);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAfter() {
|
||||||
|
return after;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAfter(String after) {
|
||||||
|
this.after = after;
|
||||||
|
|
||||||
|
addFilter("after", after);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBefore() {
|
||||||
|
return before;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBefore(String before) {
|
||||||
|
this.before = before;
|
||||||
|
|
||||||
|
addFilter("before", before);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getExclude() {
|
||||||
|
return exclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExclude(int[] exclude) {
|
||||||
|
this.exclude = exclude;
|
||||||
|
|
||||||
|
addFilter("exclude", exclude);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getInclude() {
|
||||||
|
return include;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInclude(int[] include) {
|
||||||
|
this.include = include;
|
||||||
|
|
||||||
|
addFilter("include", include);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOffset() {
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOffset(int offset) {
|
||||||
|
this.offset = offset;
|
||||||
|
|
||||||
|
addFilter("offset", offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrder() {
|
||||||
|
return order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrder(String order) {
|
||||||
|
this.order = order;
|
||||||
|
|
||||||
|
addFilter("order", order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrderby() {
|
||||||
|
return orderby;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderby(String orderby) {
|
||||||
|
this.orderby = orderby;
|
||||||
|
|
||||||
|
addFilter("orderby", orderby);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addFilter(String filter, Object value){
|
||||||
|
filters.put(filter, value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getFilters() {
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,72 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class OrderFilter extends ListFilter{
|
||||||
|
|
||||||
|
private int[] parent;
|
||||||
|
private int[] parent_exclude;
|
||||||
|
|
||||||
|
String status;
|
||||||
|
|
||||||
|
int customer;
|
||||||
|
int product;
|
||||||
|
int dp;
|
||||||
|
|
||||||
|
public int[] getParent() {
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent(int[] parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
addFilter("parent", parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getParent_exclude() {
|
||||||
|
return parent_exclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent_exclude(int[] parent_exclude) {
|
||||||
|
this.parent_exclude = parent_exclude;
|
||||||
|
|
||||||
|
addFilter("parent_exclude", parent_exclude);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
|
||||||
|
addFilter("status", status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCustomer() {
|
||||||
|
return customer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomer(int customer) {
|
||||||
|
this.customer = customer;
|
||||||
|
|
||||||
|
addFilter("customer", customer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getProduct() {
|
||||||
|
return product;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduct(int product) {
|
||||||
|
this.product = product;
|
||||||
|
|
||||||
|
addFilter("product", product);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDp() {
|
||||||
|
return dp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDp(int dp) {
|
||||||
|
this.dp = dp;
|
||||||
|
addFilter("dp", dp);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class OrderNoteFilter {
|
||||||
|
|
||||||
|
String context;
|
||||||
|
String type;
|
||||||
|
|
||||||
|
Map<String, String> filters = new HashMap<>();
|
||||||
|
|
||||||
|
public String getContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContext(String context) {
|
||||||
|
this.context = context;
|
||||||
|
|
||||||
|
addFilter("context", context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
|
||||||
|
addFilter("type", type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addFilter(String filter, Object value) {
|
||||||
|
filters.put(filter, value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getFilters() {
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ProductAttributeFilter {
|
||||||
|
|
||||||
|
String context;
|
||||||
|
|
||||||
|
Map<String, String> filters = new HashMap<>();
|
||||||
|
|
||||||
|
public String getContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContext(String context) {
|
||||||
|
this.context = context;
|
||||||
|
|
||||||
|
addFilter("context", context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addFilter(String filter, Object value) {
|
||||||
|
filters.put(filter, value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getFilters() {
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class ProductAttributeTermFilter extends ListFilter{
|
||||||
|
private int[] parent;
|
||||||
|
int product;
|
||||||
|
boolean hide_empty;
|
||||||
|
String slug;
|
||||||
|
|
||||||
|
public int[] getParent() {
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent(int[] parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
addFilter("parent", parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getProduct() {
|
||||||
|
return product;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduct(int product) {
|
||||||
|
this.product = product;
|
||||||
|
addFilter("product", product);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHide_empty() {
|
||||||
|
return hide_empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHide_empty(boolean hide_empty) {
|
||||||
|
this.hide_empty = hide_empty;
|
||||||
|
addFilter("hide_empty", hide_empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
addFilter("slug", slug);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class ProductCategoryFilter extends ListFilter{
|
||||||
|
private int[] parent;
|
||||||
|
int product;
|
||||||
|
boolean hide_empty;
|
||||||
|
String slug;
|
||||||
|
|
||||||
|
public int[] getParent() {
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent(int[] parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
addFilter("parent", parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getProduct() {
|
||||||
|
return product;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduct(int product) {
|
||||||
|
this.product = product;
|
||||||
|
addFilter("product", product);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHide_empty() {
|
||||||
|
return hide_empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHide_empty(boolean hide_empty) {
|
||||||
|
this.hide_empty = hide_empty;
|
||||||
|
addFilter("hide_empty", hide_empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
addFilter("slug", slug);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,154 +1,26 @@
|
|||||||
package me.gilo.woodroid.models.filters;
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class ProductFilter{
|
public class ProductFilter extends ListFilter{
|
||||||
String context;
|
private int[] parent;
|
||||||
int page;
|
private int[] parent_exclude;
|
||||||
int per_page;
|
private String slug;
|
||||||
String search;
|
private String status;
|
||||||
String after;
|
private String type;
|
||||||
String before;
|
private String sku;
|
||||||
int[] exclude;
|
private boolean featured;
|
||||||
int[] include;
|
private String category;
|
||||||
int offset;
|
private String tag;
|
||||||
String order;
|
private String shipping_class;
|
||||||
String orderby;
|
private String attribute;
|
||||||
int[] parent;
|
private String attribute_term;
|
||||||
int[] parent_exclude;
|
private String tax_class;
|
||||||
String slug;
|
private boolean on_sale;
|
||||||
String status;
|
private String min_price;
|
||||||
String type;
|
private String max_price;
|
||||||
String sku;
|
private String stock_status;
|
||||||
boolean featured;
|
|
||||||
String category;
|
|
||||||
String tag;
|
|
||||||
String shipping_class;
|
|
||||||
String attribute;
|
|
||||||
String attribute_term;
|
|
||||||
String tax_class;
|
|
||||||
boolean on_sale;
|
|
||||||
String min_price;
|
|
||||||
String max_price;
|
|
||||||
String stock_status;
|
|
||||||
|
|
||||||
Map<String, String> filters = new HashMap<>();
|
|
||||||
|
|
||||||
public String getContext() {
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContext(String context) {
|
|
||||||
this.context = context;
|
|
||||||
|
|
||||||
addFilter("context", context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPage() {
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPage(int page) {
|
|
||||||
this.page = page;
|
|
||||||
|
|
||||||
addFilter("page", page);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPer_page() {
|
|
||||||
return per_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPer_page(int per_page) {
|
|
||||||
this.per_page = per_page;
|
|
||||||
|
|
||||||
addFilter("per_page", per_page);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSearch() {
|
|
||||||
return search;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearch(String search) {
|
|
||||||
this.search = search;
|
|
||||||
|
|
||||||
addFilter("search", search);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAfter() {
|
|
||||||
return after;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAfter(String after) {
|
|
||||||
this.after = after;
|
|
||||||
|
|
||||||
addFilter("after", after);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBefore() {
|
|
||||||
return before;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBefore(String before) {
|
|
||||||
this.before = before;
|
|
||||||
|
|
||||||
addFilter("before", before);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getExclude() {
|
|
||||||
return exclude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExclude(int[] exclude) {
|
|
||||||
this.exclude = exclude;
|
|
||||||
|
|
||||||
addFilter("exclude", exclude);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getInclude() {
|
|
||||||
return include;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInclude(int[] include) {
|
|
||||||
this.include = include;
|
|
||||||
|
|
||||||
addFilter("include", include);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getOffset() {
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOffset(int offset) {
|
|
||||||
this.offset = offset;
|
|
||||||
|
|
||||||
addFilter("offset", offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOrder() {
|
|
||||||
return order;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrder(String order) {
|
|
||||||
this.order = order;
|
|
||||||
|
|
||||||
addFilter("order", order);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOrderby() {
|
|
||||||
return orderby;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrderby(String orderby) {
|
|
||||||
this.orderby = orderby;
|
|
||||||
|
|
||||||
addFilter("orderby", orderby);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getParent() {
|
public int[] getParent() {
|
||||||
return parent;
|
return parent;
|
||||||
@ -324,12 +196,4 @@ public class ProductFilter{
|
|||||||
|
|
||||||
addFilter("stock_status", stock_status);
|
addFilter("stock_status", stock_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFilter(String filter, Object value){
|
|
||||||
filters.put(filter, value.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getFilters() {
|
|
||||||
return filters;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class ProductReviewFilter extends ListFilter{
|
||||||
|
|
||||||
|
int[] reviewer;
|
||||||
|
int[] reviewer_exclude;
|
||||||
|
String[] reviewer_email;
|
||||||
|
|
||||||
|
int[] product;
|
||||||
|
String status;
|
||||||
|
|
||||||
|
public int[] getReviewer() {
|
||||||
|
return reviewer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReviewer(int[] reviewer) {
|
||||||
|
this.reviewer = reviewer;
|
||||||
|
|
||||||
|
addFilter("reviewer", reviewer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getReviewer_exclude() {
|
||||||
|
return reviewer_exclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReviewer_exclude(int[] reviewer_exclude) {
|
||||||
|
this.reviewer_exclude = reviewer_exclude;
|
||||||
|
|
||||||
|
addFilter("reviewer_exclude", reviewer_exclude);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getReviewer_email() {
|
||||||
|
return reviewer_email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReviewer_email(String[] reviewer_email) {
|
||||||
|
this.reviewer_email = reviewer_email;
|
||||||
|
|
||||||
|
addFilter("reviewer_email", reviewer_email);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getProduct() {
|
||||||
|
return product;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduct(int[] product) {
|
||||||
|
this.product = product;
|
||||||
|
|
||||||
|
addFilter("product", product);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
|
||||||
|
addFilter("status", status);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class ProductTagFilter extends ListFilter{
|
||||||
|
|
||||||
|
int product;
|
||||||
|
boolean hide_empty;
|
||||||
|
String slug;
|
||||||
|
|
||||||
|
|
||||||
|
public int getProduct() {
|
||||||
|
return product;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduct(int product) {
|
||||||
|
this.product = product;
|
||||||
|
addFilter("product", product);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHide_empty() {
|
||||||
|
return hide_empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHide_empty(boolean hide_empty) {
|
||||||
|
this.hide_empty = hide_empty;
|
||||||
|
addFilter("hide_empty", hide_empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
addFilter("slug", slug);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,196 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class ProductVariationFilter extends ListFilter{
|
||||||
|
private int[] parent;
|
||||||
|
private int[] parent_exclude;
|
||||||
|
private String slug;
|
||||||
|
private String status;
|
||||||
|
private String type;
|
||||||
|
private String sku;
|
||||||
|
private boolean featured;
|
||||||
|
private String category;
|
||||||
|
private String tag;
|
||||||
|
private String shipping_class;
|
||||||
|
private String attribute;
|
||||||
|
private String attribute_term;
|
||||||
|
private String tax_class;
|
||||||
|
private boolean on_sale;
|
||||||
|
private String min_price;
|
||||||
|
private String max_price;
|
||||||
|
private String stock_status;
|
||||||
|
|
||||||
|
public int[] getParent() {
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent(int[] parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
|
||||||
|
addFilter("parent", parent);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getParent_exclude() {
|
||||||
|
return parent_exclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent_exclude(int[] parent_exclude) {
|
||||||
|
this.parent_exclude = parent_exclude;
|
||||||
|
|
||||||
|
addFilter("parent_exclude", parent_exclude);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
|
||||||
|
addFilter("slug", slug);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
|
||||||
|
addFilter("status", status);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
|
||||||
|
addFilter("type", type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku() {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
this.sku = sku;
|
||||||
|
|
||||||
|
addFilter("sku", sku);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFeatured() {
|
||||||
|
return featured;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFeatured(boolean featured) {
|
||||||
|
this.featured = featured;
|
||||||
|
|
||||||
|
addFilter("featured", featured);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory(String category) {
|
||||||
|
this.category = category;
|
||||||
|
|
||||||
|
addFilter("category", category);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTag(String tag) {
|
||||||
|
this.tag = tag;
|
||||||
|
|
||||||
|
addFilter("tag", tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShipping_class() {
|
||||||
|
return shipping_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShipping_class(String shipping_class) {
|
||||||
|
this.shipping_class = shipping_class;
|
||||||
|
|
||||||
|
addFilter("shipping_class", shipping_class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttribute() {
|
||||||
|
return attribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttribute(String attribute) {
|
||||||
|
this.attribute = attribute;
|
||||||
|
|
||||||
|
addFilter("attribute", attribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttribute_term() {
|
||||||
|
return attribute_term;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttribute_term(String attribute_term) {
|
||||||
|
this.attribute_term = attribute_term;
|
||||||
|
|
||||||
|
addFilter("attribute_term", attribute_term);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getTax_class() {
|
||||||
|
return tax_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTax_class(String tax_class) {
|
||||||
|
this.tax_class = tax_class;
|
||||||
|
|
||||||
|
addFilter("tax_class", tax_class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOn_sale() {
|
||||||
|
return on_sale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOn_sale(boolean on_sale) {
|
||||||
|
this.on_sale = on_sale;
|
||||||
|
|
||||||
|
addFilter("on_sale", on_sale);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMin_price() {
|
||||||
|
return min_price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMin_price(String min_price) {
|
||||||
|
this.min_price = min_price;
|
||||||
|
|
||||||
|
addFilter("min_price", min_price);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMax_price() {
|
||||||
|
return max_price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMax_price(String max_price) {
|
||||||
|
this.max_price = max_price;
|
||||||
|
|
||||||
|
addFilter("max_price", max_price);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStock_status() {
|
||||||
|
return stock_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStock_status(String stock_status) {
|
||||||
|
this.stock_status = stock_status;
|
||||||
|
|
||||||
|
addFilter("stock_status", stock_status);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class RefundFilter extends ListFilter{
|
||||||
|
|
||||||
|
private int[] parent;
|
||||||
|
private int[] parent_exclude;
|
||||||
|
|
||||||
|
int dp;
|
||||||
|
|
||||||
|
public int[] getParent() {
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent(int[] parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
addFilter("parent", parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getParent_exclude() {
|
||||||
|
return parent_exclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent_exclude(int[] parent_exclude) {
|
||||||
|
this.parent_exclude = parent_exclude;
|
||||||
|
|
||||||
|
addFilter("parent_exclude", parent_exclude);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDp() {
|
||||||
|
return dp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDp(int dp) {
|
||||||
|
this.dp = dp;
|
||||||
|
addFilter("dp", dp);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
|
public class ShippingClassesFilter extends ListFilter{
|
||||||
|
|
||||||
|
int product;
|
||||||
|
boolean hide_empty;
|
||||||
|
String slug;
|
||||||
|
|
||||||
|
|
||||||
|
public int getProduct() {
|
||||||
|
return product;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduct(int product) {
|
||||||
|
this.product = product;
|
||||||
|
addFilter("product", product);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHide_empty() {
|
||||||
|
return hide_empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHide_empty(boolean hide_empty) {
|
||||||
|
this.hide_empty = hide_empty;
|
||||||
|
addFilter("hide_empty", hide_empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
addFilter("slug", slug);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.CouponAPI;
|
import me.gilo.woodroid.data.api.CouponAPI;
|
||||||
import me.gilo.woodroid.models.Coupon;
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.filters.CouponFilter;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -28,6 +29,10 @@ public class CouponRepository extends WooRepository{
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Coupon>> coupons(CouponFilter couponFilter) {
|
||||||
|
return apiService.filter(couponFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Coupon> update(int id, Coupon coupon) {
|
public Call<Coupon> update(int id, Coupon coupon) {
|
||||||
return apiService.update(id, coupon);
|
return apiService.update(id, coupon);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.CustomerAPI;
|
import me.gilo.woodroid.data.api.CustomerAPI;
|
||||||
import me.gilo.woodroid.models.Customer;
|
import me.gilo.woodroid.models.Customer;
|
||||||
|
import me.gilo.woodroid.models.filters.CustomerFilter;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -28,6 +29,10 @@ public class CustomerRepository extends WooRepository{
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Customer>> customers(CustomerFilter customerFilter) {
|
||||||
|
return apiService.filter(customerFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Customer> update(int id, Customer customer) {
|
public Call<Customer> update(int id, Customer customer) {
|
||||||
return apiService.update(id, customer);
|
return apiService.update(id, customer);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package me.gilo.woodroid.repo;
|
|||||||
import me.gilo.woodroid.data.api.OrderAPI;
|
import me.gilo.woodroid.data.api.OrderAPI;
|
||||||
import me.gilo.woodroid.models.Order;
|
import me.gilo.woodroid.models.Order;
|
||||||
import me.gilo.woodroid.models.OrderNote;
|
import me.gilo.woodroid.models.OrderNote;
|
||||||
|
import me.gilo.woodroid.models.filters.OrderFilter;
|
||||||
import me.gilo.woodroid.repo.order.OrderNoteRepository;
|
import me.gilo.woodroid.repo.order.OrderNoteRepository;
|
||||||
import me.gilo.woodroid.repo.order.RefundRepository;
|
import me.gilo.woodroid.repo.order.RefundRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
@ -36,6 +37,10 @@ public class OrderRepository extends WooRepository {
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Order>> orders(OrderFilter orderFilter) {
|
||||||
|
return apiService.filter(orderFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Order> update(int id, Order order) {
|
public Call<Order> update(int id, Order order) {
|
||||||
return apiService.update(id, order);
|
return apiService.update(id, order);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package me.gilo.woodroid.repo.order;
|
|||||||
import me.gilo.woodroid.data.api.OrderNoteAPI;
|
import me.gilo.woodroid.data.api.OrderNoteAPI;
|
||||||
import me.gilo.woodroid.models.Order;
|
import me.gilo.woodroid.models.Order;
|
||||||
import me.gilo.woodroid.models.OrderNote;
|
import me.gilo.woodroid.models.OrderNote;
|
||||||
|
import me.gilo.woodroid.models.filters.OrderNoteFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ public class OrderNoteRepository extends WooRepository {
|
|||||||
return apiService.list(order.getId());
|
return apiService.list(order.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<OrderNote>> notes(Order order, OrderNoteFilter orderNoteFilter) {
|
||||||
|
return apiService.filter(order.getId(), orderNoteFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<OrderNote> delete(Order order, int id) {
|
public Call<OrderNote> delete(Order order, int id) {
|
||||||
return apiService.delete(order.getId(), id);
|
return apiService.delete(order.getId(), id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package me.gilo.woodroid.repo.order;
|
|||||||
import me.gilo.woodroid.data.api.RefundAPI;
|
import me.gilo.woodroid.data.api.RefundAPI;
|
||||||
import me.gilo.woodroid.models.Order;
|
import me.gilo.woodroid.models.Order;
|
||||||
import me.gilo.woodroid.models.Refund;
|
import me.gilo.woodroid.models.Refund;
|
||||||
|
import me.gilo.woodroid.models.filters.RefundFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -30,6 +31,10 @@ public class RefundRepository extends WooRepository {
|
|||||||
return apiService.list(order.getId());
|
return apiService.list(order.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Refund>> refunds(Order order, RefundFilter refundFilter) {
|
||||||
|
return apiService.filter(order.getId(), refundFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Refund> delete(Order order, int id) {
|
public Call<Refund> delete(Order order, int id) {
|
||||||
return apiService.delete(order.getId(), id);
|
return apiService.delete(order.getId(), id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo.product;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.ProductAttributeAPI;
|
import me.gilo.woodroid.data.api.ProductAttributeAPI;
|
||||||
import me.gilo.woodroid.models.Attribute;
|
import me.gilo.woodroid.models.Attribute;
|
||||||
|
import me.gilo.woodroid.models.filters.ProductAttributeFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ public class AttributeRepository extends WooRepository {
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Attribute>> attributes(ProductAttributeFilter productAttributeFilter) {
|
||||||
|
return apiService.filter(productAttributeFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Attribute> update(int id, Attribute attribute) {
|
public Call<Attribute> update(int id, Attribute attribute) {
|
||||||
return apiService.update(id, attribute);
|
return apiService.update(id, attribute);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo.product;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.ProductAttributeTermAPI;
|
import me.gilo.woodroid.data.api.ProductAttributeTermAPI;
|
||||||
import me.gilo.woodroid.models.AttributeTerm;
|
import me.gilo.woodroid.models.AttributeTerm;
|
||||||
|
import me.gilo.woodroid.models.filters.ProductAttributeFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -28,6 +29,10 @@ public class AttributeTermRepository extends WooRepository {
|
|||||||
return apiService.list(attribute_id);
|
return apiService.list(attribute_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<AttributeTerm>> terms(int attribute_id, ProductAttributeFilter productAttributeFilter) {
|
||||||
|
return apiService.filter(attribute_id, productAttributeFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<AttributeTerm> update(int attribute_id, int id, AttributeTerm term) {
|
public Call<AttributeTerm> update(int attribute_id, int id, AttributeTerm term) {
|
||||||
return apiService.update(attribute_id, id, term);
|
return apiService.update(attribute_id, id, term);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo.product;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.ProductCategoryAPI;
|
import me.gilo.woodroid.data.api.ProductCategoryAPI;
|
||||||
import me.gilo.woodroid.models.Category;
|
import me.gilo.woodroid.models.Category;
|
||||||
|
import me.gilo.woodroid.models.filters.ProductCategoryFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ public class CategoryRepository extends WooRepository {
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Category>> categories(ProductCategoryFilter productCategoryFilter) {
|
||||||
|
return apiService.filter(productCategoryFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Category> update(int id, Category category) {
|
public Call<Category> update(int id, Category category) {
|
||||||
return apiService.update(id, category);
|
return apiService.update(id, category);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo.product;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.ProductReviewAPI;
|
import me.gilo.woodroid.data.api.ProductReviewAPI;
|
||||||
import me.gilo.woodroid.models.ProductReview;
|
import me.gilo.woodroid.models.ProductReview;
|
||||||
|
import me.gilo.woodroid.models.filters.ProductReviewFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ public class ReviewRepository extends WooRepository {
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<ProductReview>> reviews(ProductReviewFilter productReviewFilter) {
|
||||||
|
return apiService.filter(productReviewFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<ProductReview> update(int id, ProductReview review) {
|
public Call<ProductReview> update(int id, ProductReview review) {
|
||||||
return apiService.update(id, review);
|
return apiService.update(id, review);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo.product;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.ShippingClassAPI;
|
import me.gilo.woodroid.data.api.ShippingClassAPI;
|
||||||
import me.gilo.woodroid.models.ShippingClass;
|
import me.gilo.woodroid.models.ShippingClass;
|
||||||
|
import me.gilo.woodroid.models.filters.ShippingClassesFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ public class ShippingClassRepository extends WooRepository {
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<ShippingClass>> shippingClasses(ShippingClassesFilter shippingClassesFilter) {
|
||||||
|
return apiService.filter(shippingClassesFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<ShippingClass> update(int id, ShippingClass shippingClass) {
|
public Call<ShippingClass> update(int id, ShippingClass shippingClass) {
|
||||||
return apiService.update(id, shippingClass);
|
return apiService.update(id, shippingClass);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo.product;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.ProductTagAPI;
|
import me.gilo.woodroid.data.api.ProductTagAPI;
|
||||||
import me.gilo.woodroid.models.Tag;
|
import me.gilo.woodroid.models.Tag;
|
||||||
|
import me.gilo.woodroid.models.filters.ProductTagFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ public class TagRepository extends WooRepository {
|
|||||||
return apiService.list();
|
return apiService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Tag>> tags(ProductTagFilter productTagFilter) {
|
||||||
|
return apiService.filter(productTagFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Tag> update(int id, Tag tag) {
|
public Call<Tag> update(int id, Tag tag) {
|
||||||
return apiService.update(id, tag);
|
return apiService.update(id, tag);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package me.gilo.woodroid.repo.product;
|
|||||||
|
|
||||||
import me.gilo.woodroid.data.api.ProductVariationAPI;
|
import me.gilo.woodroid.data.api.ProductVariationAPI;
|
||||||
import me.gilo.woodroid.models.Variation;
|
import me.gilo.woodroid.models.Variation;
|
||||||
|
import me.gilo.woodroid.models.filters.ProductVariationFilter;
|
||||||
import me.gilo.woodroid.repo.WooRepository;
|
import me.gilo.woodroid.repo.WooRepository;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ public class VariationRepository extends WooRepository {
|
|||||||
return apiService.list(product_id);
|
return apiService.list(product_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<List<Variation>> variations(int product_id, ProductVariationFilter productVariationFilter) {
|
||||||
|
return apiService.filter(product_id, productVariationFilter.getFilters());
|
||||||
|
}
|
||||||
|
|
||||||
public Call<Variation> update(int product_id, int id, Variation variation) {
|
public Call<Variation> update(int product_id, int id, Variation variation) {
|
||||||
return apiService.update(product_id, id, variation);
|
return apiService.update(product_id, id, variation);
|
||||||
}
|
}
|
||||||
@ -41,5 +46,4 @@ public class VariationRepository extends WooRepository {
|
|||||||
return apiService.delete(product_id, id, force);
|
return apiService.delete(product_id, id, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user