Subversion Repositories SmartDukaan

Rev

Rev 22139 | Rev 22351 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22139 Rev 22215
Line 1... Line 1...
1
package com.spice.profitmandi.common.util;
1
package com.spice.profitmandi.common.util;
2
 
2
 
3
import com.spice.profitmandi.common.enumuration.SchemeType;
-
 
4
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
-
 
5
import com.spice.profitmandi.common.web.client.RestClient;
-
 
6
import com.spice.profitmandi.thrift.clients.TransactionClient;
-
 
7
import com.spice.profitmandi.thrift.clients.config.ConfigClient;
-
 
8
 
-
 
9
import in.shop2020.model.v1.order.RechargeOrderStatus;
-
 
10
import in.shop2020.model.v1.order.RechargePlan;
-
 
11
import in.shop2020.model.v1.order.RechargeType;
-
 
12
import in.shop2020.model.v1.order.TransactionService.Client;
-
 
13
import java.io.File;
3
import java.io.File;
14
import java.io.IOException;
4
import java.io.IOException;
15
import java.io.InputStream;
5
import java.io.InputStream;
16
import java.io.PrintStream;
-
 
17
import java.net.URI;
-
 
18
import java.net.URISyntaxException;
6
import java.net.URISyntaxException;
19
import java.net.URL;
7
import java.net.URL;
20
import java.util.ArrayList;
8
import java.util.ArrayList;
21
import java.util.Collections;
9
import java.util.Collections;
22
import java.util.HashMap;
10
import java.util.HashMap;
23
import java.util.List;
11
import java.util.List;
24
import java.util.Map;
12
import java.util.Map;
25
import java.util.Set;
-
 
26
 
13
 
27
import org.apache.commons.io.FileUtils;
14
import org.apache.commons.io.FileUtils;
28
import org.apache.commons.io.IOUtils;
15
import org.apache.commons.io.IOUtils;
29
import org.apache.http.client.utils.URIBuilder;
16
import org.apache.http.client.utils.URIBuilder;
30
import org.json.JSONObject;
17
import org.json.JSONObject;
31
import org.slf4j.Logger;
18
import org.slf4j.Logger;
32
import org.slf4j.LoggerFactory;
19
import org.slf4j.LoggerFactory;
33
import org.springframework.beans.factory.annotation.Value;
20
import org.springframework.http.HttpHeaders;
-
 
21
import org.springframework.http.MediaType;
34
 
22
 
-
 
23
import com.spice.profitmandi.common.enumuration.SchemeType;
-
 
24
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
35
import com.spice.profitmandi.common.model.GstRate;
25
import com.spice.profitmandi.common.model.GstRate;
-
 
26
import com.spice.profitmandi.common.web.client.RestClient;
36
import com.spice.profitmandi.thrift.clients.CatalogClient;
27
import com.spice.profitmandi.thrift.clients.CatalogClient;
37
import com.spice.profitmandi.thrift.clients.InventoryClient;
28
import com.spice.profitmandi.thrift.clients.InventoryClient;
38
import com.spice.profitmandi.thrift.clients.TransactionClient;
29
import com.spice.profitmandi.thrift.clients.TransactionClient;
39
import com.spice.profitmandi.thrift.clients.config.ConfigClient;
30
import com.spice.profitmandi.thrift.clients.config.ConfigClient;
40
 
31
 
Line 233... Line 224...
233
	public static String getIconUrl(int entityId,String host, int port, String webapp){
224
	public static String getIconUrl(int entityId,String host, int port, String webapp){
234
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
225
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
235
		Map<String, String> params = new HashMap<String, String>();
226
		Map<String, String> params = new HashMap<String, String>();
236
		String response = null;
227
		String response = null;
237
		String uri = webapp+"/entity/"+entityId;
228
		String uri = webapp+"/entity/"+entityId;
-
 
229
		Map<String, String> headers = new HashMap<>(1);
-
 
230
		headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
238
		try {
231
		try {
239
			response = rc.get(uri, params);
232
			response = rc.get(uri, params, headers);
240
		} catch (ProfitMandiBusinessException e) {
233
		} catch (ProfitMandiBusinessException e) {
241
			// TODO Auto-generated catch block
234
			// TODO Auto-generated catch block
242
			e.printStackTrace();
235
			e.printStackTrace();
243
			return "";
236
			return "";
244
		}
237
		}