Commit 8144ed99 authored by Akhmad Fakhoni Listiyan Dede's avatar Akhmad Fakhoni Listiyan Dede
Browse files

isExist(offer_token)

parent 1caf66e3
......@@ -95,7 +95,9 @@ public class Database {
// System.out.println(saveOfferToTradeBox("553b6adc3c892b2edffa877c", 4, 1, 5, 3));
// getTradebox("553b64d23c892b2d5b772c74");
changeLocalTradeboxToFalse("553c36143c892b1bbf7723d6");
// changeLocalTradeboxToFalse("553c36143c892b1bbf7723d6");
System.out.println(isExist("sijc"));
}
/**
......@@ -504,6 +506,20 @@ public class Database {
}
}
public static boolean isExist(String offer_token)
{
MongoCollection<Document> collection = database.getCollection("tradebox");
try{
Document offerDoc = collection.find(eq("_id", new ObjectId(offer_token))).first();
return offerDoc != null;
}
catch(Exception ex)
{
return false;
}
}
/**
* Dipanggil oleh acceptAcceptFromAnotherServer
* @param offer_token
......
Supports Markdown
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