| Line 6... |
Line 6... |
| 6 |
|
6 |
|
| 7 |
import javax.servlet.http.HttpServletRequest;
|
7 |
import javax.servlet.http.HttpServletRequest;
|
| 8 |
|
8 |
|
| 9 |
import org.slf4j.Logger;
|
9 |
import org.slf4j.Logger;
|
| 10 |
import org.slf4j.LoggerFactory;
|
10 |
import org.slf4j.LoggerFactory;
|
| - |
|
11 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 11 |
import org.springframework.beans.factory.annotation.Value;
|
12 |
import org.springframework.beans.factory.annotation.Value;
|
| 12 |
import org.springframework.http.HttpStatus;
|
13 |
import org.springframework.http.HttpStatus;
|
| 13 |
import org.springframework.http.MediaType;
|
14 |
import org.springframework.http.MediaType;
|
| 14 |
import org.springframework.http.ResponseEntity;
|
15 |
import org.springframework.http.ResponseEntity;
|
| 15 |
import org.springframework.stereotype.Controller;
|
16 |
import org.springframework.stereotype.Controller;
|
| Line 22... |
Line 23... |
| 22 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
23 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 23 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
24 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 24 |
import com.spice.profitmandi.common.model.ProfitMandiResponse;
|
25 |
import com.spice.profitmandi.common.model.ProfitMandiResponse;
|
| 25 |
import com.spice.profitmandi.common.model.ResponseStatus;
|
26 |
import com.spice.profitmandi.common.model.ResponseStatus;
|
| 26 |
import com.spice.profitmandi.common.web.client.RestClient;
|
27 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| - |
|
28 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 27 |
import com.spice.profitmandi.web.res.EntityResponse;
|
29 |
import com.spice.profitmandi.web.res.EntityResponse;
|
| 28 |
|
30 |
|
| 29 |
import io.swagger.annotations.ApiImplicitParam;
|
31 |
import io.swagger.annotations.ApiImplicitParam;
|
| 30 |
import io.swagger.annotations.ApiImplicitParams;
|
32 |
import io.swagger.annotations.ApiImplicitParams;
|
| 31 |
import io.swagger.annotations.ApiOperation;
|
33 |
import io.swagger.annotations.ApiOperation;
|
| Line 40... |
Line 42... |
| 40 |
@Value("${saholic.api.port}")
|
42 |
@Value("${saholic.api.port}")
|
| 41 |
private int port;
|
43 |
private int port;
|
| 42 |
@Value("${saholic.api.webapp}")
|
44 |
@Value("${saholic.api.webapp}")
|
| 43 |
private String webapp;
|
45 |
private String webapp;
|
| 44 |
|
46 |
|
| - |
|
47 |
@Autowired
|
| - |
|
48 |
ResponseSender<?> responseSender;
|
| - |
|
49 |
|
| 45 |
@RequestMapping(value = ProfitMandiConstants.URL_ENTITY, method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
50 |
@RequestMapping(value = ProfitMandiConstants.URL_ENTITY, method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
| 46 |
@ApiImplicitParams({
|
51 |
@ApiImplicitParams({
|
| 47 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
52 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
| 48 |
required = true, dataType = "string", paramType = "header")
|
53 |
required = true, dataType = "string", paramType = "header")
|
| 49 |
})
|
54 |
})
|
| Line 63... |
Line 68... |
| 63 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, entityResponse);
|
68 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, entityResponse);
|
| 64 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|
69 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|
| 65 |
}
|
70 |
}
|
| 66 |
Gson gson = new Gson();
|
71 |
Gson gson = new Gson();
|
| 67 |
entityResponse = gson.fromJson(response, EntityResponse.class);
|
72 |
entityResponse = gson.fromJson(response, EntityResponse.class);
|
| 68 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, entityResponse);
|
- |
|
| 69 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
|
73 |
return responseSender.ok(entityResponse);
|
| 70 |
}
|
74 |
}
|
| 71 |
|
75 |
|
| 72 |
|
76 |
|
| 73 |
|
77 |
|
| 74 |
|
78 |
|