| Line 6... |
Line 6... |
| 6 |
import java.util.List;
|
6 |
import java.util.List;
|
| 7 |
import java.util.Map;
|
7 |
import java.util.Map;
|
| 8 |
|
8 |
|
| 9 |
import javax.servlet.http.HttpServletRequest;
|
9 |
import javax.servlet.http.HttpServletRequest;
|
| 10 |
|
10 |
|
| - |
|
11 |
import org.apache.thrift.TException;
|
| - |
|
12 |
import org.apache.thrift.transport.TTransportException;
|
| 11 |
import org.slf4j.Logger;
|
13 |
import org.slf4j.Logger;
|
| 12 |
import org.slf4j.LoggerFactory;
|
14 |
import org.slf4j.LoggerFactory;
|
| 13 |
import org.springframework.beans.factory.annotation.Value;
|
15 |
import org.springframework.beans.factory.annotation.Value;
|
| 14 |
import org.springframework.http.HttpStatus;
|
16 |
import org.springframework.http.HttpStatus;
|
| 15 |
import org.springframework.http.MediaType;
|
17 |
import org.springframework.http.MediaType;
|
| Line 25... |
Line 27... |
| 25 |
import com.eclipsesource.json.JsonObject;
|
27 |
import com.eclipsesource.json.JsonObject;
|
| 26 |
import com.eclipsesource.json.JsonValue;
|
28 |
import com.eclipsesource.json.JsonValue;
|
| 27 |
import com.google.gson.Gson;
|
29 |
import com.google.gson.Gson;
|
| 28 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
30 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 29 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
31 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| - |
|
32 |
import com.spice.profitmandi.thrift.clients.CatalogClient;
|
| 30 |
import com.spice.profitmandi.web.client.RestClient;
|
33 |
import com.spice.profitmandi.web.client.RestClient;
|
| 31 |
import com.spice.profitmandi.web.enumuration.SchemeType;
|
34 |
import com.spice.profitmandi.web.enumuration.SchemeType;
|
| 32 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
35 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
| 33 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
36 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
| 34 |
import com.spice.profitmandi.web.res.DealObjectResponse;
|
37 |
import com.spice.profitmandi.web.res.DealObjectResponse;
|
| 35 |
import com.spice.profitmandi.web.res.DealsResponse;
|
38 |
import com.spice.profitmandi.web.res.DealsResponse;
|
| 36 |
import com.spice.profitmandi.web.res.EntityResponse;
|
- |
|
| 37 |
|
39 |
|
| - |
|
40 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
| - |
|
41 |
import in.shop2020.model.v1.catalog.Item;
|
| 38 |
import io.swagger.annotations.ApiImplicitParam;
|
42 |
import io.swagger.annotations.ApiImplicitParam;
|
| 39 |
import io.swagger.annotations.ApiImplicitParams;
|
43 |
import io.swagger.annotations.ApiImplicitParams;
|
| 40 |
import io.swagger.annotations.ApiOperation;
|
44 |
import io.swagger.annotations.ApiOperation;
|
| 41 |
|
45 |
|
| 42 |
@Controller
|
46 |
@Controller
|
| Line 85... |
Line 89... |
| 85 |
}
|
89 |
}
|
| 86 |
if (innerObject.size() > 0){
|
90 |
if (innerObject.size() > 0){
|
| 87 |
responseObject.add(innerObject);
|
91 |
responseObject.add(innerObject);
|
| 88 |
}
|
92 |
}
|
| 89 |
}
|
93 |
}
|
| - |
|
94 |
try {
|
| - |
|
95 |
CatalogClient cc = new CatalogClient();
|
| - |
|
96 |
Item item = cc.getClient().getItem(26328);
|
| - |
|
97 |
logger.info("Thrift item "+item.toString());
|
| - |
|
98 |
} catch (CatalogServiceException | TException e) {
|
| - |
|
99 |
// TODO Auto-generated catch block
|
| - |
|
100 |
e.printStackTrace();
|
| - |
|
101 |
}
|
| - |
|
102 |
|
| 90 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, responseObject);
|
103 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, responseObject);
|
| 91 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
|
104 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
|
| 92 |
}
|
105 |
}
|
| 93 |
|
106 |
|
| 94 |
private Object toObject(JsonObject jsonObject){
|
107 |
private Object toObject(JsonObject jsonObject){
|