diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/aspect/OperatorLogAspect.java b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/aspect/OperatorLogAspect.java index 3110639e..02a671db 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/aspect/OperatorLogAspect.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/aspect/OperatorLogAspect.java @@ -93,26 +93,30 @@ public class OperatorLogAspect { * @param exception exception */ private void saveLog(long start, OperatorLog o, Object ret, Throwable exception) { - // 请求信息 - Map extra = OperatorLogs.get(); - if (!OperatorLogs.isSave(extra)) { - return; + try { + // 请求信息 + Map extra = OperatorLogs.get(); + if (!OperatorLogs.isSave(extra)) { + return; + } + OperatorLogModel model = new OperatorLogModel(); + // 填充使用时间 + this.fillUseTime(model, start); + // 填充用户信息 + this.fillUserInfo(model); + // 填充请求信息 + this.fillRequest(model); + // 填充结果信息 + this.fillResult(model, o, ret, exception); + // 填充拓展信息 + this.fillExtra(model, extra); + // 填充日志 + this.fillLogInfo(model, extra, o); + // 插入日志 + this.asyncSaveLog(model); + } catch (Exception e) { + log.error("操作日志保存失败", e); } - OperatorLogModel model = new OperatorLogModel(); - // 填充使用时间 - this.fillUseTime(model, start); - // 填充用户信息 - this.fillUserInfo(model); - // 填充请求信息 - this.fillRequest(model); - // 填充结果信息 - this.fillResult(model, o, ret, exception); - // 填充拓展信息 - this.fillExtra(model, extra); - // 填充日志 - this.fillLogInfo(model, extra, o); - // 插入日志 - this.asyncSaveLog(model); } /** @@ -151,7 +155,7 @@ public class OperatorLogAspect { String address = Servlets.getRemoteAddr(request); model.setAddress(address); model.setLocation(IpUtils.getLocation(address)); - model.setUserAgent(Servlets.getUserAgent(request)); + model.setUserAgent(Strings.retain(Servlets.getUserAgent(request), operatorLogConfig.getUserAgentLength())); }); } @@ -189,7 +193,9 @@ public class OperatorLogAspect { */ private void fillExtra(OperatorLogModel model, Map extra) { // 脱敏 - model.setExtra(JSON.toJSONString(extra, desensitizeValueFilter)); + if (extra != null) { + model.setExtra(JSON.toJSONString(extra, desensitizeValueFilter)); + } } /** diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/config/OperatorLogConfig.java b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/config/OperatorLogConfig.java index 55cd69c1..fc22df65 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/config/OperatorLogConfig.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/config/OperatorLogConfig.java @@ -19,7 +19,13 @@ public class OperatorLogConfig { */ private Integer errorMessageLength; + /** + * userAgent 长度 + */ + private Integer userAgentLength; + public OperatorLogConfig() { this.errorMessageLength = 255; + this.userAgentLength = 128; } } diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/holder/OperatorTypeHolder.java b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/holder/OperatorTypeHolder.java index c077f5b5..bad0b116 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/holder/OperatorTypeHolder.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/java/com/orion/ops/framework/biz/operator/log/core/holder/OperatorTypeHolder.java @@ -32,11 +32,10 @@ public class OperatorTypeHolder { /** * 设置类型 * - * @param key key * @param type type */ - public static void set(String key, OperatorType type) { - TYPES.put(key, type); + public static void set(OperatorType type) { + TYPES.put(type.getType(), type); } } diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/resources/META-INF/spring-configuration-metadata.json b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/resources/META-INF/spring-configuration-metadata.json index ecc35984..863e4ff5 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/resources/META-INF/spring-configuration-metadata.json +++ b/orion-ops-framework/orion-ops-spring-boot-starter-biz-operator-log/src/main/resources/META-INF/spring-configuration-metadata.json @@ -10,8 +10,14 @@ { "name": "orion.operator-log.error-message-length", "type": "java.lang.Integer", - "description": "日志打印模型.", + "description": "错误信息长度.", "defaultValue": "255" + }, + { + "name": "orion.operator-log.user-agent-length", + "type": "java.lang.Integer", + "description": "userAgent 长度.", + "defaultValue": "128" } ] } \ No newline at end of file diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/domain/BaseDO.java b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/domain/BaseDO.java index ed85b82a..72fb91f9 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/domain/BaseDO.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/domain/BaseDO.java @@ -20,28 +20,28 @@ import java.util.Date; @Data public class BaseDO implements Serializable { - @TableField(fill = FieldFill.INSERT) @Schema(description = "创建时间") + @TableField(fill = FieldFill.INSERT) private Date createTime; - @TableField(fill = FieldFill.INSERT_UPDATE) @Schema(description = "修改时间") + @TableField(fill = FieldFill.INSERT_UPDATE) private Date updateTime; - @TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR) @Schema(description = "创建人") + @TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR) private String creator; - @TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR) @Schema(description = "修改人") + @TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR) private String updater; /** * @see com.orion.ops.framework.common.constant.Const#NOT_DELETE * @see com.orion.ops.framework.common.constant.Const#IS_DELETED */ - @TableLogic @Schema(description = "是否删除 0未删除 1已删除") + @TableLogic @TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.TINYINT) private Boolean deleted; diff --git a/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java b/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java index d156ea62..cbc3097f 100644 --- a/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java +++ b/orion-ops-launch/src/main/java/com/orion/ops/launch/generator/engine/VelocityTemplateEngine.java @@ -399,7 +399,7 @@ public class VelocityTemplateEngine extends AbstractTemplateEngine { * @return 是否为后端缓存文件 */ private boolean isServerCacheFile(String templatePath) { - return templatePath.contains("orion-server-cache"); + return templatePath.contains("orion-server-module-cache"); } /** diff --git a/orion-ops-launch/src/main/resources/application.yaml b/orion-ops-launch/src/main/resources/application.yaml index 7e6e89af..de3cb881 100644 --- a/orion-ops-launch/src/main/resources/application.yaml +++ b/orion-ops-launch/src/main/resources/application.yaml @@ -197,4 +197,5 @@ orion: queue-capacity: 30 keep-alive-seconds: 180 operator-log: - error-message-length: 255 \ No newline at end of file + error-message-length: 255 + user-agent-length: 128 \ No newline at end of file diff --git a/orion-ops-launch/src/main/resources/templates/orion-server-module-mapper.xml.vm b/orion-ops-launch/src/main/resources/templates/orion-server-module-mapper.xml.vm index 54610fd9..2fdcaace 100644 --- a/orion-ops-launch/src/main/resources/templates/orion-server-module-mapper.xml.vm +++ b/orion-ops-launch/src/main/resources/templates/orion-server-module-mapper.xml.vm @@ -15,14 +15,14 @@ #end #end - #foreach($field in ${table.commonFields})##生成公共字段 - - #end #foreach($field in ${table.fields}) #if(!${field.keyFlag})##生成普通字段 #end #end + #foreach($field in ${table.commonFields})##生成公共字段 + + #end #end diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/define/HostCacheKeyDefine.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/define/cache/HostCacheKeyDefine.java similarity index 94% rename from orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/define/HostCacheKeyDefine.java rename to orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/define/cache/HostCacheKeyDefine.java index 560da718..a4edf024 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/define/HostCacheKeyDefine.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/define/cache/HostCacheKeyDefine.java @@ -1,4 +1,4 @@ -package com.orion.ops.module.asset.define; +package com.orion.ops.module.asset.define.cache; import com.orion.lang.define.cache.CacheKeyBuilder; import com.orion.lang.define.cache.CacheKeyDefine; diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostIdentityServiceImpl.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostIdentityServiceImpl.java index e6c53281..76ae24a5 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostIdentityServiceImpl.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostIdentityServiceImpl.java @@ -15,7 +15,7 @@ import com.orion.ops.module.asset.convert.HostIdentityConvert; import com.orion.ops.module.asset.dao.HostConfigDAO; import com.orion.ops.module.asset.dao.HostIdentityDAO; import com.orion.ops.module.asset.dao.HostKeyDAO; -import com.orion.ops.module.asset.define.HostCacheKeyDefine; +import com.orion.ops.module.asset.define.cache.HostCacheKeyDefine; import com.orion.ops.module.asset.entity.domain.HostIdentityDO; import com.orion.ops.module.asset.entity.domain.HostKeyDO; import com.orion.ops.module.asset.entity.dto.HostIdentityCacheDTO; diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostKeyServiceImpl.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostKeyServiceImpl.java index 917631c9..0253e2ee 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostKeyServiceImpl.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/HostKeyServiceImpl.java @@ -14,7 +14,7 @@ import com.orion.ops.module.asset.convert.HostKeyConvert; import com.orion.ops.module.asset.dao.HostConfigDAO; import com.orion.ops.module.asset.dao.HostIdentityDAO; import com.orion.ops.module.asset.dao.HostKeyDAO; -import com.orion.ops.module.asset.define.HostCacheKeyDefine; +import com.orion.ops.module.asset.define.cache.HostCacheKeyDefine; import com.orion.ops.module.asset.entity.domain.HostKeyDO; import com.orion.ops.module.asset.entity.dto.HostKeyCacheDTO; import com.orion.ops.module.asset.entity.request.host.HostKeyCreateRequest; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/OperatorLogController.http b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/OperatorLogController.http new file mode 100644 index 00000000..7fc7ed88 --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/OperatorLogController.http @@ -0,0 +1,17 @@ +### 分页查询操作日志 +POST {{baseUrl}}/infra/operator-log/query +Content-Type: application/json +Authorization: {{token}} + +{ + "page": 1, + "limit": 10, + "userId": "", + "module": "", + "type": "", + "result": "", + "startTime": "", + "endTime": "" +} + +### \ No newline at end of file diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/OperatorLogController.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/OperatorLogController.java new file mode 100644 index 00000000..c3857468 --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/OperatorLogController.java @@ -0,0 +1,51 @@ +package com.orion.ops.module.infra.controller; + +import com.orion.lang.define.wrapper.DataGrid; +import com.orion.ops.framework.common.validator.group.Page; +import com.orion.ops.framework.log.core.annotation.IgnoreLog; +import com.orion.ops.framework.log.core.enums.IgnoreLogMode; +import com.orion.ops.framework.web.core.annotation.RestWrapper; +import com.orion.ops.module.infra.entity.request.operator.log.OperatorLogQueryRequest; +import com.orion.ops.module.infra.entity.vo.OperatorLogVO; +import com.orion.ops.module.infra.service.OperatorLogService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 操作日志 api + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +@Tag(name = "infra - 操作日志服务") +@Slf4j +@Validated +@RestWrapper +@RestController +@RequestMapping("/infra/operator-log") +@SuppressWarnings({"ELValidationInJSP", "SpringElInspection"}) +public class OperatorLogController { + + @Resource + private OperatorLogService operatorLogService; + + @IgnoreLog(IgnoreLogMode.RET) + @PostMapping("/query") + @Operation(summary = "分页查询操作日志") + @PreAuthorize("@ss.hasPermission('infra:operator-log:query')") + public DataGrid getOperatorLogPage(@Validated(Page.class) @RequestBody OperatorLogQueryRequest request) { + return operatorLogService.getOperatorLogPage(request); + } + +} + diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/SystemUserController.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/SystemUserController.java index 910cffba..c55f8fc9 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/SystemUserController.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/controller/SystemUserController.java @@ -3,10 +3,12 @@ package com.orion.ops.module.infra.controller; import com.orion.lang.define.wrapper.DataGrid; import com.orion.lang.define.wrapper.HttpWrapper; import com.orion.lang.utils.collect.Lists; +import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog; import com.orion.ops.framework.common.validator.group.Page; import com.orion.ops.framework.log.core.annotation.IgnoreLog; import com.orion.ops.framework.log.core.enums.IgnoreLogMode; import com.orion.ops.framework.web.core.annotation.RestWrapper; +import com.orion.ops.module.infra.define.operator.UserOperatorType; import com.orion.ops.module.infra.entity.request.user.*; import com.orion.ops.module.infra.entity.vo.SystemUserVO; import com.orion.ops.module.infra.service.SystemUserRoleService; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/convert/OperatorLogConvert.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/convert/OperatorLogConvert.java new file mode 100644 index 00000000..32e7b03a --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/convert/OperatorLogConvert.java @@ -0,0 +1,28 @@ +package com.orion.ops.module.infra.convert; + +import com.orion.ops.framework.biz.operator.log.core.model.OperatorLogModel; +import com.orion.ops.module.infra.entity.domain.OperatorLogDO; +import com.orion.ops.module.infra.entity.request.operator.log.OperatorLogQueryRequest; +import com.orion.ops.module.infra.entity.vo.OperatorLogVO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/** + * 操作日志 内部对象转换器 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +@Mapper +public interface OperatorLogConvert { + + OperatorLogConvert MAPPER = Mappers.getMapper(OperatorLogConvert.class); + + OperatorLogDO to(OperatorLogModel model); + + OperatorLogDO to(OperatorLogQueryRequest request); + + OperatorLogVO to(OperatorLogDO domain); + +} diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/dao/OperatorLogDAO.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/dao/OperatorLogDAO.java new file mode 100644 index 00000000..d5e0958d --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/dao/OperatorLogDAO.java @@ -0,0 +1,17 @@ +package com.orion.ops.module.infra.dao; + +import com.orion.ops.framework.mybatis.core.mapper.IMapper; +import com.orion.ops.module.infra.entity.domain.OperatorLogDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 操作日志 Mapper 接口 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +@Mapper +public interface OperatorLogDAO extends IMapper { + +} diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/FavoriteCacheKeyDefine.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/FavoriteCacheKeyDefine.java similarity index 91% rename from orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/FavoriteCacheKeyDefine.java rename to orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/FavoriteCacheKeyDefine.java index e5223024..cbda86b7 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/FavoriteCacheKeyDefine.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/FavoriteCacheKeyDefine.java @@ -1,4 +1,4 @@ -package com.orion.ops.module.infra.define; +package com.orion.ops.module.infra.define.cache; import com.orion.lang.define.cache.CacheKeyBuilder; import com.orion.lang.define.cache.CacheKeyDefine; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/PreferenceCacheKeyDefine.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/PreferenceCacheKeyDefine.java similarity index 92% rename from orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/PreferenceCacheKeyDefine.java rename to orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/PreferenceCacheKeyDefine.java index b1dac4e6..3ebc6c32 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/PreferenceCacheKeyDefine.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/PreferenceCacheKeyDefine.java @@ -1,4 +1,4 @@ -package com.orion.ops.module.infra.define; +package com.orion.ops.module.infra.define.cache; import com.alibaba.fastjson.JSONObject; import com.orion.lang.define.cache.CacheKeyBuilder; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/TagCacheKeyDefine.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/TagCacheKeyDefine.java similarity index 94% rename from orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/TagCacheKeyDefine.java rename to orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/TagCacheKeyDefine.java index 6cc99625..2b602cd1 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/TagCacheKeyDefine.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/TagCacheKeyDefine.java @@ -1,4 +1,4 @@ -package com.orion.ops.module.infra.define; +package com.orion.ops.module.infra.define.cache; import com.orion.lang.define.cache.CacheKeyBuilder; import com.orion.lang.define.cache.CacheKeyDefine; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/TipsCacheKeyDefine.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/TipsCacheKeyDefine.java similarity index 91% rename from orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/TipsCacheKeyDefine.java rename to orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/TipsCacheKeyDefine.java index a1ed54db..60a9e396 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/TipsCacheKeyDefine.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/TipsCacheKeyDefine.java @@ -1,4 +1,4 @@ -package com.orion.ops.module.infra.define; +package com.orion.ops.module.infra.define.cache; import com.orion.lang.define.cache.CacheKeyBuilder; import com.orion.lang.define.cache.CacheKeyDefine; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/UserCacheKeyDefine.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/UserCacheKeyDefine.java similarity index 96% rename from orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/UserCacheKeyDefine.java rename to orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/UserCacheKeyDefine.java index a9143e08..cda74851 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/UserCacheKeyDefine.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/define/cache/UserCacheKeyDefine.java @@ -1,4 +1,4 @@ -package com.orion.ops.module.infra.define; +package com.orion.ops.module.infra.define.cache; import com.orion.lang.define.cache.CacheKeyBuilder; import com.orion.lang.define.cache.CacheKeyDefine; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/domain/OperatorLogDO.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/domain/OperatorLogDO.java new file mode 100644 index 00000000..583ab432 --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/domain/OperatorLogDO.java @@ -0,0 +1,111 @@ +package com.orion.ops.module.infra.entity.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.orion.ops.framework.mybatis.core.domain.BaseDO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.util.Date; + +/** + * 操作日志 实体对象 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +@TableName(value = "operator_log", autoResultMap = true) +@Schema(name = "OperatorLogDO", description = "操作日志 实体对象") +public class OperatorLogDO extends BaseDO { + + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @Schema(description = "用户id") + @TableField("user_id") + private Long userId; + + @Schema(description = "traceId") + @TableField("trace_id") + private String traceId; + + @Schema(description = "请求ip") + @TableField("address") + private String address; + + @Schema(description = "请求地址") + @TableField("location") + private String location; + + @Schema(description = "userAgent") + @TableField("user_agent") + private String userAgent; + + @Schema(description = "模块") + @TableField("module") + private String module; + + @Schema(description = "操作类型") + @TableField("type") + private String type; + + @Schema(description = "日志") + @TableField("log_info") + private String logInfo; + + @Schema(description = "参数") + @TableField("extra") + private String extra; + + @Schema(description = "操作结果 0失败 1成功") + @TableField("result") + private Integer result; + + @Schema(description = "错误信息") + @TableField("error_message") + private String errorMessage; + + @Schema(description = "返回值") + @TableField("return_value") + private String returnValue; + + @Schema(description = "操作时间") + @TableField("duration") + private Integer duration; + + @Schema(description = "开始时间") + @TableField("start_time") + private Date startTime; + + @Schema(description = "结束时间") + @TableField("end_time") + private Date endTime; + + @Schema(description = "修改时间") + @TableField(exist = false) + private Date updateTime; + + @Schema(description = "创建人") + @TableField(exist = false) + private String creator; + + @Schema(description = "修改人") + @TableField(exist = false) + private String updater; + + @Schema(description = "是否删除 0未删除 1已删除") + @TableField(exist = false) + private Boolean deleted; + +} diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/request/operator/log/OperatorLogQueryRequest.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/request/operator/log/OperatorLogQueryRequest.java new file mode 100644 index 00000000..1e987681 --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/request/operator/log/OperatorLogQueryRequest.java @@ -0,0 +1,48 @@ +package com.orion.ops.module.infra.entity.request.operator.log; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.orion.ops.framework.common.entity.PageRequest; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import javax.validation.constraints.Size; +import java.util.Date; + +/** + * 操作日志 查询请求对象 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +@Schema(name = "OperatorLogQueryRequest", description = "操作日志 查询请求对象") +public class OperatorLogQueryRequest extends PageRequest { + + @Schema(description = "用户id") + private Long userId; + + @Size(max = 32) + @Schema(description = "模块") + private String module; + + @Size(max = 64) + @Schema(description = "操作类型") + private String type; + + @Schema(description = "操作结果 0失败 1成功") + private Integer result; + + @Schema(description = "开始时间-开区间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTimeStart; + + @Schema(description = "开始时间-闭区间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTimeEnd; + +} diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/vo/OperatorLogVO.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/vo/OperatorLogVO.java new file mode 100644 index 00000000..8543d7fb --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/vo/OperatorLogVO.java @@ -0,0 +1,79 @@ +package com.orion.ops.module.infra.entity.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 操作日志 视图响应对象 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "OperatorLogVO", description = "操作日志 视图响应对象") +public class OperatorLogVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + private Long id; + + @Schema(description = "用户id") + private Long userId; + + @Schema(description = "traceId") + private String traceId; + + @Schema(description = "请求ip") + private String address; + + @Schema(description = "请求地址") + private String location; + + @Schema(description = "userAgent") + private String userAgent; + + @Schema(description = "模块") + private String module; + + @Schema(description = "操作类型") + private String type; + + @Schema(description = "日志") + private String logInfo; + + @Schema(description = "参数") + private String extra; + + @Schema(description = "操作结果 0失败 1成功") + private Integer result; + + @Schema(description = "错误信息") + private String errorMessage; + + @Schema(description = "返回值") + private String returnValue; + + @Schema(description = "操作时间") + private Integer duration; + + @Schema(description = "开始时间") + private Date startTime; + + @Schema(description = "结束时间") + private Date endTime; + + @Schema(description = "创建时间") + private Date createTime; + +} diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/framework/service/impl/OperatorLogFrameworkServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/framework/service/impl/OperatorLogFrameworkServiceImpl.java index 63301dc6..cd2b3da3 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/framework/service/impl/OperatorLogFrameworkServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/framework/service/impl/OperatorLogFrameworkServiceImpl.java @@ -2,8 +2,11 @@ package com.orion.ops.module.infra.framework.service.impl; import com.orion.ops.framework.biz.operator.log.core.model.OperatorLogModel; import com.orion.ops.framework.biz.operator.log.core.service.OperatorLogFrameworkService; +import com.orion.ops.module.infra.service.OperatorLogService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 操作日志包 实现类 * @@ -14,9 +17,12 @@ import org.springframework.stereotype.Service; @Service public class OperatorLogFrameworkServiceImpl implements OperatorLogFrameworkService { + @Resource + private OperatorLogService operatorLogService; + @Override public void insert(OperatorLogModel log) { - System.out.println(log); + operatorLogService.addOperatorLog(log); } } diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/OperatorLogService.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/OperatorLogService.java new file mode 100644 index 00000000..179b55c0 --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/OperatorLogService.java @@ -0,0 +1,32 @@ +package com.orion.ops.module.infra.service; + +import com.orion.lang.define.wrapper.DataGrid; +import com.orion.ops.framework.biz.operator.log.core.model.OperatorLogModel; +import com.orion.ops.module.infra.entity.request.operator.log.OperatorLogQueryRequest; +import com.orion.ops.module.infra.entity.vo.OperatorLogVO; + +/** + * 操作日志 服务类 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +public interface OperatorLogService { + + /** + * 添加操作日志 + * + * @param model model + */ + void addOperatorLog(OperatorLogModel model); + + /** + * 分页查询操作日志 + * + * @param request request + * @return rows + */ + DataGrid getOperatorLogPage(OperatorLogQueryRequest request); + +} diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/AuthenticationServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/AuthenticationServiceImpl.java index c9fcfef3..edf1b2cb 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/AuthenticationServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/AuthenticationServiceImpl.java @@ -18,7 +18,7 @@ import com.orion.ops.framework.security.core.utils.SecurityUtils; import com.orion.ops.module.infra.convert.SystemUserConvert; import com.orion.ops.module.infra.dao.SystemUserDAO; import com.orion.ops.module.infra.dao.SystemUserRoleDAO; -import com.orion.ops.module.infra.define.UserCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.UserCacheKeyDefine; import com.orion.ops.module.infra.entity.domain.SystemRoleDO; import com.orion.ops.module.infra.entity.domain.SystemUserDO; import com.orion.ops.module.infra.entity.dto.LoginTokenDTO; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/FavoriteServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/FavoriteServiceImpl.java index f1f201d7..41114812 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/FavoriteServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/FavoriteServiceImpl.java @@ -8,7 +8,7 @@ import com.orion.ops.framework.redis.core.utils.RedisLists; import com.orion.ops.framework.security.core.utils.SecurityUtils; import com.orion.ops.module.infra.convert.FavoriteConvert; import com.orion.ops.module.infra.dao.FavoriteDAO; -import com.orion.ops.module.infra.define.FavoriteCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.FavoriteCacheKeyDefine; import com.orion.ops.module.infra.entity.domain.FavoriteDO; import com.orion.ops.module.infra.entity.request.favorite.FavoriteOperatorRequest; import com.orion.ops.module.infra.entity.request.favorite.FavoriteQueryRequest; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/OperatorLogServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/OperatorLogServiceImpl.java new file mode 100644 index 00000000..8b2eaf12 --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/OperatorLogServiceImpl.java @@ -0,0 +1,65 @@ +package com.orion.ops.module.infra.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.orion.lang.define.wrapper.DataGrid; +import com.orion.ops.framework.biz.operator.log.core.model.OperatorLogModel; +import com.orion.ops.module.infra.convert.OperatorLogConvert; +import com.orion.ops.module.infra.dao.OperatorLogDAO; +import com.orion.ops.module.infra.entity.domain.OperatorLogDO; +import com.orion.ops.module.infra.entity.request.operator.log.OperatorLogQueryRequest; +import com.orion.ops.module.infra.entity.vo.OperatorLogVO; +import com.orion.ops.module.infra.service.OperatorLogService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 操作日志 服务实现类 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-10-10 17:08 + */ +@Slf4j +@Service +public class OperatorLogServiceImpl implements OperatorLogService { + + @Resource + private OperatorLogDAO operatorLogDAO; + + @Override + public void addOperatorLog(OperatorLogModel model) { + // 转换 + OperatorLogDO record = OperatorLogConvert.MAPPER.to(model); + // 插入 + operatorLogDAO.insert(record); + } + + @Override + public DataGrid getOperatorLogPage(OperatorLogQueryRequest request) { + // 条件 + LambdaQueryWrapper wrapper = this.buildQueryWrapper(request); + // 查询 + return operatorLogDAO.of(wrapper) + .page(request) + .dataGrid(OperatorLogConvert.MAPPER::to); + } + + /** + * 构建查询 wrapper + * + * @param request request + * @return wrapper + */ + private LambdaQueryWrapper buildQueryWrapper(OperatorLogQueryRequest request) { + return operatorLogDAO.wrapper() + .eq(OperatorLogDO::getUserId, request.getUserId()) + .eq(OperatorLogDO::getModule, request.getModule()) + .eq(OperatorLogDO::getType, request.getType()) + .eq(OperatorLogDO::getResult, request.getResult()) + .ge(OperatorLogDO::getStartTime, request.getStartTimeStart()) + .le(OperatorLogDO::getStartTime, request.getStartTimeEnd()); + } + +} diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/PreferenceServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/PreferenceServiceImpl.java index 1742fbde..d407b9e3 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/PreferenceServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/PreferenceServiceImpl.java @@ -8,7 +8,7 @@ import com.orion.ops.framework.common.utils.Valid; import com.orion.ops.framework.redis.core.utils.RedisStrings; import com.orion.ops.framework.security.core.utils.SecurityUtils; import com.orion.ops.module.infra.dao.PreferenceDAO; -import com.orion.ops.module.infra.define.PreferenceCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.PreferenceCacheKeyDefine; import com.orion.ops.module.infra.entity.domain.PreferenceDO; import com.orion.ops.module.infra.entity.request.preference.PreferenceUpdateRequest; import com.orion.ops.module.infra.entity.vo.PreferenceVO; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserRoleServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserRoleServiceImpl.java index cad7fc3e..a73ab057 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserRoleServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserRoleServiceImpl.java @@ -8,7 +8,7 @@ import com.orion.ops.framework.redis.core.utils.RedisStrings; import com.orion.ops.module.infra.dao.SystemRoleDAO; import com.orion.ops.module.infra.dao.SystemUserDAO; import com.orion.ops.module.infra.dao.SystemUserRoleDAO; -import com.orion.ops.module.infra.define.UserCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.UserCacheKeyDefine; import com.orion.ops.module.infra.entity.domain.SystemRoleDO; import com.orion.ops.module.infra.entity.domain.SystemUserDO; import com.orion.ops.module.infra.entity.domain.SystemUserRoleDO; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserServiceImpl.java index 9c0b03a9..c43f1d84 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/SystemUserServiceImpl.java @@ -15,7 +15,7 @@ import com.orion.ops.framework.security.core.utils.SecurityUtils; import com.orion.ops.module.infra.convert.SystemUserConvert; import com.orion.ops.module.infra.dao.SystemUserDAO; import com.orion.ops.module.infra.dao.SystemUserRoleDAO; -import com.orion.ops.module.infra.define.UserCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.UserCacheKeyDefine; import com.orion.ops.module.infra.entity.domain.SystemUserDO; import com.orion.ops.module.infra.entity.request.user.*; import com.orion.ops.module.infra.entity.vo.SystemUserVO; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagRelServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagRelServiceImpl.java index 5f9b1d3b..49446e79 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagRelServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagRelServiceImpl.java @@ -8,7 +8,7 @@ import com.orion.ops.framework.redis.core.utils.RedisStrings; import com.orion.ops.module.infra.convert.TagRelConvert; import com.orion.ops.module.infra.dao.TagDAO; import com.orion.ops.module.infra.dao.TagRelDAO; -import com.orion.ops.module.infra.define.TagCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.TagCacheKeyDefine; import com.orion.ops.module.infra.entity.domain.TagDO; import com.orion.ops.module.infra.entity.domain.TagRelDO; import com.orion.ops.module.infra.entity.dto.TagCacheDTO; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagServiceImpl.java index 06506214..bd2691f7 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TagServiceImpl.java @@ -7,7 +7,7 @@ import com.orion.ops.framework.mybatis.core.query.Conditions; import com.orion.ops.framework.redis.core.utils.RedisLists; import com.orion.ops.module.infra.convert.TagConvert; import com.orion.ops.module.infra.dao.TagDAO; -import com.orion.ops.module.infra.define.TagCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.TagCacheKeyDefine; import com.orion.ops.module.infra.entity.domain.TagDO; import com.orion.ops.module.infra.entity.dto.TagCacheDTO; import com.orion.ops.module.infra.entity.request.tag.TagCreateRequest; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TipsServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TipsServiceImpl.java index 7a0bba0a..30d6aacc 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TipsServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/TipsServiceImpl.java @@ -3,7 +3,7 @@ package com.orion.ops.module.infra.service.impl; import com.orion.lang.utils.collect.Lists; import com.orion.ops.framework.redis.core.utils.RedisLists; import com.orion.ops.framework.security.core.utils.SecurityUtils; -import com.orion.ops.module.infra.define.TipsCacheKeyDefine; +import com.orion.ops.module.infra.define.cache.TipsCacheKeyDefine; import com.orion.ops.module.infra.service.TipsService; import org.springframework.stereotype.Service; diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/resources/mapper/OperatorLogMapper.xml b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/resources/mapper/OperatorLogMapper.xml new file mode 100644 index 00000000..3c9030ef --- /dev/null +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/resources/mapper/OperatorLogMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, user_id, trace_id, address, location, user_agent, module, type, log_info, extra, result, error_message, return_value, duration, start_time, end_time, create_time + + +