|
@@ -48,6 +48,8 @@ public class FaceppClient {
|
|
|
|
|
|
private static String apiSecret;
|
|
private static String apiSecret;
|
|
|
|
|
|
|
|
+ private static String compareUrl = "https://api-cn.faceplusplus.com/facepp/v3/compare";
|
|
|
|
+
|
|
private FaceppClient() {
|
|
private FaceppClient() {
|
|
}
|
|
}
|
|
|
|
|
|
@@ -102,7 +104,10 @@ public class FaceppClient {
|
|
*/
|
|
*/
|
|
public JsonHttpResponseHolder compareWithTokenAndImageUrl(String faceToken, String imageUrl) {
|
|
public JsonHttpResponseHolder compareWithTokenAndImageUrl(String faceToken, String imageUrl) {
|
|
|
|
|
|
- String url = "https://api-cn.faceplusplus.com/facepp/v3/compare";
|
|
|
|
|
|
+ String url = System.getProperty("facepp.compare.url");
|
|
|
|
+ if (StringUtils.isBlank(url)) {
|
|
|
|
+ url = compareUrl;
|
|
|
|
+ }
|
|
|
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
HttpPost httpPost = new HttpPost(url);
|
|
httpPost.setConfig(FaceppClient.requestConfig);
|
|
httpPost.setConfig(FaceppClient.requestConfig);
|
|
@@ -231,7 +236,10 @@ public class FaceppClient {
|
|
*/
|
|
*/
|
|
public JsonHttpResponseHolder compareWithTokenAndBase64(String faceToken, String imageBase64) {
|
|
public JsonHttpResponseHolder compareWithTokenAndBase64(String faceToken, String imageBase64) {
|
|
|
|
|
|
- String url = "https://api-cn.faceplusplus.com/facepp/v3/compare";
|
|
|
|
|
|
+ String url = System.getProperty("facepp.compare.url");
|
|
|
|
+ if (StringUtils.isBlank(url)) {
|
|
|
|
+ url = compareUrl;
|
|
|
|
+ }
|
|
|
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
HttpPost httpPost = new HttpPost(url);
|
|
httpPost.setConfig(FaceppClient.requestConfig);
|
|
httpPost.setConfig(FaceppClient.requestConfig);
|