-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarketItem.java
More file actions
48 lines (41 loc) · 1.75 KB
/
MarketItem.java
File metadata and controls
48 lines (41 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package examples.market;
// java examples/market/MarketItem.java YOUR_TOKEN ITEM_ID
//
// Работа с конкретным аккаунтом на маркете.
import com.lolzteam.LolzteamClient;
import com.lolzteam.models.*;
public class MarketItem {
public static void main(String[] args) throws Exception {
String token = args[0];
long itemId = Long.parseLong(args[1]);
LolzteamClient client = LolzteamClient.create(token);
// Получить информацию об аккаунте
System.out.println("--- item #" + itemId + " ---");
try {
ManagingGetResponse resp = client.market().managingGet(itemId, null);
Item item = resp.getItem();
System.out.println("title: " + item.getTitle());
System.out.println("price: " + item.getPrice());
System.out.println("category: " + item.getCategoryId());
} catch (Exception e) {
System.err.println(" err: " + e.getMessage());
}
// AI-оценка цены
System.out.println("\n--- AI price ---");
try {
ManagingAIPriceResponse resp = client.market().managingAIPrice(itemId);
System.out.println("ai price: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
// Проверить гарантию
System.out.println("\n--- guarantee check ---");
try {
ManagingCheckGuaranteeResponse resp = client.market().managingCheckGuarantee(itemId);
System.out.println("guarantee: " + resp);
} catch (Exception e) {
System.err.println(" skip: " + e.getMessage());
}
System.out.println("\ndone");
}
}