|
@@ -23,6 +23,7 @@ import java.net.URLEncoder;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Optional;
|
|
import java.util.ResourceBundle;
|
|
import java.util.ResourceBundle;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -194,10 +195,9 @@ public class HttpClientUtil {
|
|
public static Object fgwPostRequest(String s, Object jsonBody,String type) {
|
|
public static Object fgwPostRequest(String s, Object jsonBody,String type) {
|
|
ResourceBundle resourceBundle = ResourceBundle.getBundle("config");
|
|
ResourceBundle resourceBundle = ResourceBundle.getBundle("config");
|
|
String inUrl = resourceBundle.getString("app.fgw.in.url");
|
|
String inUrl = resourceBundle.getString("app.fgw.in.url");
|
|
- if (ResponseRows.COMMONMESSAGE.getType().equals(type)){
|
|
|
|
- return sendPostRequestPage(inUrl + s, jsonBody,null);
|
|
|
|
- }else{
|
|
|
|
- return sendPostRequest(inUrl + s, jsonBody);
|
|
|
|
- }
|
|
|
|
|
|
+ return Optional.of(type)
|
|
|
|
+ .filter(ResponseRows.COMMONMESSAGE.getType()::equals)
|
|
|
|
+ .map(t -> sendPostRequestPage(inUrl + s, jsonBody, null))
|
|
|
|
+ .orElseGet(() -> sendPostRequest(inUrl + s, jsonBody));
|
|
}
|
|
}
|
|
}
|
|
}
|