Skip to content

Commit

Permalink
source clean
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Jan 10, 2024
1 parent 48f09e9 commit b7ae3e5
Showing 1 changed file with 5 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ public static void main(String[] args) throws IOException {
MTGControler.getInstance().loadAccountsConfiguration();

var cscart = new CsCartExternalShop();



var ret = cscart.getTransactionById(1L);

System.out.println(ret.getDateCreation());
cscart.getTransactionById(1L);

System.exit(0);
}
Expand Down Expand Up @@ -90,9 +86,7 @@ public List<Contact> listContacts() throws IOException {
var list = new ArrayList<Contact>();
var ret = getBuilder(API_USERS,METHOD.GET).addContent("user_type", CONTACT_TYPE).toJson();

ret.getAsJsonObject().get("users").getAsJsonArray().forEach(je->{
list.add(buildContact(je.getAsJsonObject()));
});
ret.getAsJsonObject().get("users").getAsJsonArray().forEach(je->list.add(buildContact(je.getAsJsonObject())));
return list;
}

Expand All @@ -119,9 +113,7 @@ public List<MTGProduct> listProducts(String name) throws IOException {

var ret = build.toJson();

ret.getAsJsonObject().get("products").getAsJsonArray().forEach(je->{
list.add(buildProduct(je.getAsJsonObject()));
});
ret.getAsJsonObject().get("products").getAsJsonArray().forEach(je->list.add(buildProduct(je.getAsJsonObject())));

return list;
}
Expand All @@ -136,11 +128,7 @@ public Transaction getTransactionById(Long id) throws IOException {
protected List<Transaction> loadTransaction() throws IOException {
var list = new ArrayList<Transaction>();
var ret = getBuilder(API_ORDERS,METHOD.GET).toJson();

ret.getAsJsonObject().get("orders").getAsJsonArray().forEach(je->{
list.add(buildTransaction(je.getAsJsonObject()));
});

ret.getAsJsonObject().get("orders").getAsJsonArray().forEach(je->list.add(buildTransaction(je.getAsJsonObject())));
return list;
}

Expand All @@ -149,11 +137,7 @@ protected List<Transaction> loadTransaction() throws IOException {
public List<Transaction> listTransactions(Contact c) throws IOException {
var list = new ArrayList<Transaction>();
var ret = getBuilder(API_ORDERS,METHOD.GET).addContent("user_id", String.valueOf(c.getId())).toJson();

ret.getAsJsonObject().get("orders").getAsJsonArray().forEach(je->{
list.add(buildTransaction(je.getAsJsonObject()));
});

ret.getAsJsonObject().get("orders").getAsJsonArray().forEach(je->list.add(buildTransaction(je.getAsJsonObject())));
return list;
}

Expand Down

0 comments on commit b7ae3e5

Please sign in to comment.