私は電子商取引のアンドロイドアプリを開発中です。私は複数のフィルタに基づいてアンドロイドのためのdreamfactory APIを使用してレコードを取得しようとしています。私はクラスの外に構築され、パラメータとして提供されているフィルタを使用していたdreamfactory:複数のフィルタでレコードを照会する
public class GetProductsBySubCatIdTask extends BaseAsyncRequest {
Context context;
public Products productsRec;
int subCatId;
String sort_str,fltr_str;
public GetProductsBySubCatIdTask(Context context, int subCataId, String sort_str, String fltr_str){
this.context = context;
this.subCatId = subCataId;
this.sort_str = sort_str;
this.fltr_str = fltr_str;
}
@Override
protected void doSetup() throws ApiException, JSONException {
callerName = "getProductsBySubCatId";
serviceName = AppConstants.DB_SVC;
endPoint = "product";
verb = "GET";
// filter to only select the contacts in this group
if(!TextUtils.isEmpty(fltr_str)){
fltr_str = "&&" + fltr_str;
}
else{
fltr_str = "";
}
queryParams = new HashMap<>();
queryParams.put("filter", "sub_category_id=" + subCatId + fltr_str);
queryParams.put("order", sort_str);
applicationApiKey = AppConstants.API_KEY;
sessionToken = PrefUtil.getString(context, AppConstants.SESSION_TOKEN);
}
@Override
protected void processResponse(String response) throws ApiException, JSONException {
//Log.d("Tang Ho"," >>>>> " + response);
productsRec =
(Products) ApiInvoker.deserialize(response, "", Products.class);
}
@Override
protected void onCompletion(boolean success) {
if(success && productsRec != null && productsRec.products.size() > 0){
Log.d("Tang Ho"," >>>>> Success");
}
}
}
GetProductsBySubCatIdTaskとして名前AsyncTaskを使って
、可能なフィルタを使用することができます
unit_offerprice < unit_mrp<br>
unit_offerprice = unit_mrp<br>
(unit_offerprice > 200) && (unit_offerprice > 500)<br>
unit_offerprice > 100<br>
unit_offerprice < 600<br>
上記のすべてのフィルタであります単独または2または3の組み合わせで
unit_offerprice < unit_mrp && unit_offerprice > 100
unit_offerprice%3Cunit_mrp
ない望ましい結果を得ることができような文字列内のシンボルを脱出した後、 はドキュメンテーションで検索が、見つかった正確な事をdin't。
これにはどのような解決方法がありますか?