entry : paramMap.entrySet()) {
+ stringBuilder.append(entry.getKey()).append("=").append(entry.getValue());
+ index++;
+ if (index != parameters.size()) {
+ stringBuilder.append("&");
+ }
+ }
+ return stringBuilder.toString();
+ }
+
+}
+
diff --git a/src/com/fasc/open/api/utils/crypt/HashFile.java b/src/com/fasc/open/api/utils/crypt/HashFile.java
new file mode 100644
index 0000000..5c18466
--- /dev/null
+++ b/src/com/fasc/open/api/utils/crypt/HashFile.java
@@ -0,0 +1,169 @@
+/**
+ * 包名:com.yq365.utils.crypt
+ * 文件名:com.yq365.utils.crypt
+ * 创建者:zyb
+ * 创建日:2015-3-9
+ *
+ * CopyRight 2015 ShenZhen Fabigbig Technology Co.Ltd All Rights Reserved
+ */
+package com.fasc.open.api.utils.crypt;
+
+import com.fasc.open.api.exception.ApiException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.MessageDigest;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class HashFile {
+ private static Logger log = LoggerFactory.getLogger(HashFile.class);
+ private static char[] hexChar = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
+ private HashFile() {
+ }
+
+ /**
+ * @param filename 文件名称
+ * @return 文件名称md值
+ * @throws ApiException 异常
+ */
+ public static String getFileMd5(String filename) throws ApiException {
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(filename);
+ return getHash(fis, "MD5");
+ } catch (Exception e) {
+ log.error("文件名MD5失败:{}", e.getMessage(), e);
+ throw new ApiException("文件名MD5失败");
+ } finally {
+ if(fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ log.error("文件流关闭异常 {}", e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param file 对象
+ * @return 文件名称md值
+ * @throws ApiException 异常
+ */
+ public static String getFileMd5(File file) throws ApiException {
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(file);
+ return getHash(fis, "MD5");
+ } catch (Exception e) {
+ log.error("文件MD5失败:{}", e.getMessage(), e);
+ throw new ApiException("文件MD5失败");
+ } finally {
+ if(fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ log.error("文件流关闭异常 {}", e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ public static String getFileMd5(FileInputStream fis) throws ApiException {
+ return getHash(fis, "MD5");
+ }
+
+ public static String getFileMd5(byte[] dataBytes) throws ApiException {
+ return getHash(dataBytes, "MD5");
+ }
+
+ public static String getFileSha256(String filename) throws ApiException {
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(filename);
+ return getHash(fis, "SHA-256");
+ } catch (Exception e) {
+ log.error("文件名称SHA256失败:{}", e.getMessage(), e);
+ throw new ApiException("文件名称SHA256失败");
+ } finally {
+ if(fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ log.error("文件流关闭异常 {}", e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ public static String getFileSha256(File file) throws ApiException {
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(file);
+ return getHash(fis, "SHA-256");
+ } catch (Exception e) {
+ log.error("文件SHA256失败:{}", e.getMessage(), e);
+ throw new ApiException("文件SHA256失败");
+ } finally {
+ if(fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ log.error("文件流关闭异常 {}", e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ public static String getFileSha256(FileInputStream fis) throws ApiException {
+ return getHash(fis, "SHA-256");
+ }
+
+ public static String getFileSha256(byte[] dataBytes) throws ApiException {
+ return getHash(dataBytes, "SHA-256");
+ }
+
+ private static String getHash(InputStream inputStream, String hashType) throws ApiException {
+ MessageDigest messageDigest = null;
+ try {
+ byte[] buffer = new byte[1024];
+ messageDigest = MessageDigest.getInstance(hashType);
+ int numRead;
+ while ((numRead = inputStream.read(buffer)) > 0) {
+ messageDigest.update(buffer, 0, numRead);
+ }
+ return toHexString(messageDigest.digest());
+ } catch (Exception e) {
+ log.error("输入流获取Hash值失败:{}", e.getMessage(), e);
+ throw new ApiException("输入流获取Hash值失败");
+ }
+ }
+
+ private static String getHash(byte[] dataBytes, String hashType) throws ApiException {
+ MessageDigest messageDigest = null;
+ try {
+ messageDigest = MessageDigest.getInstance(hashType);
+ return toHexString(messageDigest.digest(dataBytes));
+ } catch (Exception e) {
+ log.error("字节数据获取Hash值失败:{}", e.getMessage(), e);
+ throw new ApiException("字节数据获取Hash值失败");
+ }
+ }
+
+ private static String toHexString(byte[] b) {
+ StringBuilder sb = new StringBuilder(b.length * 2);
+ for (int i = 0; i < b.length; i++) {
+ sb.append(hexChar[((b[i] & 0xF0) >>> 4)]);
+ sb.append(hexChar[(b[i] & 0xF)]);
+ }
+ return sb.toString();
+ }
+}
\ No newline at end of file
diff --git a/src/com/fasc/open/api/utils/date/DateUtil.java b/src/com/fasc/open/api/utils/date/DateUtil.java
new file mode 100644
index 0000000..5913911
--- /dev/null
+++ b/src/com/fasc/open/api/utils/date/DateUtil.java
@@ -0,0 +1,262 @@
+package com.fasc.open.api.utils.date;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Timestamp;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class DateUtil {
+ private static final Logger log = LoggerFactory.getLogger(DateUtil.class);
+
+ private DateUtil() {
+ }
+
+
+ /**
+ * @param dateStr 待转换的时间String
+ * @param pattern 转换的类型
+ * @return 字符串转换成Date类型数据
+ */
+ public static Date convertStringToDate(String dateStr, String pattern) {
+ if (dateStr == null) {
+ return null;
+ }
+ SimpleDateFormat sdf = new SimpleDateFormat(pattern);
+ Date date = null;
+ try {
+ date = sdf.parse(dateStr);
+ } catch (ParseException e) {
+ log.error("将指定格式的时间String转为Date类型发生异常", e);
+ }
+ return date;
+ }
+
+ /**
+ * 实例SimpleDateFormat
+ *
+ * @param formatNum 1 yyyyMMdd
+ * 2 yyyy/MM/dd
+ * 3 yyyy-MM-dd
+ * 4 yyyy-MM-dd HH:mm:ss
+ * 5 yyyyMMddHHmmss
+ * 6 yyyy-MM-dd HH:mm:ss.sss
+ * 7 HH:mm
+ * 8 yyyy年MM月dd日
+ * 9 yyyyMMddHHmmssSSS
+ * 10 yyyy年MM月dd日 HH:mm
+ * 11 yyyy-MM-dd HH
+ * 12 HH:mm:ss
+ * 13 yyyy/MM/dd HH:mm:ss
+ * 14 yyyy-MM-dd'T'HH:mm:ss+08:00
+ * 15 yyyy-MM-dd HH:mm
+ * 16 yyyyMM
+ * 17 yyyy年MM月dd日hh时mm分
+ * 18 yyyy/MM/ddHH:mm:ss
+ * @return
+ */
+ private static SimpleDateFormat dateFormat(int formatNum) {
+ SimpleDateFormat dateFormatter = null;
+ switch (formatNum) {
+ case 1:
+ dateFormatter = new SimpleDateFormat("yyyyMMdd");
+ break;
+ case 2:
+ dateFormatter = new SimpleDateFormat("yyyy/MM/dd");
+ break;
+ case 3:
+ dateFormatter = new SimpleDateFormat("yyyy-MM-dd");
+ break;
+ case 4:
+ dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ break;
+ case 5:
+ dateFormatter = new SimpleDateFormat("yyyyMMddHHmmss");
+ break;
+ case 6:
+ dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss");
+ break;
+ case 7:
+ dateFormatter = new SimpleDateFormat("HH:mm");
+ break;
+ case 8:
+ dateFormatter = new SimpleDateFormat("yyyy年MM月dd日");
+ break;
+ case 9:
+ dateFormatter = new SimpleDateFormat("yyyyMMddHHmmssSSS");
+ break;
+ case 10:
+ dateFormatter = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
+ break;
+ case 11:
+ dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH");
+ break;
+ case 12:
+ dateFormatter = new SimpleDateFormat("HH:mm:ss");
+ break;
+ case 13:
+ dateFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+ break;
+ case 14:
+ dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+08:00");
+ break;
+ case 15:
+ dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+ break;
+ case 16:
+ dateFormatter = new SimpleDateFormat("yyyyMM");
+ break;
+ case 17:
+ dateFormatter = new SimpleDateFormat("yyyy年MM月dd日HH时mm分");
+ break;
+ case 18:
+ dateFormatter = new SimpleDateFormat("yyyy/MM/ddHH:mm:ss");
+ break;
+ default:
+ dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+ break;
+ }
+ return dateFormatter;
+ }
+
+ /**
+ * 把string类型的日期转化为相应的格式
+ *
+ * @param dateString 字符串日期
+ * @param formatNum 需要按照哪种类型
+ * 1 yyyyMMdd
+ * 2 yyyy/MM/dd
+ * 3 yyyy-MM-dd
+ * 4 yyyy-MM-dd HH:mm:ss
+ * 5 yyyyMMddHHmmss
+ * 6 yyyy-MM-dd HH:mm:ss.sss
+ * 7 HH:mm
+ * 8 yyyy年MM月dd日
+ * 9 yyyyMMddHHmmssSSS
+ * 10 yyyy年MM月dd日 HH:mm
+ * 11 yyyy-MM-dd HH
+ * 12 HH:mm:ss
+ * 13 yyyy/MM/dd HH:mm:ss
+ * 14 yyyy-MM-dd'T'HH:mm:ss+08:00
+ * 15 yyyy-MM-dd HH:mm
+ * 16 yyyyMM
+ * 17 yyyy年MM月dd日hh时mm分
+ * 18 yyyy/MM/ddHH:mm:ss
+ * @return 日期
+ */
+ public static Date stringToDate(String dateString, int formatNum) {
+ if (dateString == null || dateString.length() == 0) {
+ throw new IllegalArgumentException("日期字符串为空");
+ }
+ try {
+ return dateFormat(formatNum).parse(dateString);
+ } catch (Exception e) {
+ log.error("把string类型的日期转化为相应的格式发生异常", e);
+ return null;
+ }
+ }
+
+ /**
+ * @param dateString 字符串日期
+ * @param formatNum 需要按照哪种类型
+ * 1 yyyyMMdd
+ * 2 yyyy/MM/dd
+ * 3 yyyy-MM-dd
+ * 4 yyyy-MM-dd HH:mm:ss
+ * 5 yyyyMMddHHmmss
+ * 6 yyyy-MM-dd HH:mm:ss.sss
+ * 7 HH:mm
+ * 8 yyyy年MM月dd日
+ * 9 yyyyMMddHHmmssSSS
+ * 10 yyyy年MM月dd日 HH:mm
+ * 11 yyyy-MM-dd HH
+ * 12 HH:mm:ss
+ * 13 yyyy/MM/dd HH:mm:ss
+ * 14 yyyy-MM-dd'T'HH:mm:ss+08:00
+ * 15 yyyy-MM-dd HH:mm
+ * 16 yyyyMM
+ * 17 yyyy年MM月dd日hh时mm分
+ * 18 yyyy/MM/ddHH:mm:ss
+ * @return 时间戳
+ */
+ public static Timestamp stringToTimestamp(String dateString, int formatNum) {
+ if (dateString == null || dateString.length() == 0) {
+ throw new IllegalArgumentException("日期字符串为空");
+ }
+ Date date = stringToDate(dateString, formatNum);
+ if (date != null) {
+ return new Timestamp(date.getTime());
+ }
+ return null;
+ }
+
+ /**
+ * @param time 字符串日期
+ * @param formatNum 需要按照哪种类型
+ * 1 yyyyMMdd
+ * 2 yyyy/MM/dd
+ * 3 yyyy-MM-dd
+ * 4 yyyy-MM-dd HH:mm:ss
+ * 5 yyyyMMddHHmmss
+ * 6 yyyy-MM-dd HH:mm:ss.sss
+ * 7 HH:mm
+ * 8 yyyy年MM月dd日
+ * 9 yyyyMMddHHmmssSSS
+ * 10 yyyy年MM月dd日 HH:mm
+ * 11 yyyy-MM-dd HH
+ * 12 HH:mm:ss
+ * 13 yyyy/MM/dd HH:mm:ss
+ * 14 yyyy-MM-dd'T'HH:mm:ss+08:00
+ * 15 yyyy-MM-dd HH:mm
+ * 16 yyyyMM
+ * 17 yyyy年MM月dd日hh时mm分
+ * 18 yyyy/MM/ddHH:mm:ss
+ * @return 字符串
+ */
+ public static String timestamp2String(Timestamp time, int formatNum) {
+ if (time != null) {
+ Date date = time;
+ return dateToString(date, formatNum);
+ }
+ return null;
+ }
+
+ /**
+ * 把string类型的日期转化为相应的格式
+ *
+ * @param date 字符串日期
+ * @param formatNum 1 yyyyMMdd
+ * 2 yyyy/MM/dd
+ * 3 yyyy-MM-dd
+ * 4 yyyy-MM-dd HH:mm:ss
+ * 5 yyyyMMddHHmmss
+ * 6 yyyy-MM-dd HH:mm:ss.sss
+ * 7 HH:mm
+ * 8 yyyy年MM月dd日
+ * 9 yyyyMMddHHmmssSSS
+ * 10 yyyy年MM月dd日 HH:mm
+ * 11 yyyy-MM-dd HH
+ * 12 HH:mm:ss
+ * 14 yyyy-MM-ddTHH:mm:ss+08:00
+ * 15 yyyy-MM-dd HH:mm
+ * 16 yyyyMM
+ * 17 yyyy年MM月dd日hh时mm分
+ * 18 yyyy/MM/ddHH:mm:ss
+ * @return 日期字符串
+ */
+ public static String dateToString(Date date, int formatNum) {
+ String str = null;
+ if (date != null) {
+ str = dateFormat(formatNum).format(date);
+ }
+ return str;
+ }
+
+}
diff --git a/src/com/fasc/open/api/utils/file/FileUtil.java b/src/com/fasc/open/api/utils/file/FileUtil.java
new file mode 100644
index 0000000..c72b206
--- /dev/null
+++ b/src/com/fasc/open/api/utils/file/FileUtil.java
@@ -0,0 +1,59 @@
+package com.fasc.open.api.utils.file;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class FileUtil {
+ private FileUtil() {
+ }
+
+ private static final Logger log = LoggerFactory.getLogger(FileUtil.class);
+
+ /**
+ * 文件写入
+ *
+ * @param fileBytes 文件字节数组
+ * @param path 文件绝对路径
+ * @param fileName 文件名称
+ */
+ public static void fileSink(byte[] fileBytes, String path, String fileName) {
+ File f = new File(path + fileName);
+ if (f.exists()) {
+ log.warn("文件已存在:{}", f.getAbsolutePath());
+ return;
+ }
+ if (!f.getParentFile().exists()) {
+ f.getParentFile().mkdirs();
+ }
+ FileOutputStream fos = null;
+ BufferedOutputStream bw = null;
+ try {
+ fos = new FileOutputStream(f);
+ bw = new BufferedOutputStream(fos);
+ bw.write(fileBytes);
+ bw.flush();
+ } catch (Exception e) {
+ log.error("文件写入失败:{}", e.getMessage(), e);
+ } finally {
+ try {
+ if (bw != null) {
+ bw.close();
+ }
+ if (fos != null) {
+ fos.close();
+ }
+ } catch (IOException ex) {
+ log.error("文件流关闭异常:{}", ex.getMessage(), ex);
+ }
+ }
+ }
+}
diff --git a/src/com/fasc/open/api/utils/file/ZipUtil.java b/src/com/fasc/open/api/utils/file/ZipUtil.java
new file mode 100644
index 0000000..b1ea761
--- /dev/null
+++ b/src/com/fasc/open/api/utils/file/ZipUtil.java
@@ -0,0 +1,85 @@
+package com.fasc.open.api.utils.file;
+
+import java.io.*;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class ZipUtil {
+ private ZipUtil() {
+ }
+
+ /**
+ * 解压压缩文件 (返回文件名 对应bytes)(GBK编码类型)
+ *
+ * @param bytes 字节数组
+ * @return 文件名称对应字节
+ * @throws Exception 异常
+ */
+ public static Map unZipByGbk(byte[] bytes) throws Exception {
+ Map fileNameByteMap = new HashMap<>();
+ ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(bytes), Charset.forName("GBK"));
+ ZipEntry zipEntry = zipInputStream.getNextEntry();
+
+ while (zipEntry != null) {
+ if (zipEntry.isDirectory()) {
+ break;
+ } else {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ String fileName = zipEntry.getName();
+ byte[] bufferBytes = new byte[1024];
+ int len;
+ while ((len = zipInputStream.read(bufferBytes, 0, bufferBytes.length)) != -1) {
+ bos.write(bufferBytes, 0, len);
+ }
+ bos.flush();
+ bos.close();
+ zipInputStream.closeEntry();
+ fileNameByteMap.put(fileName, bos.toByteArray());
+ zipEntry = zipInputStream.getNextEntry();
+ }
+ }
+ zipInputStream.close();
+ return fileNameByteMap;
+ }
+
+
+ /**
+ * 解压到指定目录(GBK编码类型)
+ *
+ * @param bytes 字节数组
+ * @param filePath 文件绝对路径
+ * @throws Exception 异常
+ */
+ public static void unZipByGbk(byte[] bytes, String filePath) throws Exception {
+ ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(bytes), Charset.forName("GBK"));
+ ZipEntry zipEntry = zipInputStream.getNextEntry();
+
+ while (zipEntry != null) {
+ if (zipEntry.isDirectory()) {
+ continue;
+ } else {
+ String unZipFilePath = filePath + File.separator + zipEntry.getName();
+ try (BufferedOutputStream bufferedOutputStream =
+ new BufferedOutputStream(new FileOutputStream(unZipFilePath));) {
+ byte[] bufferBytes = new byte[1024];
+ int len;
+ while ((len = zipInputStream.read(bufferBytes, 0, bufferBytes.length)) != -1) {
+ bufferedOutputStream.write(bufferBytes, 0, len);
+ }
+ }
+ }
+ zipInputStream.closeEntry();
+ zipEntry = zipInputStream.getNextEntry();
+ }
+ zipInputStream.close();
+ }
+
+
+}
diff --git a/src/com/fasc/open/api/utils/http/HttpUtil.java b/src/com/fasc/open/api/utils/http/HttpUtil.java
new file mode 100644
index 0000000..3505e91
--- /dev/null
+++ b/src/com/fasc/open/api/utils/http/HttpUtil.java
@@ -0,0 +1,369 @@
+package com.fasc.open.api.utils.http;
+
+import com.fasc.open.api.bean.base.BaseResponseEntity;
+import com.fasc.open.api.bean.base.HttpInfoRes;
+import com.fasc.open.api.config.HttpConfig;
+import com.fasc.open.api.constants.RequestConstants;
+import com.fasc.open.api.exception.ApiException;
+import org.apache.http.*;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.HttpMultipartMode;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.ssl.SSLContexts;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.SSLContext;
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.SocketTimeoutException;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class HttpUtil {
+ private static Logger log = LoggerFactory.getLogger(HttpUtil.class);
+
+ private static int DEFAULT_MAX_PER_ROUTE = 350;
+
+ private static int DEFAULT_SOCKET_MAX_TOTAL = 400;
+
+ public static HttpConfig httpConfig;
+
+ private static volatile CloseableHttpClient closeableHttpClient;
+
+ private static Lock lock = new ReentrantLock();
+
+ private HttpUtil() {
+ }
+
+ private static HttpGet getHttpGet(String url, Map params, String encode) {
+ StringBuilder buf = new StringBuilder(url);
+ if (params != null) {
+ // 地址增加?或者&
+ String flag = (url.indexOf('?') == -1) ? "?" : "&";
+ // 添加参数
+ for (Entry entry : params.entrySet()) {
+ buf.append(flag);
+ buf.append(entry.getKey());
+ buf.append("=");
+ try {
+ String param = entry.getValue();
+ if (param == null) {
+ param = "";
+ }
+ buf.append(URLEncoder.encode(param, encode));
+ } catch (UnsupportedEncodingException e) {
+ log.error("URLEncoder Error,encode=" + encode + ",param=" + entry.getValue(), e);
+ }
+ flag = "&";
+
+ }
+ }
+ return new HttpGet(buf.toString());
+ }
+
+ /**
+ * 上传文件 post
+ *
+ * @param url 请求地址
+ * @param params 请求参数
+ * @param files 请求文件
+ * @return HttpPost
+ */
+ private static HttpPost getHttpPost(String url, Map params, Map files) {
+ HttpPost httpPost = new HttpPost(url);
+ MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
+ if (files != null && !files.isEmpty()) {
+ for (Entry kv : files.entrySet()) {
+ multipartEntityBuilder.addBinaryBody(kv.getKey(), kv.getValue());
+ }
+ }
+ if (params != null && !params.isEmpty()) {
+ for (Entry entry : params.entrySet()) {
+ String key = entry.getKey();
+ String value = entry.getValue();
+ multipartEntityBuilder.addTextBody(key, value, ContentType.TEXT_PLAIN.withCharset(RequestConstants.CHARSET_UTF8));
+ }
+ multipartEntityBuilder.setMode(HttpMultipartMode.RFC6532);
+ }
+ HttpEntity httpEntity = multipartEntityBuilder.build();
+ httpPost.setEntity(httpEntity);
+ return httpPost;
+ }
+
+ /**
+ * post请求
+ *
+ * @param url 请求路径
+ * @param params 请求参数
+ * @return HttpPost
+ */
+ private static HttpPost getHttpPost(String url, Map params, String charset) throws UnsupportedEncodingException {
+ HttpPost httpPost = new HttpPost(url);
+ if (params != null && !params.isEmpty()) {
+ List list = new ArrayList<>();
+ for (Entry entry : params.entrySet()) {
+ String key = entry.getKey();
+ String value = entry.getValue();
+ BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, value);
+ list.add(basicNameValuePair);
+ }
+ UrlEncodedFormEntity httpEntity = new UrlEncodedFormEntity(list, charset);
+ httpPost.setEntity(httpEntity);
+ }
+ return httpPost;
+ }
+
+ public static HttpInfoRes post(String url, Map reqHeader, Map params,
+ Map files) throws ApiException {
+ try {
+ // 初始化httpClient
+ CloseableHttpClient httpClient = getHttpClient(httpConfig);
+ // 创建http请求 设置请求参数
+ HttpPost httpPost;
+ if (files == null || files.isEmpty()) {
+ httpPost = getHttpPost(url, params, RequestConstants.CHARSET_UTF8);
+ } else {
+ httpPost = getHttpPost(url, params, files);
+ }
+ httpPost.setConfig(getRequestConfig(httpConfig));
+ return executeHttpRequest(httpClient, httpPost, reqHeader);
+ } catch (ApiException e) {
+ throw e;
+ } catch (Exception e) {
+ log.error("url=[{}] http请求失败:{}", url, e.getMessage(), e);
+ throw new ApiException("请求失败");
+ }
+ }
+
+ /**
+ * 获取client
+ *
+ * @param httpConfig http配置
+ * @return CloseableHttpClient client
+ * @throws ApiException 异常
+ */
+ public static CloseableHttpClient getHttpClient(HttpConfig httpConfig) throws ApiException {
+ if(closeableHttpClient != null) {
+ return closeableHttpClient;
+ }
+ try {
+ lock.lock();
+ if(closeableHttpClient != null) {
+ return closeableHttpClient;
+ }
+ Registry sfr = null;
+ if (httpConfig != null && Boolean.TRUE.equals(httpConfig.getProxyFlag())) {
+ sfr = RegistryBuilder.create()
+ .register("http", PlainConnectionSocketFactory.getSocketFactory())
+ .register("https",SSLConnectionSocketFactory.getSocketFactory())
+ .build();
+ } else {
+ SSLContext ctx = SSLContexts.custom().useProtocol("TLSv1.2").build();
+ SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(ctx);
+ sfr = RegistryBuilder.create()
+ .register("http", PlainConnectionSocketFactory.getSocketFactory())
+ .register("https", sslsf != null ? sslsf : SSLConnectionSocketFactory.getSocketFactory())
+ .build();
+ }
+ PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(sfr);
+ Integer defaultMaxPerRoute = DEFAULT_MAX_PER_ROUTE;
+ Integer defaultSocketMaxTotal = DEFAULT_SOCKET_MAX_TOTAL;
+ if(httpConfig != null && httpConfig.getDefaultMaxPerRoute() != null && httpConfig.getDefaultMaxPerRoute() > 0) {
+ defaultMaxPerRoute = httpConfig.getDefaultMaxPerRoute();
+ }
+ if(httpConfig != null && httpConfig.getDefaultSocketMaxTotal() != null && httpConfig.getDefaultSocketMaxTotal() > 0) {
+ defaultSocketMaxTotal = httpConfig.getDefaultSocketMaxTotal();
+ }
+ connectionManager.setDefaultMaxPerRoute(defaultMaxPerRoute);
+ connectionManager.setMaxTotal(defaultSocketMaxTotal);
+ connectionManager.setValidateAfterInactivity(3000);
+ connectionManager.closeExpiredConnections();
+ closeableHttpClient = HttpClients.custom().setConnectionManager(connectionManager).build();
+ } catch (Exception e) {
+ log.error("HttpClient生成失败:{}", e.getMessage(), e);
+ throw new ApiException("HttpClient生成失败");
+ } finally {
+ lock.unlock();
+ }
+ return closeableHttpClient;
+ }
+
+
+ public static HttpInfoRes get(String url, Map reqHeader, Map params) throws ApiException {
+ // 初始化httpClient
+ CloseableHttpClient httpClient = getHttpClient(httpConfig);
+ // 创建http请求 设置请求参数
+ HttpGet httpGet = getHttpGet(url, params, RequestConstants.CHARSET_UTF8);
+ // 设置超时时间、代理配置
+ httpGet.setConfig(getRequestConfig(httpConfig));
+ return executeHttpRequest(httpClient, httpGet, reqHeader);
+ }
+
+
+ public static HttpInfoRes executeHttpRequest(CloseableHttpClient client, HttpUriRequest request, Map reqHeader) throws ApiException {
+ CloseableHttpResponse response = null;
+ try {
+ if (reqHeader != null && !reqHeader.isEmpty()) {
+ for (Entry entry : reqHeader.entrySet()) {
+ request.addHeader(entry.getKey(), entry.getValue());
+ }
+ }
+ response = client.execute(request);
+ reqesutAndResponseLog(request, response);
+ HttpInfoRes httpInfoRes = HttpInfoRes.getInstance();
+ if (response.getEntity() != null) {
+ httpInfoRes.setBody(EntityUtils.toString(response.getEntity()));
+ }
+ httpInfoRes.setHttpStatusCode(response.getStatusLine().getStatusCode());
+ return httpInfoRes;
+ } catch (SocketTimeoutException eto) {
+ log.error("请求链接超时:{}", eto.getMessage(), eto);
+ throw new ApiException("请求超时");
+ } catch (Exception e) {
+ log.error("executeHttpRequest请求失败:{}", e.getMessage(), e);
+ throw new ApiException("请求失败");
+ } finally {
+ if (response != null) {
+ try {
+ response.close();
+ } catch (IOException e) {
+ log.error("CloseableHttpResponse关闭失败:{}", e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * 下载文件
+ *
+ * @param url 请求路径
+ * @param reqHeader 请求头
+ * @param params 请求参数
+ * @return ApiResponseEntity
+ * @throws ApiException 异常
+ */
+ public static BaseResponseEntity downLoadFiles(String url, Map reqHeader, Map params) throws ApiException {
+ BaseResponseEntity entity = new BaseResponseEntity();
+
+ CloseableHttpResponse response = null;
+ // 初始化httpClient
+ CloseableHttpClient httpClient = getHttpClient(httpConfig);
+ try {
+ // 创建http请求 设置请求参数
+ HttpPost httpPost = getHttpPost(url, params, RequestConstants.CHARSET_UTF8);
+ if (reqHeader != null) {
+ for (Entry entry : reqHeader.entrySet()) {
+ httpPost.addHeader(entry.getKey(), entry.getValue());
+ }
+ }
+ httpPost.setConfig(getRequestConfig(httpConfig));
+ response = httpClient.execute(httpPost);
+ reqesutAndResponseLog(httpPost, response);
+ entity.setHttpStatusCode(response.getStatusLine().getStatusCode());
+ HttpEntity respEntity = response.getEntity();
+ Header contentType = respEntity.getContentType();
+
+ if (contentType.getValue().contains(ContentType.APPLICATION_JSON.getMimeType())) {
+ entity.setData(EntityUtils.toString(respEntity));
+ } else {
+ byte[] bytes = EntityUtils.toByteArray(response.getEntity());
+ entity.setContent(bytes);
+ entity.setContentType(contentType.getValue());
+ }
+ } catch (Exception e) {
+ log.error("文件下载失败:{}", e.getMessage(), e);
+ throw new ApiException("文件下载失败");
+ } finally {
+ if (response != null) {
+ try {
+ response.close();
+ } catch (IOException e) {
+ log.error("CloseableHttpResponse关闭失败:{}", e.getMessage(), e);
+ }
+ }
+ }
+
+ return entity;
+ }
+
+
+ /**
+ * 请求响应日志打印
+ *
+ * @param request 请求
+ * @param response 响应
+ */
+ private static void reqesutAndResponseLog(HttpUriRequest request, HttpResponse response) {
+
+ // 请求url
+ URI uri = request.getURI();
+ if (uri != null) {
+ log.info("request url = [{}]", uri.toString());
+ }
+
+ // 获取请求头里面的nonce
+ Header[] requestHeaders = request.getHeaders(RequestConstants.NONCE);
+
+ if (requestHeaders != null && requestHeaders.length > 0) {
+ log.info("request header {}= [{}]", RequestConstants.NONCE, requestHeaders[0].getValue());
+ }
+
+ // 获取响应头里面的requestId
+ Header[] responseHeaders = response.getHeaders(RequestConstants.FDD_REQEUST_ID);
+ if (responseHeaders != null && responseHeaders.length > 0) {
+ log.info("response header {}= [{}]", RequestConstants.FDD_REQEUST_ID, responseHeaders[0].getValue());
+ }
+ }
+
+ /**
+ * 设置超时时间和代理
+ *
+ * @return 请求配置
+ */
+ private static RequestConfig getRequestConfig(HttpConfig httpConfig) {
+ RequestConfig.Builder custom = RequestConfig.custom();
+ if (httpConfig != null) {
+ if (httpConfig.getReadTimeout() != null) {
+ custom.setSocketTimeout(httpConfig.getReadTimeout());
+ }
+ if (httpConfig.getConnectTimeout() != null) {
+ custom.setConnectTimeout(httpConfig.getConnectTimeout());
+ }
+ // 设置代理
+ if (Boolean.TRUE.equals(httpConfig.getProxyFlag())) {
+ HttpHost proxy = new HttpHost(httpConfig.getProxyHost(), httpConfig.getProxyPort(), "http");
+ custom.setProxy(proxy);
+ }
+ }
+ return custom.build();
+ }
+}
diff --git a/src/com/fasc/open/api/utils/json/JacksonUtil.java b/src/com/fasc/open/api/utils/json/JacksonUtil.java
new file mode 100644
index 0000000..24acf5d
--- /dev/null
+++ b/src/com/fasc/open/api/utils/json/JacksonUtil.java
@@ -0,0 +1,107 @@
+package com.fasc.open.api.utils.json;
+
+import com.fasc.open.api.exception.ApiException;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:28:16
+ */
+public class JacksonUtil {
+ private JacksonUtil() {
+ }
+
+ private static final Logger log = LoggerFactory.getLogger(JacksonUtil.class);
+
+
+ private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+ static {
+ /**
+ * 序列化忽略为null属性
+ */
+ OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+
+ // 取消时间的转化格式,默认是时间戳,可以取消,同时需要设置要表现的时间格式
+ OBJECT_MAPPER.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+ OBJECT_MAPPER.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+
+ // 对于空的对象转json的时候不抛出错误
+ OBJECT_MAPPER.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
+
+ // 禁用遇到未知属性抛出异常
+ OBJECT_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+ OBJECT_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
+ OBJECT_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT);
+
+
+ OBJECT_MAPPER.enable(JsonParser.Feature.ALLOW_COMMENTS);
+ OBJECT_MAPPER.enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES);
+ OBJECT_MAPPER.enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
+
+ }
+
+ public static String toJson(Object object) throws ApiException {
+ // 针对的是转义字符串
+ try {
+ if (object instanceof String) {
+ JsonNode jsonNode = OBJECT_MAPPER.readTree(String.valueOf(object));
+ return OBJECT_MAPPER.writeValueAsString(jsonNode);
+ } else {
+ return OBJECT_MAPPER.writeValueAsString(object);
+ }
+ } catch (Exception e) {
+ log.error("toJson失败:{}", e.getMessage(), e);
+ throw new ApiException("toJson失败");
+ }
+ }
+
+ public static T toJavaBean(String json, final ParameterizedType parameterizedType) throws ApiException {
+ if (json == null) {
+ return null;
+ }
+ try {
+ return OBJECT_MAPPER.readValue(json, new TypeReference() {
+ @Override
+ public Type getType() {
+ return parameterizedType;
+ }
+ });
+ } catch (JsonProcessingException e) {
+ log.error("toJavaBean失败:{}", e.getMessage(), e);
+ throw new ApiException("toJavaBean失败");
+ }
+ }
+
+
+ public static T toJavaBean(String json, Class clzz) throws ApiException {
+ try {
+ return OBJECT_MAPPER.readValue(json, clzz);
+ } catch (JsonProcessingException e) {
+ log.error("toJavaBean失败:{}", e.getMessage(), e);
+ throw new ApiException("toJavaBean失败");
+ }
+ }
+
+ public static List toList(String json, Class clzz) throws ApiException {
+ JavaType javaType = OBJECT_MAPPER.getTypeFactory().constructParametricType(List.class, clzz);
+ try {
+ return OBJECT_MAPPER.readValue(json, javaType);
+ } catch (JsonProcessingException e) {
+ log.error("toList失败:{}", e.getMessage(), e);
+ throw new ApiException("toList失败");
+ }
+ }
+
+}
diff --git a/src/com/fasc/open/api/utils/json/ParameterizedTypeBaseRes.java b/src/com/fasc/open/api/utils/json/ParameterizedTypeBaseRes.java
new file mode 100644
index 0000000..e03a00e
--- /dev/null
+++ b/src/com/fasc/open/api/utils/json/ParameterizedTypeBaseRes.java
@@ -0,0 +1,33 @@
+package com.fasc.open.api.utils.json;
+
+import com.fasc.open.api.bean.base.BaseRes;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class ParameterizedTypeBaseRes implements ParameterizedType {
+ Class clazz;
+
+ public ParameterizedTypeBaseRes(Class clz) {
+ clazz = clz;
+ }
+
+ @Override
+ public Type[] getActualTypeArguments() {
+ return new Type[]{clazz};
+ }
+
+ @Override
+ public Type getRawType() {
+ return BaseRes.class;
+ }
+
+ @Override
+ public Type getOwnerType() {
+ return null;
+ }
+}
diff --git a/src/com/fasc/open/api/utils/random/UUIDGenerator.java b/src/com/fasc/open/api/utils/random/UUIDGenerator.java
new file mode 100644
index 0000000..a2e2a68
--- /dev/null
+++ b/src/com/fasc/open/api/utils/random/UUIDGenerator.java
@@ -0,0 +1,45 @@
+/**
+ * com.yq365.utils.random
+ * UUIDGenetrator.java
+ */
+package com.fasc.open.api.utils.random;
+
+import java.util.UUID;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class UUIDGenerator {
+ private UUIDGenerator() {
+ }
+
+ /**
+ * 获得一个UUID
+ *
+ * @return String UUID
+ */
+ public static String getUuid() {
+ String s = UUID.randomUUID().toString();
+ //去掉“-”符号
+ return s.substring(0, 8) + s.substring(9, 13) + s.substring(14, 18) + s.substring(19, 23) + s.substring(24);
+ }
+
+ /**
+ * 获得指定数目的UUID
+ *
+ * @param number int 需要获得的UUID数量
+ * @return String[] UUID数组
+ */
+ public static String[] getUuid(int number) {
+ if (number < 1) {
+ return new String[0];
+ }
+ String[] ss = new String[number];
+ for (int i = 0; i < number; i++) {
+ ss[i] = getUuid();
+ }
+ return ss;
+ }
+
+}
\ No newline at end of file
diff --git a/src/com/fasc/open/api/utils/string/StringUtil.java b/src/com/fasc/open/api/utils/string/StringUtil.java
new file mode 100644
index 0000000..c607805
--- /dev/null
+++ b/src/com/fasc/open/api/utils/string/StringUtil.java
@@ -0,0 +1,93 @@
+package com.fasc.open.api.utils.string;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class StringUtil {
+ private StringUtil() {
+ }
+
+ /**
+ * 为空
+ *
+ * @param cs 字符串
+ * @return 是否为空
+ */
+ public static boolean isEmpty(CharSequence cs) {
+ return cs == null || cs.length() == 0;
+ }
+
+ /**
+ * 不为空
+ *
+ * @param cs 字符串
+ * @return 是否不为空
+ */
+ public static boolean isNotEmpty(CharSequence cs) {
+ return !isEmpty(cs);
+ }
+
+ /**
+ * 为null或者空
+ *
+ * @param cs 字符串
+ * @return 是否为null或空
+ */
+ public static boolean isBlank(CharSequence cs) {
+ int strLen;
+ if (cs != null && (strLen = cs.length()) != 0) {
+ for (int i = 0; i < strLen; ++i) {
+ if (!Character.isWhitespace(cs.charAt(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * 不为null或者空
+ *
+ * @param cs 字符串
+ * @return 是否不为null或空
+ */
+ public static boolean isNotBlank(CharSequence cs) {
+ return !isBlank(cs);
+ }
+
+ /**
+ * 去除前后空格
+ *
+ * @param str 字符串
+ * @return 字符串
+ */
+ public static String trim(String str) {
+ return str == null ? null : str.trim();
+ }
+
+ /**
+ * 去除空格后长度为0就返回null
+ *
+ * @param str 字符串
+ * @return 字符串
+ */
+ public static String trimToNull(String str) {
+ String ts = trim(str);
+ return isEmpty(ts) ? null : ts;
+ }
+
+ /**
+ * 去除空格,为null返回空字符串
+ *
+ * @param str 字符串
+ * @return 字符串
+ */
+ public static String trimToEmpty(String str) {
+ return str == null ? "" : str.trim();
+ }
+
+}
diff --git a/src/com/fasc/open/api/v5_1/client/CorpClient.java b/src/com/fasc/open/api/v5_1/client/CorpClient.java
new file mode 100644
index 0000000..43f9582
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/CorpClient.java
@@ -0,0 +1,56 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+import com.fasc.open.api.v5_1.req.corp.*;
+import com.fasc.open.api.v5_1.res.common.ECorpAuthUrlRes;
+import com.fasc.open.api.v5_1.res.corp.*;
+
+/**
+ * @author Fadada
+ * 2021/10/16 16:48:09
+ */
+public class CorpClient {
+ private OpenApiClient openApiClient;
+
+ public CorpClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes getCorpAuthUrl(GetCorpAuthResourceUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_GET_AUTH_URL, ECorpAuthUrlRes.class);
+ }
+
+ public BaseRes disable(DisableCorpReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_DISABLE, Void.class);
+ }
+
+ public BaseRes enable(EnableCorpReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_ENABLE, Void.class);
+ }
+
+ public BaseRes get(GetCorpReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_GET, CorpRes.class);
+ }
+
+ public BaseRes getIdentityInfo(GetCorpIdentityInfoReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_GET_IDENTITY_INFO, CorpIdentityInfoRes.class);
+ }
+
+ public BaseRes unbind(CorpUnbindReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_UNBIND, Void.class);
+ }
+
+ public BaseRes getIdentifiedStatus(GetIdentifiedStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_GET_IDENTIFIED_STATUS, GetIdentifiedStatusRes.class);
+ }
+ /**查询相对方**/
+ public BaseRes getCounterpartList(GetCounterpartListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.COUNTERPART_GET_LIST, GetCounterpartListRes.class);
+ }
+ /** OP支撑:获取实名认证流水号**/
+ public BaseRes getCorpIdentTransactionId(GetCorpIdentTransactionIdReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_GET_IDENT_TRANSACTION_ID, GetCorpIdentTransactionIdRes.class);
+ }
+}
diff --git a/src/com/fasc/open/api/v5_1/client/DocClient.java b/src/com/fasc/open/api/v5_1/client/DocClient.java
new file mode 100644
index 0000000..33bcfcf
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/DocClient.java
@@ -0,0 +1,41 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.v5_1.req.doc.FileProcessReq;
+import com.fasc.open.api.v5_1.req.doc.FileVerifySignReq;
+import com.fasc.open.api.v5_1.req.doc.GetUploadUrlReq;
+import com.fasc.open.api.v5_1.req.doc.UploadFileByUrlReq;
+import com.fasc.open.api.v5_1.res.doc.FileProcessRes;
+import com.fasc.open.api.v5_1.res.doc.FileVerifySignRes;
+import com.fasc.open.api.v5_1.res.doc.GetUploadUrlRes;
+import com.fasc.open.api.v5_1.res.doc.UploadFileByUrlRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class DocClient {
+ private OpenApiClient openApiClient;
+
+ public DocClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes uploadFileByUrl(UploadFileByUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.FILE_UPLOAD_BY_URL, UploadFileByUrlRes.class);
+ }
+
+ public BaseRes getUploadFileUrl(GetUploadUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.FILE_GET_UPLOAD_URL, GetUploadUrlRes.class);
+ }
+
+ public BaseRes process(FileProcessReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.FILE_PROCESS, FileProcessRes.class);
+ }
+ /** 文档验签 **/
+ public BaseRes fileVerifySign(FileVerifySignReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.DOC_POST_FILE_VERIFY_SIGN, FileVerifySignRes.class);
+ }
+}
diff --git a/src/com/fasc/open/api/v5_1/client/EUIClient.java b/src/com/fasc/open/api/v5_1/client/EUIClient.java
new file mode 100644
index 0000000..f69fc55
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/EUIClient.java
@@ -0,0 +1,32 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+import com.fasc.open.api.v5_1.req.corp.GetCorpAuthResourceUrlReq;
+import com.fasc.open.api.v5_1.req.eui.GetAppPageResourceUrlReq;
+import com.fasc.open.api.v5_1.req.eui.GetBillUrlReq;
+import com.fasc.open.api.v5_1.req.eui.GetUserPageResourceUrlReq;
+import com.fasc.open.api.v5_1.res.common.ECorpAuthUrlRes;
+import com.fasc.open.api.v5_1.res.common.EUrlRes;
+import com.fasc.open.api.v5_1.res.eui.GetPageResourceUrlRes;
+
+public class EUIClient {
+ private OpenApiClient openApiClient;
+
+ public EUIClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes getBillUrl(GetBillUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.BILLING_GET_BILL_URL, EUrlRes.class);
+ }
+
+ public BaseRes getAppPageResourceUrl(GetAppPageResourceUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_PAGE_RESOURCE_GET_URL, GetPageResourceUrlRes.class);
+ }
+
+ public BaseRes getUserPageResourceUrl(GetUserPageResourceUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_PAGE_RESOURCE_GET_URL, GetPageResourceUrlRes.class);
+ }
+}
diff --git a/src/com/fasc/open/api/v5_1/client/OCRClient.java b/src/com/fasc/open/api/v5_1/client/OCRClient.java
new file mode 100644
index 0000000..f3a0b4f
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/OCRClient.java
@@ -0,0 +1,35 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+import com.fasc.open.api.v5_1.req.doc.*;
+import com.fasc.open.api.v5_1.res.doc.*;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class OCRClient {
+ private OpenApiClient openApiClient;
+
+ public OCRClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes getCompareUrl(GetCompareUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.OCR_EDIT_GET_COMPARE_URL, GetCompareUrlRes.class);
+ }
+
+ public BaseRes getCompareResultUrl(GetCompareResultUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.OCR_EDIT_GET_RESULT_COMPARE_URL, GetCompareResultUrlRes.class);
+ }
+
+ public BaseRes getExamineUrl(GetExamineUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.OCR_EDIT_GET_EXAMINE_URL, GetExamineUrlRes.class);
+ }
+
+ public BaseRes getExamineResultUrl(GetExamineResultUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.OCR_EDIT_GET_RESULT_EXAMINE_URL, GetExamineResultUrlRes.class);
+ }
+}
diff --git a/src/com/fasc/open/api/v5_1/client/OpenApiClient.java b/src/com/fasc/open/api/v5_1/client/OpenApiClient.java
new file mode 100644
index 0000000..2a418da
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/OpenApiClient.java
@@ -0,0 +1,307 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseReq;
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.bean.base.BaseResponseEntity;
+import com.fasc.open.api.bean.base.HttpInfoRes;
+import com.fasc.open.api.config.HttpConfig;
+import com.fasc.open.api.constants.RequestConstants;
+import com.fasc.open.api.enums.http.SignTypeEnum;
+import com.fasc.open.api.exception.ApiException;
+import com.fasc.open.api.stratey.DefaultJsonStrategy;
+import com.fasc.open.api.stratey.JsonStrategy;
+import com.fasc.open.api.utils.crypt.FddCryptUtil;
+import com.fasc.open.api.utils.http.HttpUtil;
+import com.fasc.open.api.utils.json.ParameterizedTypeBaseRes;
+import com.fasc.open.api.utils.random.UUIDGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class OpenApiClient {
+
+ private final Logger log = LoggerFactory.getLogger(OpenApiClient.class);
+
+
+ private final String appId;
+ private final String appSecret;
+ private final String serverUrl;
+
+ /**
+ * 请求服务端签名加密方式,目前仅支持HMAC-SHA256,请勿修改
+ */
+ private String signType = SignTypeEnum.HMAC_SHA256.getType();
+
+ /**
+ * json串策率
+ */
+ private JsonStrategy jsonStrategy;
+
+ /**
+ * http配置
+ */
+ private HttpConfig httpConfig;
+
+ public OpenApiClient(String appId, String appSecret, String serverUrl) {
+ this.appId = appId;
+ this.appSecret = appSecret;
+ this.serverUrl = serverUrl;
+ }
+
+ public HttpConfig getHttpConfig() {
+ return httpConfig;
+ }
+
+ public void setHttpConfig(HttpConfig httpConfig) {
+ if (httpConfig != null) {
+ this.httpConfig = httpConfig;
+ HttpUtil.httpConfig = this.httpConfig;
+ }
+ }
+
+ public String getSignType() {
+ return signType;
+ }
+
+ public void setSignType(String signType) {
+ if (signType != null) {
+ this.signType = signType;
+ }
+ }
+
+ public void setJsonStrategy(JsonStrategy jsonStrategy) {
+ if (jsonStrategy != null) {
+ this.jsonStrategy = jsonStrategy;
+ }
+ }
+
+ public JsonStrategy getJsonStrategy() {
+ if (this.jsonStrategy == null) {
+ this.jsonStrategy = new DefaultJsonStrategy();
+ }
+ return this.jsonStrategy;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public String getAppSecret() {
+ return appSecret;
+ }
+
+ /**
+ * 根据请求返回实体类
+ *
+ * @param req 请求实体
+ * @param path 请求路径
+ * @param clzz 指定响应实体类
+ * @param 响应实体泛型
+ * @return BaseRsp
+ * @throws ApiException API异常
+ */
+ BaseRes invokeApi(BaseReq req, String path, Class clzz) throws ApiException {
+ return this.httpRequest(req, path, null, clzz);
+ }
+
+
+ /**
+ * 根据请求返回实体类
+ *
+ * @param req 请求实体
+ * @param path 请求路径
+ * @param clzz 指定响应实体类
+ * @param 响应实体泛型
+ * @return BaseRsp
+ * @throws ApiException API异常
+ */
+ BaseRes> invokeApiList(BaseReq req, String path, Class clzz) throws ApiException {
+ return this.httpRequestList(req, path, clzz);
+ }
+
+
+ /**
+ * 上传文件返回实体类
+ *
+ * @param req 请求实体
+ * @param path 请求路径
+ * @param files 请求文件
+ * @param clzz 指定响应实体类
+ * @param 响应实体泛型
+ * @return BaseRsp
+ * @throws ApiException API异常
+ */
+ BaseRes invokeApi(BaseReq req, String path, Map files, Class clzz) throws ApiException {
+ return httpRequest(req, path, files, clzz);
+ }
+
+ /**
+ * 下载返回对应实体类
+ *
+ * @param req 请求实体
+ * @param path 请求路径
+ * @return BaseRes
+ * @throws ApiException API异常
+ */
+ BaseRes invokeApiDownload(BaseReq req, String path) throws ApiException {
+ String accessToken = req.getAccessToken();
+ Map bodyMap = getBodyMap(req);
+ Map headerMap = getSign(getHeaderMap(accessToken), bodyMap);
+ String method = getMethod(path);
+ path = path.replace(method, "").trim();
+ String url = serverUrl + path;
+
+ BaseResponseEntity baseResponseEntity = request(url, headerMap, bodyMap);
+ BaseRes res;
+
+ if (baseResponseEntity.getData() != null) {
+ res = getJsonStrategy().toJavaBean(baseResponseEntity.getData(), BaseRes.class);
+ } else {
+ res = new BaseRes();
+ res.setData(baseResponseEntity);
+ }
+ res.setHttpStatusCode(baseResponseEntity.getHttpStatusCode());
+ return res;
+ }
+
+ private BaseRes> httpRequestList(BaseReq req, String path, Class clzz)
+ throws ApiException {
+ HttpInfoRes httpInfoRes = this.httpRequest(req, path, null);
+ if (httpInfoRes == null) {
+ return null;
+ }
+
+ BaseRes baseRes = getJsonStrategy().toJavaBean(httpInfoRes.getBody(), BaseRes.class);
+ baseRes.setHttpStatusCode(httpInfoRes.getHttpStatusCode());
+ Object data = baseRes.getData();
+ if (data != null) {
+ String jsonStr;
+ if (data instanceof String) {
+ jsonStr = String.valueOf(data);
+ } else {
+ jsonStr = getJsonStrategy().toJson(data);
+ }
+ List lists = getJsonStrategy().toList(jsonStr, clzz);
+ baseRes.setData(lists);
+ }
+ return baseRes;
+ }
+
+ private BaseRes httpRequest(BaseReq req, String path, Map files, Class clzz)
+ throws ApiException {
+ HttpInfoRes httpInfoRes = this.httpRequest(req, path, files);
+ if (httpInfoRes == null) {
+ return null;
+ }
+ BaseRes baseRes = getJsonStrategy().toJavaBean(httpInfoRes.getBody(), new ParameterizedTypeBaseRes(clzz));
+ baseRes.setHttpStatusCode(httpInfoRes.getHttpStatusCode());
+ return baseRes;
+ }
+
+ private HttpInfoRes httpRequest(BaseReq req, String path, Map files) throws ApiException {
+ String accessToken = req == null ? null : req.getAccessToken();
+ HashMap bodyMap = getBodyMap(req);
+ Map headerMap = getSign(getHeaderMap(accessToken), bodyMap);
+ String method = getMethod(path);
+ path = path.replace(method, "").trim();
+ String url = serverUrl + path;
+ return request(url, method, headerMap, bodyMap, files);
+ }
+
+ private String getMethod(String path) {
+ String method;
+ if (path.startsWith(RequestConstants.METHOD_POST)) {
+ method = RequestConstants.METHOD_POST;
+ } else if (path.startsWith(RequestConstants.METHOD_GET)) {
+ method = RequestConstants.METHOD_GET;
+ } else {
+ throw new IllegalArgumentException("path值非法");
+ }
+ return method;
+ }
+
+
+ private Map getSign(Map headerMap, Map bodyMap) {
+ try {
+ Map signMap = new HashMap(headerMap);
+ if (null != bodyMap) {
+ signMap.putAll(bodyMap);
+ }
+ String sortParam = FddCryptUtil.sortParameters(signMap);
+ String sign = FddCryptUtil.sign(sortParam, headerMap.get(RequestConstants.TIMESTAMP), appSecret);
+ headerMap.put(RequestConstants.SIGN, sign);
+ } catch (Exception e) {
+ log.error("计算签名失败:{}", e.getMessage(), e);
+ }
+ return headerMap;
+ }
+
+
+ private HashMap getHeaderMap(String accessToken) {
+ HashMap paraMap = new HashMap();
+ paraMap.put(RequestConstants.APP_ID, appId);
+ paraMap.put(RequestConstants.API_SUB_VERSION, RequestConstants.CURRENT_SUB_VERSION);
+ paraMap.put(RequestConstants.SIGN_TYPE, signType);
+ if (accessToken != null) {
+ paraMap.put(RequestConstants.ACCESS_TOKEN, accessToken);
+ paraMap.remove(RequestConstants.DATA_KEY);
+ } else {
+ paraMap.put(RequestConstants.GRANT_TYPE, RequestConstants.CLIENT_CREDENTIAL);
+ }
+
+ paraMap.put(RequestConstants.TIMESTAMP, String.valueOf(System.currentTimeMillis()));
+ paraMap.put(RequestConstants.NONCE, UUIDGenerator.getUuid());
+ return paraMap;
+
+
+ }
+
+ private HashMap getBodyMap(BaseReq req) throws ApiException {
+ if (req == null) {
+ return new HashMap<>();
+ }
+ String bizContent;
+ req.setAccessToken(null);
+ bizContent = getJsonStrategy().toJson(req);
+
+ HashMap bodyMap = new HashMap(1);
+ bodyMap.put(RequestConstants.DATA_KEY, bizContent);
+ return bodyMap;
+ }
+
+
+ private HttpInfoRes request(String url, String method, Map headerMap, Map bodyMap, Map fileMap) throws ApiException {
+ try {
+ if (RequestConstants.METHOD_GET.equals(method)) {
+ return HttpUtil.get(url, headerMap, bodyMap);
+ } else if (RequestConstants.METHOD_POST.equals(method)) {
+ return HttpUtil.post(url, headerMap, bodyMap, fileMap);
+ }
+ return null;
+ } catch (ApiException apie) {
+ throw apie;
+ } catch (Exception e) {
+ log.error("http请求失败:{}", e.getMessage(), e);
+ throw new ApiException("http请求失败");
+ }
+ }
+
+
+ private BaseResponseEntity request(String url, Map headerMap, Map bodyMap) throws ApiException {
+ try {
+ return HttpUtil.downLoadFiles(url, headerMap, bodyMap);
+ } catch (Exception e) {
+ log.error("httpDownLoad请求失败:{}", e.getMessage(), e);
+ throw new ApiException("httpDownLoad请求失败");
+ }
+ }
+
+}
diff --git a/src/com/fasc/open/api/v5_1/client/OrgClient.java b/src/com/fasc/open/api/v5_1/client/OrgClient.java
new file mode 100644
index 0000000..63b2979
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/OrgClient.java
@@ -0,0 +1,82 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+import com.fasc.open.api.v5_1.req.org.*;
+import com.fasc.open.api.v5_1.res.org.*;
+
+import java.util.List;
+
+/**
+ * @author gongj
+ * @date 2022/7/12
+ */
+public class OrgClient {
+
+ private OpenApiClient openApiClient;
+
+ public OrgClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ /**部门相关接口*/
+ public BaseRes> getCorpDeptList(GetCorpDeptListReq req) throws ApiException {
+ return openApiClient.invokeApiList(req, OpenApiUrlConstants.CORP_DEPT_GET_LIST, CorpDeptInfo.class);
+ }
+
+ public BaseRes getCorpDeptDetail(GetCorpDeptDetailReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_DEPT_GET_DETAIL, GetCorpDeptDetailRes.class);
+ }
+
+ public BaseRes createCorpDept(CreateCorpDeptReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_DEPT_CREATE, CreateCorpDeptRes.class);
+ }
+
+ public BaseRes modifyCorpDept(ModifyCorpDeptReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_DEPT_MODIFY, Void.class);
+ }
+
+ public BaseRes deleteCorpDept(DeleteCorpDeptReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_DEPT_DELETE, Void.class);
+ }
+
+ /** 企业成员相关接口 */
+ public BaseRes getMemberList(GetMemberListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_MEMBER_GET_LIST, GetMemberListRes.class);
+ }
+
+ public BaseRes getCorpMemberDetail(GetCorpMemberDetailReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_MEMBER_GET_DETAIL, GetCorpMemberDetailRes.class);
+ }
+
+ public BaseRes> createCorpMember(CreateCorpMemberReq req) throws ApiException {
+ return openApiClient.invokeApiList(req, OpenApiUrlConstants.CORP_MEMBER_CREATE, SimpleEmployeeInfo.class);
+ }
+
+ public BaseRes> getCorpMemberActiveUrl(GetCorpMemberActiveUrlReq req) throws ApiException {
+ return openApiClient.invokeApiList(req, OpenApiUrlConstants.CORP_MEMBER_ACTIVE_URL, SimpleEmployeeInfo.class);
+ }
+
+ public BaseRes modifyCorpMember(ModifyCorpMemberReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_MEMBER_MODIFY, Void.class);
+ }
+
+ public BaseRes setCorpMemberDept(SetCorpMemberDeptReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_MEMBER_SET_DEPT, Void.class);
+ }
+
+ public BaseRes setCorpMemberStatus(SetCorpMemberStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_MEMBER_SET_STATUS, Void.class);
+ }
+
+ public BaseRes deleteCorpMember(DeleteCorpMemberReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CORP_MEMBER_DELETE, Void.class);
+ }
+
+ /** 企业管理链接 */
+ public BaseRes getCorpOrgManageUrl(GetCorpOrgManageUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.GET_ORG_MANAGER_URL, GetCorpOrgManageUrlRes.class);
+ }
+
+}
diff --git a/src/com/fasc/open/api/v5_1/client/SealClient.java b/src/com/fasc/open/api/v5_1/client/SealClient.java
new file mode 100644
index 0000000..ab00c40
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/SealClient.java
@@ -0,0 +1,95 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.v5_1.req.seal.*;
+import com.fasc.open.api.v5_1.req.template.CancelPersonalSealFreeSignReq;
+import com.fasc.open.api.v5_1.req.template.CancelSealFreeSignReq;
+import com.fasc.open.api.v5_1.res.seal.*;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+
+/**
+ * @author gongj
+ * @date 2022/7/12
+ */
+public class SealClient {
+
+ private OpenApiClient openApiClient;
+
+ public SealClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes getSealList(GetSealListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_LIST, GetSealListRes.class);
+ }
+
+ public BaseRes getSealDetail(GetSealDetailReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_DETAIL, GetSealDetailRes.class);
+ }
+
+ public BaseRes getAppointedSealUrl(GetAppointedSealUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_APPOINTED_URL, GetAppointedSealUrlRes.class);
+ }
+
+ public BaseRes getSealUserList(GetSealUserListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_USER_LIST, GetSealUserListRes.class);
+ }
+
+ public BaseRes getUserSealList(GetUserSealListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.GET_USER_SEAL_LIST, GetUserSealListRes.class);
+ }
+
+ public BaseRes getSealCreateUrl(GetSealCreateUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_CREATE_URL, GetSealCreateUrlRes.class);
+ }
+
+ public BaseRes getSealVerifyList(GetSealVerifyListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_VERIFY_LIST, GetSealVerifyListRes.class);
+ }
+
+ public BaseRes modifySeal(ModifySealReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_MODIFY, Void.class);
+ }
+
+ public BaseRes getSealGrantUrl(GetSealGrantUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_GRANT_URL, GetSealGrantUrlRes.class);
+ }
+
+ public BaseRes cancelSealGrant(CancelSealGrantReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_CANCEL_GRANT, Void.class);
+ }
+
+ public BaseRes setSealStatus(SetSealStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_SET_STATUS, Void.class);
+ }
+
+ public BaseRes deleteSeal(SealDeleteReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_DELETE, Void.class);
+ }
+
+ public BaseRes getSealManageUrl(GetSealManageUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_MANAGE_URL, GetSealManageUrlRes.class);
+ }
+
+ public BaseRes getSealFreeSignUrl(GetSealFreeSignUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SEAL_GET_FREE_SIGN_URL, GetSealFreeSignUrlRes.class);
+ }
+
+ public BaseRes getPersonalSealList(GetPersonalSealListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.PERSONAL_SEAL_GET_LIST, GetPersonalSealListRes.class);
+ }
+ public BaseRes getPersonalSealFreeSignUrl(GetPersonalSealFreeSignUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.PERSONAL_SEAL_GET_FREE_SIGN_URL, GetSealFreeSignUrlRes.class);
+ }
+
+ /**解除印章免验证签**/
+ public BaseRes cancelSealFreeSign(CancelSealFreeSignReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CANCEL_SEAL_FREE_SIGN, Void.class);
+ }
+
+ /**解除签名免验证签**/
+ public BaseRes cancelPersonalSealFreeSign(CancelPersonalSealFreeSignReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.CANCEL_PERSONAL_SEAL_FREE_SIGN, Void.class);
+ }
+}
diff --git a/src/com/fasc/open/api/v5_1/client/ServiceClient.java b/src/com/fasc/open/api/v5_1/client/ServiceClient.java
new file mode 100644
index 0000000..74e86dc
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/ServiceClient.java
@@ -0,0 +1,23 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.v5_1.res.service.AccessTokenRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class ServiceClient {
+ private OpenApiClient openApiClient;
+
+ public ServiceClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes getAccessToken() throws ApiException {
+ return openApiClient.invokeApi(null, OpenApiUrlConstants.SERVICE_GET_ACCESS_TOKEN, AccessTokenRes.class);
+ }
+
+}
diff --git a/src/com/fasc/open/api/v5_1/client/SignTaskClient.java b/src/com/fasc/open/api/v5_1/client/SignTaskClient.java
new file mode 100644
index 0000000..761c2e5
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/SignTaskClient.java
@@ -0,0 +1,179 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+import com.fasc.open.api.v5_1.req.signtask.*;
+import com.fasc.open.api.v5_1.res.signtask.*;
+
+import java.util.List;
+
+/**
+ * @author Fadada
+ * 2021/9/13 17:10:09
+ */
+public class SignTaskClient {
+ private OpenApiClient openApiClient;
+
+ public SignTaskClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes create(CreateSignTaskReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_CREATE, CreateSignTaskRes.class);
+ }
+
+ public BaseRes createWithTemplate(CreateWithTemplateReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_CREATE_WITH_TEMPLATE, CreateSignTaskRes.class);
+ }
+
+ public BaseRes addDoc(AddDocReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_DOC_ADD, Void.class);
+ }
+
+ public BaseRes deleteDoc(DeleteDocReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_DOC_DELETE, Void.class);
+ }
+
+ public BaseRes addField(AddFieldReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_FIELD_ADD, Void.class);
+ }
+
+ public BaseRes deleteField(DeleteFieldReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_FIELD_DELETE, Void.class);
+ }
+
+ public BaseRes addAttach(AddAttachReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_ATTACH_ADD, Void.class);
+ }
+
+ public BaseRes deleteAttach(DeleteAttachReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_ATTACH_DELETE, Void.class);
+ }
+
+ public BaseRes addActor(AddActorsReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_ACTOR_ADD, Void.class);
+ }
+
+ public BaseRes deleteActor(DeleteActorReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_ACTOR_DELETE, Void.class);
+ }
+
+ public BaseRes start(SignTaskBaseReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_START, Void.class);
+ }
+
+ public BaseRes fillFieldValues(FillFieldValuesReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_FIELD_FILL_VALUES, Void.class);
+ }
+
+ public BaseRes finalizeDoc(SignTaskBaseReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_DOC_FINALIZE, Void.class);
+ }
+
+ public BaseRes block(BlockReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_BLOCK, Void.class);
+ }
+
+ public BaseRes unblock(UnblockReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_UNBLOCK, Void.class);
+ }
+
+ public BaseRes cancel(SignTaskCancelReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_CANCEL, Void.class);
+ }
+
+ public BaseRes getDetail(SignTaskBaseReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_GET_DETAIL, SignTaskDetailRes.class);
+ }
+
+ public BaseRes getOwnerList(GetOwnerSignTaskListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_OWNER_GET_LIST, GetSignTaskListRes.class);
+ }
+
+ public BaseRes getOwnerDownloadUrl(GetOwnerDownloadUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_OWNER_GET_DOWNLOAD_URL, OwnerDownloadUrlRes.class);
+ }
+
+ public BaseRes signTaskActorGetUrl(SignTaskActorGetUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_ACTOR_GET_URL, SignTaskActorGetUrlRes.class);
+ }
+
+ public BaseRes> signTaskCataloglist(SignTaskCatalogListReq req) throws ApiException {
+ return openApiClient.invokeApiList(req, OpenApiUrlConstants.SIGN_TASK_CATALOG_LIST, SignTaskCatalogListRes.class);
+ }
+
+ public BaseRes listSignTaskField(ListSignTaskFieldReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_FIELD_LIST, ListSignTaskFieldRes.class);
+ }
+
+ public BaseRes> listSignTaskActor(ListSignTaskActorReq req) throws ApiException {
+ return openApiClient.invokeApiList(req, OpenApiUrlConstants.SIGN_TASK_ACTOR_LIST, ListSignTaskActorRes.class);
+ }
+
+ public BaseRes getApprovalInfo(GetApprovalInfoReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_GET_APPROVAL_INFO, GetApprovalInfoRes.class);
+ }
+
+ public BaseRes getBatchSignUrl(GetBatchSignUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_GET_BATCH_SIGN_URL, BatchSignUrlRes.class);
+ }
+
+ public BaseRes getSignTaskEditUrl(GetSignTaskUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_GET_EDIT_URL, GetSignTaskEditUrlRes.class);
+ }
+
+ public BaseRes getSignTaskPreviewUrl(GetSignTaskUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_GET_PREVIEW_URL, GetSignTaskPreviewUrlRes.class);
+ }
+
+ public BaseRes signTaskUrge(SignTaskBaseReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_URGE, Void.class);
+ }
+ /** 获取签署任务公证处保全报告 **/
+ public BaseRes getDownloadEvidenceReport(GetDownloadEvidenceReportUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.GET_SIGN_TASK_DOWNLOAD_EVIDENCE_REPORT_URL, GetDownloadEvidenceReportRes.class);
+ }
+
+ /** 删除签署任务 **/
+ public BaseRes signTaskDelete(DeleteSignTaskReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_DELETE, Void.class);
+ }
+
+ /** 结束签署任务 **/
+ public BaseRes signTaskFinish(FinishSignTaskReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_FINISH, Void.class);
+ }
+
+ /** 查询签署业务类型列表 **/
+ public BaseRes> getSignTaskBusinessTypeList(GetSignTaskBusinessTypeListReq req) throws ApiException {
+ return openApiClient.invokeApiList(req, OpenApiUrlConstants.SIGN_TASK_GET_BUSINESS_TYPE_LIST, GetSignTaskBusinessTypeListRes.class);
+ }
+
+ /** 查询参与方签署底图 **/
+ public BaseRes getSignTaskFacePicture(GetSignTaskFacePictureReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_ACTOR_GET_FACE_PICTURE, GetSignTaskFacePictureRes.class);
+ }
+
+ /** 作废签署任务 **/
+ public BaseRes abolishSignTask(CancelSignTaskCreateReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TASK_ABOLISH, CancelSignTaskCreateRes.class);
+ }
+ /** 签署文档切图 **/
+ public BaseRes getSignTaskOwnerSlicingTicketId(GetSignTaskSlicingDocReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.GET_SIGN_TASK_OWNER_SLICING_TICKET_ID, GetSignTaskPicDocTicketRes.class);
+ }
+
+ /** 获取图片版签署文档下载地址 **/
+ public BaseRes getSignTaskOwnerPicDownloadUrl(GetSignTaskPicDocTicketReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.GET_SIGN_TASK_OWNER_PIC_DOWNLOAD_URL, GetSignTaskDocRes.class);
+ }
+
+ /** 获取参与方签署音视频下载地址 **/
+ public BaseRes getAudioVideoDownloadUrl(GetActorAudioVideoReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.GET_AUDIO_VIDEO_DOWNLOAD_URL, GetActorAudioVideoRes.class);
+ }
+
+
+
+}
diff --git a/src/com/fasc/open/api/v5_1/client/TemplateClient.java b/src/com/fasc/open/api/v5_1/client/TemplateClient.java
new file mode 100644
index 0000000..4160d8a
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/TemplateClient.java
@@ -0,0 +1,133 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.v5_1.req.template.*;
+import com.fasc.open.api.v5_1.res.template.*;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+
+import java.util.List;
+
+/**
+ * @author Fadada
+ * 2021/9/8 16:09:38
+ */
+public class TemplateClient {
+ private OpenApiClient openApiClient;
+
+ public TemplateClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes getDocTemplateList(GetDocTemplateListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.DOC_TEMPLATE_GET_LIST, DocTemplateListRes.class);
+ }
+
+ public BaseRes getDocTemplateDetail(DocTemplateDetailReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.DOC_TEMPLATE_GET_DETAIL, DocTemplateDetailRes.class);
+ }
+
+ public BaseRes getSignTemplateList(GetSignTemplateListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TEMPLATE_GET_LIST, SignTemplateListRes.class);
+ }
+
+ public BaseRes getSignTemplateDetail(SignTemplateDetailReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TEMPLATE_GET_DETAIL, SignTemplateDetailRes.class);
+ }
+
+ public BaseRes getTemplateCreateUrl(GetTemplateCreateUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TEMPLATE_GET_CREATE_URL, GetTemplateCreateUrlRes.class);
+ }
+
+ public BaseRes getTemplateEditUrl(GetTemplateEditUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TEMPLATE_GET_EDIT_URL, GetTemplateEditUrlRes.class);
+ }
+
+ public BaseRes getTemplatePreviewUrl(GetTemplatePreviewUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TEMPLATE_GET_PREVIEW_URL, GetTemplatePreviewUrlRes.class);
+ }
+
+ public BaseRes getTemplateManageUrl(GetTemplateManageUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SIGN_TEMPLATE_GET_MANAGE_URL, GetTemplateManageUrlRes.class);
+ }
+
+ public BaseRes getAppDocTemplates(GetAppDocTemplateListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_DOC_TEMPLATE_GET_LIST, AppDocTemplatePageListRes.class);
+ }
+
+ public BaseRes getDocTemplateDetail(GetAppDocTemplateDetailReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_DOC_TEMPLATE_GET_DETAIL, AppDocTemplateDetailRes.class);
+ }
+
+ public BaseRes getAppSignTemplates(GetAppSignTemplateListReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_SIGN_TEMPLATE_GET_LIST, AppSignTemplatePageListRes.class);
+ }
+
+ public BaseRes getAppSignTemplateDetail(GetAppSignTemplateDetailReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_SIGN_TEMPLATE_GET_DETAIL, AppSignTemplateDetailRes.class);
+ }
+
+ public BaseRes getAppTemplateCreateUrl(GetAppTemplateCreateUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_TEMPLATE_CREATE_GET_URL, GetAppTemplateCreateUrlRes.class);
+ }
+
+ public BaseRes getAppTemplateEditUrl(GetAppTemplateEditUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_TEMPLATE_EDIT_GET_URL, GetAppTemplateEditUrlRes.class);
+ }
+
+ public BaseRes getAppTemplatePreviewUrl(GetAppTemplatePreviewUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_TEMPLATE_PREVIEW_GET_URL, GetAppTemplatePreviewUrlRes.class);
+ }
+
+ public BaseRes createAppField(CreateAppFieldReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_FIELD_CREATE, Void.class);
+ }
+
+ public BaseRes modifyAppField(ModifyAppFieldReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_FIELD_MODIFY, Void.class);
+ }
+
+ public BaseRes setAppFieldStatus(SetAppFieldStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_FIELD_SET_STATUS, Void.class);
+ }
+
+ public BaseRes> getAppFieldList(GetAppFieldListReq req) throws ApiException {
+ return openApiClient.invokeApiList(req, OpenApiUrlConstants.APP_FIELD_GET_LIST, GetAppFieldListRes.class);
+ }
+ /**启用/停用应用文档模板 **/
+ public BaseRes setAppTemplateSetStatus(SetTemplateStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_DOC_TEMPLATE_SET_STATUS, Void.class);
+ }
+ /**删除应用文档模板 **/
+ public BaseRes deleteAppTemplate(DeleteAppTemplateReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_DOC_TEMPLATE_DELETE, Void.class);
+ }
+ /**启用/停用应用签署任务模板 **/
+ public BaseRes setAppSignTemplateStatus(SetAppSignTemplateStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_DOC_SIGN_TEMPLATE_SET_STATUS, Void.class);
+ }
+ /**删除应用文档模板 **/
+ public BaseRes deleteSignAppTemplate(DeleteSignAppTemplateReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.APP_DOC_SIGN_TEMPLATE_DELETE, Void.class);
+ }
+
+ /**启用/停用文档模板**/
+ public BaseRes setDocTemplateStatus(SetDocTemplateStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SET_DOC_TEMPLATE_STATUS, Void.class);
+ }
+
+ /**删除文档模板**/
+ public BaseRes deleteDocTemplate(DeleteDocTemplateReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.DELETE_DOC_TEMPLATE, Void.class);
+ }
+
+ /**启用/停用签署模板**/
+ public BaseRes setSignTemplateStatus(SetSignTemplateStatusReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.SET_SIGN_TEMPLATE_STATUS, Void.class);
+ }
+
+ /**签署模板删除**/
+ public BaseRes deleteSignTemplate(DeleteSignTemplateReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.DELETE_SIGN_TEMPLATE, Void.class);
+ }
+}
diff --git a/src/com/fasc/open/api/v5_1/client/UserClient.java b/src/com/fasc/open/api/v5_1/client/UserClient.java
new file mode 100644
index 0000000..21f5903
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/client/UserClient.java
@@ -0,0 +1,68 @@
+package com.fasc.open.api.v5_1.client;
+
+import com.fasc.open.api.bean.base.BaseRes;
+import com.fasc.open.api.constants.OpenApiUrlConstants;
+import com.fasc.open.api.exception.ApiException;
+import com.fasc.open.api.v5_1.req.user.*;
+import com.fasc.open.api.v5_1.res.common.EUrlRes;
+import com.fasc.open.api.v5_1.res.user.*;
+
+/**
+ * @author Fadada
+ * 2021/10/16 16:47:06
+ */
+public class UserClient {
+ private OpenApiClient openApiClient;
+
+ public UserClient(OpenApiClient openApiClient) {
+ this.openApiClient = openApiClient;
+ }
+
+ public BaseRes disable(DisableUserReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_DISABLE, Void.class);
+ }
+
+ public BaseRes enable(EnableUserReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_ENABLE, Void.class);
+ }
+
+ public BaseRes get(GetUserReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET, UserRes.class);
+ }
+
+ public BaseRes getIdentityInfo(GetUserIdentityInfoReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET_IDENTITY_INFO, UserIdentityInfoRes.class);
+ }
+
+ public BaseRes unbind(UserUnbindReq req) throws ApiException{
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_UNBIND, Void.class);
+ }
+
+ public BaseRes getUserAuthUrl(GetUserAuthUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET_AUTH_URL, EUrlRes.class);
+ }
+ /** OP支撑:获取实名认证流水号**/
+ public BaseRes getUserIdentTransactionId(GetUserIdentTransactionIdReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET_IDENT_TRANSACTION_ID, GetUserTransactionDetailRes.class);
+ }
+
+ /** 获取三要素校验接口**/
+ public BaseRes getUserThreeElementVerifyUrl(GetUserThreeElementVerifyUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET_THREE_ELEMENT_VERIFY_URL, GetUserThreeElementVerifyUrlReq.class);
+ }
+ /** 获取四要素校验接口**/
+ public BaseRes getUserFourElementVerifyUrl(GetUserFourElementVerifyUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET_FOUR_ELEMENT_VERIFY_URL, GetFourElementsVerifyUrlRes.class);
+ }
+
+ /** 获取要素校验身份证图片下载链接**/
+ public BaseRes getUserIdcardImageDownloadUrl(GetIdCardImageDownloadUrlReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET_IDCARD_IMAGE_DOWNLOAD_URL, GetIdCardImageDownloadUrlRes.class);
+ }
+
+ /** 个人认证授权管理-身份证OCR**/
+ public BaseRes IdCardOcr(IdCardOcrReq req) throws ApiException {
+ return openApiClient.invokeApi(req, OpenApiUrlConstants.USER_GET_OCR_ID_CARD, IdCardOcrRes.class);
+ }
+
+}
diff --git a/src/com/fasc/open/api/v5_1/req/corp/CorpIdentInfoReq.java b/src/com/fasc/open/api/v5_1/req/corp/CorpIdentInfoReq.java
new file mode 100644
index 0000000..dff593b
--- /dev/null
+++ b/src/com/fasc/open/api/v5_1/req/corp/CorpIdentInfoReq.java
@@ -0,0 +1,62 @@
+package com.fasc.open.api.v5_1.req.corp;
+
+import com.fasc.open.api.bean.base.BaseBean;
+
+import java.util.List;
+
+public class CorpIdentInfoReq extends BaseBean {
+ private String corpName;
+ private String corpIdentType;
+ private String corpIdentNo;
+ private String legalRepName;
+ private String license;
+ private List corpIdentMethod;
+
+ public String getCorpName() {
+ return corpName;
+ }
+
+ public void setCorpName(String corpName) {
+ this.corpName = corpName;
+ }
+
+ public String getCorpIdentType() {
+ return corpIdentType;
+ }
+
+ public void setCorpIdentType(String corpIdentType) {
+ this.corpIdentType = corpIdentType;
+ }
+
+ public String getCorpIdentNo() {
+ return corpIdentNo;
+ }
+
+ public void setCorpIdentNo(String corpIdentNo) {
+ this.corpIdentNo = corpIdentNo;
+ }
+
+ public String getLegalRepName() {
+ return legalRepName;
+ }
+
+ public void setLegalRepName(String legalRepName) {
+ this.legalRepName = legalRepName;
+ }
+
+ public String getLicense() {
+ return license;
+ }
+
+ public void setLicense(String license) {
+ this.license = license;
+ }
+
+ public List getCorpIdentMethod() {
+ return corpIdentMethod;
+ }
+
+ public void setCorpIdentMethod(List