mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 12:56:28 +08:00
5.0
This commit is contained in:
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 请求客户端,申明一个即可
|
||||
*
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class OpenClient {
|
||||
private static final Log log = LogFactory.getLog(OpenClient.class);
|
||||
|
@@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* HTTP请求工具
|
||||
*
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class OpenHttp {
|
||||
private static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
|
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 负责请求操作
|
||||
*
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class OpenRequest {
|
||||
|
||||
|
@@ -11,7 +11,7 @@ package com.gitee.sop.sdk.common;
|
||||
* },
|
||||
* "sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
|
||||
* }
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class CustomDataNameBuilder implements DataNameBuilder {
|
||||
private String dataName = "result";
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.gitee.sop.sdk.common;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public interface DataNameBuilder {
|
||||
/**
|
||||
|
@@ -14,7 +14,7 @@ package com.gitee.sop.sdk.common;
|
||||
* "sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
|
||||
* }
|
||||
* </pre>
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class DefaultDataNameBuilder implements DataNameBuilder {
|
||||
private static final char DOT = '.';
|
||||
|
@@ -3,7 +3,7 @@ package com.gitee.sop.sdk.common;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class OpenConfig {
|
||||
|
@@ -8,7 +8,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 请求form
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
@@ -2,10 +2,10 @@ package com.gitee.sop.sdk.common;
|
||||
|
||||
/**
|
||||
* 请求方法枚举
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public enum RequestMethod {
|
||||
|
||||
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
package com.gitee.sop.sdk.common;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class SopSdkConstants {
|
||||
public static String DATA_SUFFIX = "_response";
|
||||
|
||||
public static String ERROR_RESPONSE_KEY = "error_response";
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ package com.gitee.sop.sdk.common;
|
||||
import com.gitee.sop.sdk.response.ErrorResponse;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public enum SopSdkErrors {
|
||||
/**
|
||||
|
@@ -13,7 +13,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 文件上传类
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.gitee.sop.sdk.exception;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class SdkException extends RuntimeException {
|
||||
|
||||
|
@@ -3,7 +3,7 @@ package com.gitee.sop.sdk.model;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class DemoFileUploadModel {
|
||||
|
@@ -4,7 +4,7 @@ import lombok.Data;
|
||||
|
||||
/**
|
||||
* Oauth2认证参数
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class OpenAuthTokenAppModel {
|
||||
|
@@ -32,7 +32,7 @@ import java.util.Map;
|
||||
*
|
||||
* @param <T> 对应的Response对象
|
||||
*
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public abstract class BaseRequest<T extends BaseResponse> {
|
||||
|
||||
|
@@ -3,7 +3,7 @@ package com.gitee.sop.sdk.request;
|
||||
import com.gitee.sop.sdk.response.CommonResponse;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class CommonRequest extends BaseRequest<CommonResponse> {
|
||||
|
||||
|
@@ -3,7 +3,7 @@ package com.gitee.sop.sdk.request;
|
||||
import com.gitee.sop.sdk.response.DemoFileUploadResponse;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class DemoFileUploadRequest extends BaseRequest<DemoFileUploadResponse> {
|
||||
@Override
|
||||
|
@@ -3,7 +3,7 @@ package com.gitee.sop.sdk.request;
|
||||
import com.gitee.sop.sdk.response.OpenAuthTokenAppResponse;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class OpenAuthTokenAppRequest extends BaseRequest<OpenAuthTokenAppResponse> {
|
||||
@Override
|
||||
|
@@ -16,7 +16,7 @@ import lombok.Setter;
|
||||
* },
|
||||
* "sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
|
||||
* }
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.gitee.sop.sdk.response;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class CommonResponse extends BaseResponse {
|
||||
|
||||
|
@@ -7,7 +7,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.gitee.sop.sdk.response;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class ErrorResponse extends BaseResponse {
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
@@ -22,7 +22,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class ClassUtil {
|
||||
|
||||
|
@@ -9,7 +9,7 @@ import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 文件工具类
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class FileUtil {
|
||||
|
||||
|
@@ -2,7 +2,7 @@ package com.gitee.sop.sdk.util;
|
||||
|
||||
/**
|
||||
* hex工具类
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class HexUtil {
|
||||
private static final String ZERO = "0";
|
||||
|
@@ -4,7 +4,7 @@ import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* MD5工具类
|
||||
* @author tanghc
|
||||
* @author 六如
|
||||
*/
|
||||
public class MD5Util {
|
||||
|
||||
@@ -12,7 +12,7 @@ public class MD5Util {
|
||||
|
||||
/**
|
||||
* 生成md5,全部大写
|
||||
*
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
@@ -22,7 +22,7 @@ public class MD5Util {
|
||||
|
||||
/**
|
||||
* 生成md5,全部大写
|
||||
*
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
@@ -32,7 +32,7 @@ public class MD5Util {
|
||||
|
||||
/**
|
||||
* 生成md5,全部小写
|
||||
*
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public class MD5Util {
|
||||
}
|
||||
return encrypt(input.getBytes());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回长度16串,小写
|
||||
* @param input
|
||||
@@ -54,7 +54,7 @@ public class MD5Util {
|
||||
|
||||
/**
|
||||
* 生成md5,全部小写
|
||||
*
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
@@ -75,7 +75,7 @@ public class MD5Util {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*public static void main(String[] args) {
|
||||
System.out.println(encrypt(encrypt("123456")));
|
||||
}*/
|
||||
|
Reference in New Issue
Block a user