CardInfoHttpClient.java
1.49 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 com.diligrp.cashier.mall.client;
import com.diligrp.cashier.mall.util.HttpClientUtils;
import com.diligrp.cashier.shared.util.JsonUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author lvqi
*/
public class CardInfoHttpClient {
public static Object getCardPayInfo(String urlPrefix, List<Long> accountIds) {
Map<String, Object> params = new HashMap<>();
params.put("accountIds", accountIds);
Map<String, Object> map = HttpClientUtils.postJson(
urlPrefix + "/cashier/query/accountListWithOutAuth",
params,
null,
new TypeReference<>() {
},
""
);
if (map != null && map.get("code").equals("200")) {
return map.get("data");
}
return null;
}
public static Map<String, Object> getCardCustomerInfo(String urlPrefix, Long marketId, Long id) {
Map<String, Object> params = new HashMap<>();
params.put("marketId", marketId);
params.put("id", id);
Map<String, Object> map = HttpClientUtils.postJson(urlPrefix + "/cashier/query/customerInfo", params, null, new TypeReference<>() {
}, "");
if (map != null && map.get("code").equals("200")) {
return JsonUtils.fromJsonString(JsonUtils.toJsonString(map.get("data")), new TypeReference<>() {
});
}
return null;
}
}