Note that the detail message associated with
+ * {@code cause} is not automatically incorporated in
+ * this exception's detail message.
+ *
+ * @param code error code
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A null value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public RemoteException(int code, String message, Throwable cause) {
+ super(message, cause);
+ this.code = code;
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and
+ * cause.
Note that the detail message associated with
+ * {@code cause} is not automatically incorporated in
+ * this exception's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A null value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public RemoteException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new exception with the specified cause and a detail
+ * message of (cause==null ? null : cause.toString()) (which
+ * typically contains the class and detail message of cause).
+ * This constructor is useful for exceptions that are little more than
+ * wrappers for other throwables (for example, {@link
+ * PrivilegedActionException}).
+ *
+ * @param code error code
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A null value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public RemoteException(int code, Throwable cause) {
+ super(cause);
+ this.code = code;
+ }
+
+ /**
+ * Constructs a new exception with the specified cause and a detail
+ * message of (cause==null ? null : cause.toString()) (which
+ * typically contains the class and detail message of cause).
+ * This constructor is useful for exceptions that are little more than
+ * wrappers for other throwables (for example, {@link
+ * PrivilegedActionException}).
+ *
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A null value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public RemoteException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/client/http/HttpClientImpl.java b/common/src/main/java/cn/icanci/ddk/common/client/http/HttpClientImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..9fbb3be93e88246f5526287adf26fb2cc75b93cc
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/client/http/HttpClientImpl.java
@@ -0,0 +1,98 @@
+package cn.icanci.ddk.common.client.http;
+
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
+import cn.icanci.ddk.common.client.AbstractRetryClient;
+import cn.icanci.ddk.common.client.Client;
+
+import java.util.Map;
+import java.util.concurrent.*;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Maps;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/11/14 22:14
+ */
+@SuppressWarnings("all")
+public class HttpClientImpl extends AbstractRetryClient {
+
+ private static final Logger logger = LoggerFactory.getLogger(HttpClientImpl.class);
+
+ private static final long DEFAULT_TIMEOUT = 3;
+ private static final TimeUnit DEFAULT_TIMEUNIT = TimeUnit.SECONDS;
+
+ public static Client getInstance() {
+ return HttpClientImplHolder.CLIENT_IMPL;
+ }
+
+ private static final class HttpClientImplHolder {
+ private static final HttpClientImpl CLIENT_IMPL = new HttpClientImpl();
+ }
+
+ /**
+ * Do execute v.
+ *
+ * @param request the request
+ * @param clazz the clazz
+ * @return the v
+ */
+ @Override
+ protected V doExecute(RpcRequest request, Class clazz) throws ExecutionException, InterruptedException, TimeoutException {
+ FutureTask task = new FutureTask(new HttpCallRunner(request, clazz));
+ HTTP_POOL.execute(task);
+ return task.get(request.getReadTimeOut(), request.getTimeUnit());
+ }
+
+ /**
+ * 请求执行器
+ *
+ * @param 泛型
+ */
+ private static class HttpCallRunner implements Callable {
+ private final RpcRequest request;
+ private final Class clazz;
+
+ public HttpCallRunner(RpcRequest request, Class clazz) {
+ this.request = request;
+ this.clazz = clazz;
+ }
+
+ @Override
+ public V call() throws Exception {
+ switch (request.getMethod()) {
+ case GET:
+ return doGet(request, clazz);
+ case POST:
+ return doPost(request, clazz);
+ default:
+ throw new IllegalAccessException("Un Support Http Method:" + request.getMethod());
+ }
+ }
+
+ private V doGet(RpcRequest request, Class clazz) {
+ Map body = Maps.newHashMap();
+ if (request.getBody() instanceof Map) {
+ body = (Map) request.getBody();
+ }
+ String getBody = HttpUtil.createGet(request.getUrl()) //
+ .addHeaders(request.getHeaders())//
+ .form(body)//
+ .execute().body();
+ logger.info("[{}][HttpCallRunner][doGet] request:{},resp:{}", Thread.currentThread().getName(), JSONUtil.toJsonStr(request), getBody);
+ return JSONUtil.toBean(getBody, clazz);
+ }
+
+ private V doPost(RpcRequest request, Class clazz) {
+ String postBody = HttpUtil.createPost(request.getUrl()) //
+ .addHeaders(request.getHeaders())//
+ .body(JSONUtil.toJsonStr(request.getBody()))//
+ .execute().body();
+ logger.info("[{}][HttpCallRunner][doPost] request:{},resp:{}", Thread.currentThread().getName(), JSONUtil.toJsonStr(request), postBody);
+ return JSONUtil.toBean(postBody, clazz);
+ }
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/enums/LogOperatorTypeEnum.java b/common/src/main/java/cn/icanci/ddk/common/enums/LogOperatorTypeEnum.java
new file mode 100644
index 0000000000000000000000000000000000000000..0d51d864264b0bf42c6257aa658075d9cc57b1ed
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/enums/LogOperatorTypeEnum.java
@@ -0,0 +1,8 @@
+package cn.icanci.ddk.common.enums;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:37
+ */
+public enum LogOperatorTypeEnum {
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/enums/ModuleTypeEnum.java b/common/src/main/java/cn/icanci/ddk/common/enums/ModuleTypeEnum.java
new file mode 100644
index 0000000000000000000000000000000000000000..524bc864aa4c4b78f6361a48b5b5d99d9255d19d
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/enums/ModuleTypeEnum.java
@@ -0,0 +1,9 @@
+package cn.icanci.ddk.common.enums;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:37
+ */
+public enum ModuleTypeEnum {
+
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/TextValue.java b/common/src/main/java/cn/icanci/ddk/common/model/TextValue.java
new file mode 100644
index 0000000000000000000000000000000000000000..35b9675a60c62ebe1bd3cf62f3da4da3fd023383
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/TextValue.java
@@ -0,0 +1,67 @@
+package cn.icanci.ddk.common.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/11/12 16:38
+ */
+public class TextValue implements Serializable {
+ private static final long serialVersionUID = -3727976523289870284L;
+
+ private String label;
+ private Object value;
+ private T data;
+ private List list;
+
+ public TextValue(String label, Object value) {
+ this.label = label;
+ this.value = value;
+ }
+
+ public TextValue(String label, Object value, T data) {
+ this.label = label;
+ this.value = value;
+ this.data = data;
+ }
+
+ public TextValue(String label, Object value, T data, List list) {
+ this.label = label;
+ this.value = value;
+ this.data = data;
+ this.list = list;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+
+ public List getList() {
+ return list;
+ }
+
+ public void setList(List list) {
+ this.list = list;
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/config/AppConfigVO.java b/common/src/main/java/cn/icanci/ddk/common/model/config/AppConfigVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..1aa9a40f27cfe9425cfe8d2a6ece61897fe7a1e2
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/config/AppConfigVO.java
@@ -0,0 +1,64 @@
+package cn.icanci.ddk.common.model.config;
+
+import java.util.StringJoiner;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:44
+ */
+public class AppConfigVO extends BaseVO {
+ /**
+ * 配置名称
+ */
+ private String appConfigName;
+ /**
+ * 配置值
+ */
+ private String appConfigValue;
+ /**
+ * 配置类型
+ */
+ private String appConfigType;
+ /**
+ * 项目关联uuid
+ */
+ private String appUuid;
+
+ public String getAppConfigName() {
+ return appConfigName;
+ }
+
+ public void setAppConfigName(String appConfigName) {
+ this.appConfigName = appConfigName;
+ }
+
+ public String getAppConfigValue() {
+ return appConfigValue;
+ }
+
+ public void setAppConfigValue(String appConfigValue) {
+ this.appConfigValue = appConfigValue;
+ }
+
+ public String getAppConfigType() {
+ return appConfigType;
+ }
+
+ public void setAppConfigType(String appConfigType) {
+ this.appConfigType = appConfigType;
+ }
+
+ public String getAppUuid() {
+ return appUuid;
+ }
+
+ public void setAppUuid(String appUuid) {
+ this.appUuid = appUuid;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("appConfigName=" + appConfigName).add("appConfigValue=" + appConfigValue).add("appConfigType=" + appConfigType).add("appUuid=" + appUuid)
+ .toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/config/AppVO.java b/common/src/main/java/cn/icanci/ddk/common/model/config/AppVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..7fae76f8c10bf94675e49130ed4a310b984b6564
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/config/AppVO.java
@@ -0,0 +1,53 @@
+package cn.icanci.ddk.common.model.config;
+
+import java.util.StringJoiner;
+
+/**
+ * 项目组项目
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:42
+ */
+public class AppVO extends BaseVO {
+ /**
+ * 项目id,全局唯一
+ */
+ private String appUniqueId;
+ /**
+ * 项目名字
+ */
+ private String appName;
+ /**
+ * 项目组关联uuid
+ */
+ private String teamUuid;
+
+ public String getAppUniqueId() {
+ return appUniqueId;
+ }
+
+ public void setAppUniqueId(String appUniqueId) {
+ this.appUniqueId = appUniqueId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getTeamUuid() {
+ return teamUuid;
+ }
+
+ public void setTeamUuid(String teamUuid) {
+ this.teamUuid = teamUuid;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("appUniqueId=" + appUniqueId).add("appName=" + appName).add("teamUuid=" + teamUuid).toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/config/BaseVO.java b/common/src/main/java/cn/icanci/ddk/common/model/config/BaseVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..7fae4b1f8fb4507e84b5b53fea50a47397fa3bba
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/config/BaseVO.java
@@ -0,0 +1,113 @@
+package cn.icanci.ddk.common.model.config;
+
+import java.util.Date;
+import java.util.StringJoiner;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+ * 基础模型
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:37
+ */
+public class BaseVO {
+ /**
+ * 数据库id
+ */
+ private Long id;
+
+ /**
+ * 雪花算法随机UUID
+ */
+ private String uuid;
+
+ /**
+ * 功能描述
+ */
+ private String desc;
+
+ /**
+ * 创建时间
+ */
+ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /**
+ * 更新时间
+ */
+ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+
+ /**
+ * 状态 0有效,1无效
+ */
+ private int isDelete;
+
+ /**
+ * 环境
+ */
+ private String env;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public int getIsDelete() {
+ return isDelete;
+ }
+
+ public void setIsDelete(int isDelete) {
+ this.isDelete = isDelete;
+ }
+
+ public String getEnv() {
+ return env;
+ }
+
+ public void setEnv(String env) {
+ this.env = env;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("id=" + id).add("uuid=" + uuid).add("desc=" + desc).add("createTime=" + createTime).add("updateTime=" + updateTime)
+ .add("isDelete=" + isDelete).add("env=" + env).toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/config/GroupVO.java b/common/src/main/java/cn/icanci/ddk/common/model/config/GroupVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..ebd45a80ca5f95f23f2d4a58024b84fd8a6ab023
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/config/GroupVO.java
@@ -0,0 +1,41 @@
+package cn.icanci.ddk.common.model.config;
+
+import java.util.StringJoiner;
+
+/**
+ * 事业群
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:39
+ */
+public class GroupVO extends BaseVO {
+ /**
+ * 事业群组id,唯一
+ */
+ private String groupId;
+ /**
+ * 事业群组名字
+ */
+ private String groupName;
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public String getGroupName() {
+ return groupName;
+ }
+
+ public void setGroupName(String groupName) {
+ this.groupName = groupName;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("groupId=" + groupId).add("groupName=" + groupName).toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/config/NoticeConfigVO.java b/common/src/main/java/cn/icanci/ddk/common/model/config/NoticeConfigVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..c574a011505f3dbfa6037e63077de859e3b876d5
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/config/NoticeConfigVO.java
@@ -0,0 +1,64 @@
+package cn.icanci.ddk.common.model.config;
+
+import java.util.StringJoiner;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:46
+ */
+public class NoticeConfigVO extends BaseVO {
+ /**
+ * 通知配置名称
+ */
+ private String noticeConfigName;
+ /**
+ * 通知配置资源
+ */
+ private String noticeConfigResource;
+ /**
+ * 测试配置值,可选;因为可能通过配置值进行特殊处理
+ */
+ private String noticeTestValue;
+ /**
+ * 项目关联uuid,多个以,分割
+ */
+ private String appUuids;
+
+ public String getNoticeConfigName() {
+ return noticeConfigName;
+ }
+
+ public void setNoticeConfigName(String noticeConfigName) {
+ this.noticeConfigName = noticeConfigName;
+ }
+
+ public String getNoticeConfigResource() {
+ return noticeConfigResource;
+ }
+
+ public void setNoticeConfigResource(String noticeConfigResource) {
+ this.noticeConfigResource = noticeConfigResource;
+ }
+
+ public String getNoticeTestValue() {
+ return noticeTestValue;
+ }
+
+ public void setNoticeTestValue(String noticeTestValue) {
+ this.noticeTestValue = noticeTestValue;
+ }
+
+ public String getAppUuids() {
+ return appUuids;
+ }
+
+ public void setAppUuids(String appUuids) {
+ this.appUuids = appUuids;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("noticeConfigName=" + noticeConfigName).add("noticeConfigResource=" + noticeConfigResource).add("noticeTestValue=" + noticeTestValue)
+ .add("appUuids=" + appUuids).toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/config/RegisterVO.java b/common/src/main/java/cn/icanci/ddk/common/model/config/RegisterVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..7323569a99660c1f55f580d2235faac6bc937d0c
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/config/RegisterVO.java
@@ -0,0 +1,81 @@
+package cn.icanci.ddk.common.model.config;
+
+import java.util.Date;
+import java.util.StringJoiner;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/11/22 21:35
+ */
+public class RegisterVO extends BaseVO {
+ /**
+ * SDK 服务ip地址
+ */
+ private String clientAddress;
+ /**
+ * SDK 服务端口地址
+ */
+ private Integer clientPort;
+ /**
+ * SDK 服务服务唯一标识
+ */
+ private String appUniqueId;
+ /**
+ * 服务注册时间
+ */
+ private Date registerTime;
+ /**
+ * 上次注册更新时间
+ */
+ private Date lastUpdateTime;
+
+ public String getClientAddress() {
+ return clientAddress;
+ }
+
+ public void setClientAddress(String clientAddress) {
+ this.clientAddress = clientAddress;
+ }
+
+ public int getClientPort() {
+ return clientPort;
+ }
+
+ public void setClientPort(int clientPort) {
+ this.clientPort = clientPort;
+ }
+
+ public void setClientPort(Integer clientPort) {
+ this.clientPort = clientPort;
+ }
+
+ public String getAppUniqueId() {
+ return appUniqueId;
+ }
+
+ public void setAppUniqueId(String appUniqueId) {
+ this.appUniqueId = appUniqueId;
+ }
+
+ public Date getRegisterTime() {
+ return registerTime;
+ }
+
+ public void setRegisterTime(Date registerTime) {
+ this.registerTime = registerTime;
+ }
+
+ public Date getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public void setLastUpdateTime(Date lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("clientAddress=" + clientAddress).add("clientPort=" + clientPort).add("appUniqueId=" + appUniqueId).add("registerTime=" + registerTime)
+ .add("lastUpdateTime=" + lastUpdateTime).toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/config/TeamVO.java b/common/src/main/java/cn/icanci/ddk/common/model/config/TeamVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..77fe373b045005be5c515cf25e21b62cfcefb297
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/config/TeamVO.java
@@ -0,0 +1,53 @@
+package cn.icanci.ddk.common.model.config;
+
+import java.util.StringJoiner;
+
+/**
+ * 项目组
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 17:40
+ */
+public class TeamVO extends BaseVO {
+ /**
+ * 项目组id,唯一
+ */
+ private String teamId;
+ /**
+ * 项目组名字
+ */
+ private String teamName;
+ /**
+ * 事业群关联uuid
+ */
+ private String groupUuid;
+
+ public String getTeamId() {
+ return teamId;
+ }
+
+ public void setTeamId(String teamId) {
+ this.teamId = teamId;
+ }
+
+ public String getTeamName() {
+ return teamName;
+ }
+
+ public void setTeamName(String teamName) {
+ this.teamName = teamName;
+ }
+
+ public String getGroupUuid() {
+ return groupUuid;
+ }
+
+ public void setGroupUuid(String groupUuid) {
+ this.groupUuid = groupUuid;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("teamId=" + teamId).add("teamName=" + teamName).add("groupUuid=" + groupUuid).toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/model/log/LogOperateVO.java b/common/src/main/java/cn/icanci/ddk/common/model/log/LogOperateVO.java
new file mode 100644
index 0000000000000000000000000000000000000000..beff918a5a674b874c611a7f9fce13ec093538ef
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/model/log/LogOperateVO.java
@@ -0,0 +1,94 @@
+package cn.icanci.ddk.common.model.log;
+
+import cn.icanci.ddk.common.enums.LogOperatorTypeEnum;
+import cn.icanci.ddk.common.enums.ModuleTypeEnum;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/10/30 21:13
+ */
+public class LogOperateVO {
+ /** 编号 */
+ private String id;
+
+ /** 操作模块 */
+ private ModuleTypeEnum module;
+
+ /** 对象编号 */
+ private String targetId;
+
+ /**
+ * 操作类型
+ */
+ private LogOperatorTypeEnum operatorType;
+
+ /** 操作内容 */
+ private String content;
+
+ /** 创建时间 */
+ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /** 环境 */
+ String env;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public ModuleTypeEnum getModule() {
+ return module;
+ }
+
+ public void setModule(ModuleTypeEnum module) {
+ this.module = module;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public LogOperatorTypeEnum getOperatorType() {
+ return operatorType;
+ }
+
+ public void setOperatorType(LogOperatorTypeEnum operatorType) {
+ this.operatorType = operatorType;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getEnv() {
+ return env;
+ }
+
+ public void setEnv(String env) {
+ this.env = env;
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/package-info.java b/common/src/main/java/cn/icanci/ddk/common/package-info.java
new file mode 100644
index 0000000000000000000000000000000000000000..76beabff3ca27c51875f005fff0a86115d9765fd
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/12/11 16:42
+ */
+package cn.icanci.ddk.common;
\ No newline at end of file
diff --git a/common/src/main/java/cn/icanci/ddk/common/result/R.java b/common/src/main/java/cn/icanci/ddk/common/result/R.java
new file mode 100644
index 0000000000000000000000000000000000000000..a126d4a8f27fa3365915d1ca2b38a441bbd9b475
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/result/R.java
@@ -0,0 +1,154 @@
+package cn.icanci.ddk.common.result;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringJoiner;
+
+/**
+ * 通用返回结果
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/04/04 19:11
+ */
+public class R implements Serializable {
+ private static final long serialVersionUID = -1343013883236338104L;
+ /** 是否成功 */
+ private boolean ok;
+ /** 错误码 */
+ private int code;
+ /** 错误信息 */
+ private String message;
+ /** 返回前端数据 */
+ private Map data = new HashMap<>();
+
+ public R() {
+ }
+
+ /**
+ * Builder
+ *
+ * @return Builder
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * BuilderOK
+ *
+ * @return Builder
+ */
+ public static Builder builderOk() {
+ return new Builder().BuilderOK();
+ }
+
+ /**
+ * BuilderFail
+ *
+ * @return Builder
+ */
+ public static Builder builderFail() {
+ return new Builder().BuilderFail();
+ }
+
+ public static class Builder {
+ /** 是否成功 */
+ private boolean ok;
+ /** 错误码 */
+ private int code;
+ /** 错误信息 */
+ private String message;
+ /** 返回前端数据 */
+ private Map data = new HashMap();
+
+ private Builder() {
+
+ }
+
+ public Builder(boolean ok, int code) {
+ this.ok = ok;
+ this.code = code;
+ }
+
+ private Builder BuilderOK() {
+ this.ok = true;
+ this.code = ResultCodes.SUCCESS;
+ return this;
+ }
+
+ private Builder BuilderFail() {
+ this.ok = false;
+ this.code = ResultCodes.FAIL_SYSTEM;
+ return this;
+ }
+
+ public Builder message(String val) {
+ message = val;
+ return this;
+ }
+
+ public Builder code(Integer val) {
+ code = val;
+ return this;
+ }
+
+ public Builder data(String key, Object value) {
+ data.put(key, value);
+ return this;
+ }
+
+ public Builder data(Map map) {
+ data = map;
+ return this;
+ }
+
+ public R build() {
+ return new R(this);
+ }
+ }
+
+ private R(Builder builder) {
+ this.ok = builder.ok;
+ this.code = builder.code;
+ this.message = builder.message;
+ this.data = builder.data;
+ }
+
+ public boolean isOk() {
+ return ok;
+ }
+
+ public void setOk(boolean ok) {
+ this.ok = ok;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public Map getData() {
+ return data;
+ }
+
+ public void setData(Map data) {
+ this.data = data;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(",").add("ok=" + ok).add("code=" + code).add("message=" + message).add("data=" + data).toString();
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/result/ResultCodes.java b/common/src/main/java/cn/icanci/ddk/common/result/ResultCodes.java
new file mode 100644
index 0000000000000000000000000000000000000000..41536542dfed99891e0afad3e2424ce53c264422
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/result/ResultCodes.java
@@ -0,0 +1,22 @@
+package cn.icanci.ddk.common.result;
+
+/**
+ * code集合
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/04/04 20:09
+ */
+public interface ResultCodes {
+ /** 成功 */
+ int SUCCESS = 200;
+ /** 400异常 */
+ int FAIL_404 = 404;
+ /** 500异常 */
+ int FAIL_500 = 500;
+ /** 账号异常 */
+ int ACCOUNT_ERROR_CODE = 1000;
+ /** 账号登录超时 */
+ int LOGIN_TIME_OUT = 1001;
+ /** 默认失败原因 */
+ int FAIL_SYSTEM = 9999;
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/result/ResultMessages.java b/common/src/main/java/cn/icanci/ddk/common/result/ResultMessages.java
new file mode 100644
index 0000000000000000000000000000000000000000..63275580b680aaa2789713667638cf4a6b884806
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/result/ResultMessages.java
@@ -0,0 +1,11 @@
+package cn.icanci.ddk.common.result;
+
+/**
+ * message集合
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/04/04 20:09
+ */
+public interface ResultMessages {
+ String ACCOUNT_ERROR_MESSAGE = "账号%s异常,请重新登录";
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/utils/DateUtils.java b/common/src/main/java/cn/icanci/ddk/common/utils/DateUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..1c5da7908d411975c5b09b6edd1b583bc54fb087
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/utils/DateUtils.java
@@ -0,0 +1,90 @@
+package cn.icanci.ddk.common.utils;
+
+import cn.hutool.core.date.DateUtil;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * 时间工具类
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/11/16 23:06
+ */
+public final class DateUtils {
+
+ public enum FormatType {
+ /** YYYY */
+ YYYY("yyyy"),
+
+ /** MM_DD */
+ MM_DD("MM-dd"),
+
+ /** HH_MM */
+ HH_MM("HH:mm"),
+
+ /** HH_MM_SS */
+ HH_MM_SS("HH:mm:ss"),
+
+ /** YYYY_MM */
+ YYYY_MM("yyyy-MM"),
+
+ /** YYYY_MM_DD */
+ YYYY_MM_DD("yyyy-MM-dd"),
+
+ /** YYYY_MM_DD_HH */
+ YYYY_MM_DD_HH("yyyy-MM-dd HH"),
+
+ /** YYYY_MM_DD_HH_MM */
+ YYYY_MM_DD_HH_MM("yyyy-MM-dd HH:mm"),
+
+ /** YYYY_MM_DD_HH_MM_SS */
+ YYYY_MM_DD_HH_MM_SS("yyyy-MM-dd HH:mm:ss"),
+
+ ;
+
+ private final String code;
+
+ public String getCode() {
+ return code;
+ }
+
+ FormatType(String code) {
+ this.code = code;
+ }
+ }
+
+ /**
+ * 转换日期
+ * TODO Hutool 的时间格式化是线程安全的,因为每次都创建一个SimpleDateFormat对象,但是性能略差
+ *
+ * @param dateString the time
+ * @param formatType formatType
+ * @return date
+ */
+ public static Date parse(String dateString, FormatType formatType) {
+ if (StringUtils.isBlank(dateString)) {
+ return null;
+ }
+ return DateUtil.parse(dateString, formatType.getCode());
+ }
+
+ /**
+ * 格式化日期
+ *
+ * @param date the time
+ * @param formatType formatType
+ * @return date
+ */
+ public static String format(Date date, FormatType formatType) {
+ if (formatType == null) {
+ return null;
+ }
+ try {
+ return DateUtil.format(date, formatType.getCode());
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/java/cn/icanci/ddk/common/utils/FieldUtils.java b/common/src/main/java/cn/icanci/ddk/common/utils/FieldUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..113f47c36501cf897052559135feb9ebc52c4ea8
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/utils/FieldUtils.java
@@ -0,0 +1,28 @@
+package cn.icanci.ddk.common.utils;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/11/18 23:26
+ */
+public class FieldUtils {
+ /**
+ * 获取本类及其父类的字段属性
+ *
+ * @param clazz 当前类对象
+ * @return 字段数组
+ */
+ public static Field[] getAllFields(Class> clazz) {
+ List fieldList = new ArrayList<>();
+ while (clazz != null) {
+ fieldList.addAll(new ArrayList<>(Arrays.asList(clazz.getDeclaredFields())));
+ clazz = clazz.getSuperclass();
+ }
+ Field[] fields = new Field[fieldList.size()];
+ return fieldList.toArray(fields);
+ }
+}
diff --git a/common/src/main/java/cn/icanci/ddk/common/utils/IPUtils.java b/common/src/main/java/cn/icanci/ddk/common/utils/IPUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..36b1707f2fbbe8e59e52c6384b2eed9a3955ac70
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/utils/IPUtils.java
@@ -0,0 +1,54 @@
+package cn.icanci.ddk.common.utils;
+
+import java.net.Inet4Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.Enumeration;
+
+/**
+ * ip 地址工具类
+ *
+ * @author icanci
+ * @since 1.0 Created in 2022/11/20 15:37
+ */
+public class IPUtils {
+
+ /**
+ * 获取主机地址
+ */
+ public static String getHostIpAddress() {
+ String realIp = null;
+ try {
+ InetAddress address = InetAddress.getLocalHost();
+ // 如果是回环网卡地址, 则获取ipv4地址
+ if (address.isLoopbackAddress()) {
+ address = getInet4Address();
+ }
+ realIp = address.getHostAddress();
+ } catch (Exception e) {
+ // no op
+ }
+ return realIp;
+ }
+
+ /**
+ * 获取IPV4网络配置
+ */
+ private static InetAddress getInet4Address() throws SocketException {
+ // 获取所有网卡信息
+ Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();
+ while (networkInterfaces.hasMoreElements()) {
+ NetworkInterface netInterface = networkInterfaces.nextElement();
+ Enumeration addresses = netInterface.getInetAddresses();
+ while (addresses.hasMoreElements()) {
+ InetAddress ip = addresses.nextElement();
+ if (ip instanceof Inet4Address) {
+ return ip;
+ }
+ }
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/common/src/main/java/cn/icanci/ddk/common/utils/PropertiesUtil.java b/common/src/main/java/cn/icanci/ddk/common/utils/PropertiesUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..88144f03dc1b7ec0fdb4e7dc3183fdebcb265076
--- /dev/null
+++ b/common/src/main/java/cn/icanci/ddk/common/utils/PropertiesUtil.java
@@ -0,0 +1,53 @@
+package cn.icanci.ddk.common.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * @author icanci
+ * @since 1.0 Created in 2022/11/15 21:38
+ */
+public class PropertiesUtil {
+ /**
+ * The constant confProperties.
+ */
+ private static Properties confProperties;
+
+ /**
+ * 初始化
+ *
+ * @param classLoader classLoader
+ * @param sourcePath sourcePath
+ */
+ private static void init(ClassLoader classLoader, String sourcePath) {
+ if (confProperties == null) {
+ confProperties = new Properties();
+
+ try (InputStream in = classLoader.getResourceAsStream(sourcePath)) {
+ confProperties.load(in);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Get string.
+ *
+ * @param classLoader 类加载器
+ * @return the string
+ */
+ public static Map getPropertyMap(ClassLoader classLoader, String sourcePath) {
+ // 初始化加载
+ init(classLoader, sourcePath);
+
+ Map propertyMap = new HashMap<>();
+ for (Map.Entry