| | |
| | | application: |
| | | name: gateway-server |
| | | |
| | | profiles: |
| | | active: local |
| | | |
| | | main: |
| | | allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 |
| | | |
| | | profiles: |
| | | active: @profiles.active@ |
| | | |
| | | config: |
| | | import: |
| | |
| | | - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置 |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @profiles.active@ |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | management.context-path: ${server.servlet.context-path}/actuator |
| | | config: # 【注册中心】配置项 |
| | | namespace: @profiles.active@ |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | # Spring Cloud Gateway 配置项,对应 GatewayProperties 类 |
| | | gateway: |
| | | # 路由配置项,对应 RouteDefinition 数组 |
| | |
| | | |
| | | logging: |
| | | file: |
| | | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | knife4j: |
| | | # 聚合 Swagger 文档,参考 https://doc.xiaominfo.com/docs/action/springcloud-gateway 文档 |
| | |
| | | include: "*" |
| | | endpoint: |
| | | health: |
| | | show-details: always |
| | | show-details: always |
| | | |
| | | # 日志文件配置 |
| | | logging: |
| | | level: |
| | | org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示 |
| | |
| | | <properties> |
| | | <nacos.version>2.3.2</nacos.version> |
| | | <!-- 需要与 Nacos 内置 Boot 版本保持一致 --> |
| | | <spring-boot.version>2.7.18</spring-boot.version> |
| | | <spring-boot-admin.version>2.7.15</spring-boot-admin.version> |
| | | <nacos.lib.path>${project.basedir}/src/main/resources/lib</nacos.lib.path> |
| | | </properties> |
| | | |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-dependencies</artifactId> |
| | | <version>${spring-boot.version}</version> |
| | | <version>${spring.boot.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>${spring-boot.version}</version> |
| | | <version>${spring.boot.version}</version> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | |
| | | db: |
| | | num: 1 |
| | | url: |
| | | '0': jdbc:mysql://localhost:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true |
| | | '0': jdbc:mysql://172.16.8.100:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true |
| | | password: |
| | | '0': 123456 |
| | | user: |
| | |
| | | <gson.version>2.10.1</gson.version> |
| | | |
| | | <spring.version>5.3.34</spring.version> |
| | | <spring-boot.version>2.7.18</spring-boot.version> |
| | | <!-- <spring-boot.version>2.7.18</spring-boot.version>--> |
| | | |
| | | <mybatis-spring-boot-starter.version>2.3.2</mybatis-spring-boot-starter.version> |
| | | <mysql-connector-j.version>8.3.0</mysql-connector-j.version> |
| | |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>${spring-boot.version}</version> |
| | | <version>${spring.boot.version}</version> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | |
| | | |
| | | logging: |
| | | file: |
| | | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | spring: |
| | | application: |
| | |
| | | profiles: |
| | | # 环境配置 |
| | | # active: @profiles.active@ |
| | | active: local |
| | | active: @profiles.active@ |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | management.context-path: ${server.servlet.context-path}/actuator |
| | | config: # 【注册中心】配置项 |
| | | namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | # Spring Boot Admin 配置项 |
| | | boot: |
| | | admin: |
| | |
| | | <configuration debug="false" scan="true" scanPeriod="1 seconds"> |
| | | |
| | | <contextName>logback</contextName> |
| | | <property name="log.path" value="/sda2/data/applogs/xxl-job/xxl-job-admin.log"/> |
| | | <property name="xxl-job-log.path" value="/data/applogs/xxl-job/xxl-job-admin.log"/> |
| | | |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | |
| | | </appender> |
| | | |
| | | <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}</file> |
| | | <file>${xxl-job-log.path}</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern> |
| | | <fileNamePattern>${xxl-job-log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n |
| | |
| | | package com.iailab.framework.ip.core; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonManagedReference; |
| | | import com.iailab.framework.ip.core.enums.AreaTypeEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.ToString; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ToString(exclude = {"parent"}) |
| | | public class Area { |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 父节点 |
| | | */ |
| | | @JsonManagedReference |
| | | private Area parent; |
| | | /** |
| | | * 子节点 |
| | | */ |
| | | @JsonManagedReference |
| | | private List<Area> children; |
| | | |
| | | } |
| | |
| | | @Primary // 引入租户时,tenantRedisCacheManager 为主 Bean |
| | | public RedisCacheManager tenantRedisCacheManager(RedisTemplate<String, Object> redisTemplate, |
| | | RedisCacheConfiguration redisCacheConfiguration, |
| | | IailabCacheProperties iailabCacheProperties) { |
| | | IailabCacheProperties iailabCacheProperties, |
| | | TenantProperties tenantProperties) { |
| | | // 创建 RedisCacheWriter 对象 |
| | | RedisConnectionFactory connectionFactory = Objects.requireNonNull(redisTemplate.getConnectionFactory()); |
| | | RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory, |
| | | BatchStrategies.scan(iailabCacheProperties.getRedisScanBatchSize())); |
| | | // 创建 TenantRedisCacheManager 对象 |
| | | return new TenantRedisCacheManager(cacheWriter, redisCacheConfiguration); |
| | | return new TenantRedisCacheManager(cacheWriter, redisCacheConfiguration, tenantProperties.getIgnoreCaches()); |
| | | } |
| | | } |
| | |
| | | */ |
| | | private Set<String> ignoreTables = Collections.emptySet(); |
| | | |
| | | /** |
| | | * 需要忽略多租户的 Spring Cache 缓存 |
| | | * |
| | | * 即默认所有缓存都开启多租户的功能,所以记得添加对应的 tenant_id 字段哟 |
| | | */ |
| | | private Set<String> ignoreCaches = Collections.emptySet(); |
| | | |
| | | } |
| | |
| | | package com.iailab.framework.tenant.core.redis; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.iailab.framework.redis.core.TimeoutRedisCacheManager; |
| | | import com.iailab.framework.tenant.core.context.TenantContextHolder; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.data.redis.cache.RedisCacheConfiguration; |
| | | import org.springframework.data.redis.cache.RedisCacheManager; |
| | | import org.springframework.data.redis.cache.RedisCacheWriter; |
| | | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 多租户的 {@link RedisCacheManager} 实现类 |
| | |
| | | @Slf4j |
| | | public class TenantRedisCacheManager extends TimeoutRedisCacheManager { |
| | | |
| | | private final Set<String> ignoreCaches; |
| | | |
| | | public TenantRedisCacheManager(RedisCacheWriter cacheWriter, |
| | | RedisCacheConfiguration defaultCacheConfiguration) { |
| | | RedisCacheConfiguration defaultCacheConfiguration, |
| | | Set<String> ignoreCaches) { |
| | | super(cacheWriter, defaultCacheConfiguration); |
| | | this.ignoreCaches = ignoreCaches; |
| | | } |
| | | |
| | | @Override |
| | | public Cache getCache(String name) { |
| | | // 如果开启多租户,则 name 拼接租户后缀 |
| | | if (!TenantContextHolder.isIgnore() |
| | | && TenantContextHolder.getTenantId() != null) { |
| | | && TenantContextHolder.getTenantId() != null |
| | | && !CollUtil.contains(ignoreCaches, name)) { |
| | | name = name + ":" + TenantContextHolder.getTenantId(); |
| | | } |
| | | |
| | |
| | | |
| | | default <D> PageResult<D> selectJoinPage(PageParam pageParam, Class<D> clazz, MPJLambdaWrapper<T> lambdaWrapper) { |
| | | // 特殊:不分页,直接查询全部 |
| | | if (PageParam.PAGE_SIZE_NONE.equals(pageParam.getPageNo())) { |
| | | if (PageParam.PAGE_SIZE_NONE.equals(pageParam.getPageSize())) { |
| | | List<D> list = selectJoinList(clazz, lambdaWrapper); |
| | | return new PageResult<>(list, (long) list.size()); |
| | | } |
| | |
| | | package com.iailab.framework.security.core.service; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.collection.ListUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.HashUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.iailab.framework.common.core.KeyValue; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.util.cache.CacheUtils; |
| | | import com.iailab.framework.security.core.LoginUser; |
| | | import com.iailab.framework.security.core.util.SecurityFrameworkUtils; |
| | | import com.iailab.module.system.api.permission.PermissionApi; |
| | |
| | | @Override |
| | | @SneakyThrows |
| | | public boolean hasAnyPermissions(String... permissions) { |
| | | return hasAnyPermissionsCache.get(new KeyValue<>(getLoginUserId(), Arrays.asList(permissions))); |
| | | Long userId = getLoginUserId(); |
| | | if (userId == null) { |
| | | return false; |
| | | } |
| | | return hasAnyPermissionsCache.get(new KeyValue<>(userId, Arrays.asList(permissions))); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | @SneakyThrows |
| | | public boolean hasAnyRoles(String... roles) { |
| | | return hasAnyRolesCache.get(new KeyValue<>(getLoginUserId(), Arrays.asList(roles))); |
| | | Long userId = getLoginUserId(); |
| | | if (userId == null) { |
| | | return false; |
| | | } |
| | | return hasAnyRolesCache.get(new KeyValue<>(userId, Arrays.asList(roles))); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.iailab.framework.apilog.core.interceptor; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.io.resource.ResourceUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.iailab.framework.common.util.servlet.ServletUtils; |
| | | import com.iailab.framework.common.util.spring.SpringUtils; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.IntStream; |
| | | |
| | | /** |
| | | * API 访问日志 Interceptor |
| | |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start(); |
| | | request.setAttribute(ATTRIBUTE_STOP_WATCH, stopWatch); |
| | | // 打印 Controller 路径 |
| | | printHandlerMethodPosition(handlerMethod); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 打印 Controller 方法路径 |
| | | */ |
| | | private void printHandlerMethodPosition(HandlerMethod handlerMethod) { |
| | | if (handlerMethod == null) { |
| | | return; |
| | | } |
| | | Method method = handlerMethod.getMethod(); |
| | | Class<?> clazz = method.getDeclaringClass(); |
| | | try { |
| | | // 获取 method 的 lineNumber |
| | | List<String> clazzContents = FileUtil.readUtf8Lines( |
| | | ResourceUtil.getResource(null, clazz).getPath().replace("/target/classes/", "/src/main/java/") |
| | | + clazz.getSimpleName() + ".java"); |
| | | Optional<Integer> lineNumber = IntStream.range(0, clazzContents.size()) |
| | | .filter(i -> clazzContents.get(i).contains(" " + method.getName() + "(")) // 简单匹配,不考虑方法重名 |
| | | .mapToObj(i -> i + 1) // 行号从 1 开始 |
| | | .findFirst(); |
| | | if (!lineNumber.isPresent()) { |
| | | return; |
| | | } |
| | | // 打印结果 |
| | | System.out.printf("\tController 方法路径:%s(%s.java:%d)\n", clazz.getName(), clazz.getSimpleName(), lineNumber.get()); |
| | | } catch (Exception ignore) { |
| | | // 忽略异常。原因:仅仅打印,非重要逻辑 |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface DictTypeConstants { |
| | | |
| | | String TASK_ASSIGN_RULE_TYPE = "bpm_task_assign_rule_type"; // 任务分配规则类型 |
| | | String TASK_ASSIGN_SCRIPT = "bpm_task_assign_script"; // 任务分配自定义脚本 |
| | | // String TASK_ASSIGN_RULE_TYPE = "bpm_task_assign_rule_type"; // 任务分配规则类型 |
| | | // String TASK_ASSIGN_SCRIPT = "bpm_task_assign_script"; // 任务分配自定义脚本 |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | return new int[0]; |
| | | return ARRAYS; |
| | | } |
| | | |
| | | } |
| | |
| | | <dependencies> |
| | | <!-- Spring Cloud 基础 --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bootstrap</artifactId> |
| | | <groupId>com.iailab</groupId> |
| | | <artifactId>iailab-common-env</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | <dependency> |
| | | <groupId>org.flowable</groupId> |
| | | <artifactId>flowable-spring-boot-starter-process</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.mybatis</groupId> |
| | | <artifactId>mybatis</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.flowable</groupId> |
| | | <artifactId>flowable-spring-boot-starter-actuator</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.mybatis</groupId> |
| | | <artifactId>mybatis</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | |
| | | @GetMapping ("/list") |
| | | @Operation(summary = "获得流程定义列表") |
| | | @Parameter(name = "suspensionState", description = "挂起状态", required = true, example = "1") // 参见 Flowable SuspensionState 枚举 |
| | | @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") |
| | | public CommonResult<List<BpmProcessDefinitionRespVO>> getProcessDefinitionList( |
| | | @RequestParam("suspensionState") Integer suspensionState) { |
| | | List<ProcessDefinition> list = processDefinitionService.getProcessDefinitionListBySuspensionState(suspensionState); |
| | |
| | | @Operation(summary = "获得流程定义") |
| | | @Parameter(name = "id", description = "流程编号", required = true, example = "1024") |
| | | @Parameter(name = "key", description = "流程定义标识", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") |
| | | public CommonResult<BpmProcessDefinitionRespVO> getProcessDefinition( |
| | | @RequestParam(value = "id", required = false) String id, |
| | | @RequestParam(value = "key", required = false) String key) { |
| | |
| | | if (processDefinition == null) { |
| | | return success(null); |
| | | } |
| | | BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionService.getProcessDefinitionInfo(processDefinition.getId()); |
| | | BpmnModel bpmnModel = processDefinitionService.getProcessDefinitionBpmnModel(processDefinition.getId()); |
| | | List<UserTask> userTaskList = BpmTaskCandidateStartUserSelectStrategy.getStartUserSelectUserTaskList(bpmnModel); |
| | | return success(BpmProcessDefinitionConvert.INSTANCE.buildProcessDefinition( |
| | | processDefinition, null, null, null, null, bpmnModel, userTaskList)); |
| | | processDefinition, null, processDefinitionInfo, null, null, bpmnModel, userTaskList)); |
| | | } |
| | | |
| | | } |
| | |
| | | BpmProcessInstanceRespVO respVO = vpPageResult.getList().get(i); |
| | | respVO.setStatus(FlowableUtils.getProcessInstanceStatus(pageResult.getList().get(i))); |
| | | MapUtils.findAndThen(processDefinitionMap, respVO.getProcessDefinitionId(), |
| | | processDefinition -> respVO.setCategory(processDefinition.getCategory())); |
| | | processDefinition -> respVO.setCategory(processDefinition.getCategory()) |
| | | .setProcessDefinition(BeanUtils.toBean(processDefinition, BpmProcessDefinitionRespVO.class))); |
| | | MapUtils.findAndThen(categoryMap, respVO.getCategory(), category -> respVO.setCategoryName(category.getName())); |
| | | respVO.setTasks(BeanUtils.toBean(taskMap.get(respVO.getId()), BpmProcessInstanceRespVO.Task.class)); |
| | | // user |
| | |
| | | package com.iailab.module.bpm.dal.dataobject.definition; |
| | | |
| | | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
| | | import com.iailab.framework.common.enums.CommonStatusEnum; |
| | | import com.iailab.framework.mybatis.core.dataobject.BaseDO; |
| | | import com.iailab.framework.mybatis.core.type.JsonLongSetTypeHandler; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | /** |
| | | * 成员用户编号数组 |
| | | */ |
| | | @TableField(typeHandler = JsonLongSetTypeHandler.class) |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private Set<Long> userIds; |
| | | |
| | | } |
| | |
| | | if (count == 0) { |
| | | return PageResult.empty(count); |
| | | } |
| | | // 关闭多租户查询,不添加tenantId条件 |
| | | if (StrUtil.isNotBlank(FlowableUtils.getTenantId())) { |
| | | modelQuery.modelTenantId(FlowableUtils.getTenantId()); |
| | | } |
| | | List<Model> models = modelQuery |
| | | .modelTenantId(FlowableUtils.getTenantId()) |
| | | .orderByCreateTime().desc() |
| | | .listPage(PageUtils.getStart(pageVO), pageVO.getPageSize()); |
| | | return new PageResult<>(models, count); |
| | |
| | | query.active(); |
| | | } |
| | | // 执行查询 |
| | | query.processDefinitionTenantId(FlowableUtils.getTenantId()); |
| | | // 关闭多租户查询,不添加tenantId条件 |
| | | if (StrUtil.isNotBlank(FlowableUtils.getTenantId())) { |
| | | query.processDefinitionTenantId(FlowableUtils.getTenantId()); |
| | | } else { |
| | | query.processDefinitionWithoutTenantId(); |
| | | } |
| | | return query.list(); |
| | | } |
| | | |
| | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.date.DateUtils; |
| | | import com.iailab.framework.common.util.number.NumberUtils; |
| | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | | # 数据源配置项 |
| | | autoconfigure: |
| | | exclude: |
| | | - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 |
| | | - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置 |
| | | datasource: |
| | | druid: # Druid 【监控】相关的全局配置 |
| | | web-stat-filter: |
| | |
| | | multi-statement-allow: true |
| | | dynamic: # 多数据源配置 |
| | | druid: # Druid 【连接池】相关的全局配置 |
| | | initial-size: 5 # 初始连接数 |
| | | min-idle: 10 # 最小连接池数量 |
| | | initial-size: 1 # 初始连接数 |
| | | min-idle: 1 # 最小连接池数量 |
| | | max-active: 20 # 最大连接池数量 |
| | | max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒 |
| | | time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 |
| | |
| | | datasource: |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | # url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 |
| | | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 |
| | | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例 |
| | | # url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 |
| | | username: root |
| | | password: 123456 |
| | | slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 |
| | | # username: sa # SQL Server 连接的示例 |
| | | # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例 |
| | | # username: SYSDBA # DM 连接的示例 |
| | | # password: SYSDBA # DM 连接的示例 |
| | | slave: # 模拟从库,可根据自己需要修改 |
| | | lazy: true # 开启懒加载,保证启动速度 |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: 123456 |
| | | |
| | | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 |
| | | redis: |
| | | host: 400-infra.server.iocoder.cn # 地址 |
| | | host: 127.0.0.1 # 地址 |
| | | port: 6379 # 端口 |
| | | database: 1 # 数据库索引 |
| | | # password: 123456 # 密码,建议生产环境开启 |
| | | database: 0 # 数据库索引 |
| | | password: 123456 # 密码,建议生产环境开启 |
| | | |
| | | --- #################### MQ 消息队列相关配置 #################### |
| | | |
| | | --- #################### 定时任务相关配置 #################### |
| | | |
| | | xxl: |
| | | job: |
| | | enabled: true # 是否开启调度中心,默认为 true 开启 |
| | | admin: |
| | | addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址 |
| | | |
| | |
| | | instance: |
| | | service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME] |
| | | |
| | | # 日志文件配置 |
| | | logging: |
| | | level: |
| | | # 配置自己写的 MyBatis Mapper 打印日志 |
| | | com.iailab.module.bpm.dal.mysql: info |
| | | |
| | | --- #################### 平台相关配置 #################### |
| | | |
| | | # 平台配置项,设置当前项目所有自定义的配置 |
| | | iailab: |
| | | xss: |
| | | env: # 多环境的配置项 |
| | | tag: ${HOSTNAME} |
| | | security: |
| | | mock-enable: true |
| | | access-log: # 访问日志的配置项 |
| | | enable: false |
| | | exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 |
| | | - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 |
| | | - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 |
| | | demo: true # 开启演示模式 |
| | | demo: false # 关闭演示模式 |
| | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | | # 数据源配置项 |
| | | autoconfigure: |
| | |
| | | logging: |
| | | level: |
| | | # 配置自己写的 MyBatis Mapper 打印日志 |
| | | com.iailab.module.bpm.dal.mysql: debug |
| | | com.iailab.module.bpm.dal.mysql: info |
| | | |
| | | --- #################### 平台相关配置 #################### |
| | | |
| | |
| | | spring: |
| | | application: |
| | | name: bpm-server |
| | | |
| | | profiles: |
| | | active: @profiles.active@ |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | main: |
| | | allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 |
| | | allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务 |
| | | |
| | | config: |
| | | import: |
| | | - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置 |
| | | - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置 |
| | | |
| | | # Servlet 配置 |
| | | servlet: |
| | |
| | | type: REDIS |
| | | redis: |
| | | time-to-live: 1h # 设置过期时间为 1 小时 |
| | | |
| | | server: |
| | | port: 48083 |
| | | |
| | | logging: |
| | | file: |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | --- #################### 接口文档配置 #################### |
| | | |
| | |
| | | mybatis-plus: |
| | | configuration: |
| | | map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | global-config: |
| | | db-config: |
| | | id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 |
| | |
| | | job: |
| | | executor: |
| | | appname: ${spring.application.name} # 执行器 AppName |
| | | logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | logpath: @log.path@/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | accessToken: default_token # 执行器通讯TOKEN |
| | | |
| | | --- #################### 平台相关配置 #################### |
| | |
| | | <version>6.8.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.junit.jupiter</groupId> |
| | | <artifactId>junit-jupiter</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | |
| | | <!-- <!– websocket –>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | |
| | | <plugins> |
| | | <!-- 打包 --> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>${spring.boot.version}</version> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> <!-- 将引入的 jar 打入其中 --> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>3.1</version> |
| | | </plugin> |
| | | |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-maven-plugin</artifactId>--> |
| | | <!-- <version>${spring.boot.version}</version>--> |
| | | <!-- <executions>--> |
| | | <!-- <execution>--> |
| | | <!-- <goals>--> |
| | | <!-- <goal>repackage</goal> <!– 将引入的 jar 打入其中 –>--> |
| | | <!-- </goals>--> |
| | | <!-- </execution>--> |
| | | <!-- </executions>--> |
| | | <!-- </plugin>--> |
| | | </plugins> |
| | | </build> |
| | | |
| | |
| | | package com.iailab.module.data.channel.modbus.controller.admin; |
| | | |
| | | import cn.hutool.core.codec.Base64; |
| | | import com.iailab.module.data.common.utils.PageUtils; |
| | | import com.iailab.module.data.common.utils.R; |
| | | import com.iailab.module.data.channel.modbus.entity.ChannelModBusTagEntity; |
| | | import com.iailab.module.data.channel.modbus.service.ChannelModbusTagService; |
| | | import com.sun.xml.internal.messaging.saaj.util.Base64; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @GetMapping("/info/{id}") |
| | | public R tagInfo(@PathVariable("id") String id){ |
| | | ChannelModBusTagEntity info= channelModbusTagService.info(Base64.base64Decode(id)); |
| | | ChannelModBusTagEntity info= channelModbusTagService.info(Base64.decodeStr(id)); |
| | | return R.ok().put("data", info); |
| | | } |
| | | /** |
| | |
| | | package com.iailab.module.data.channel.opcua.controller.admin; |
| | | |
| | | import cn.hutool.core.codec.Base64; |
| | | import com.iailab.module.data.common.exception.RRException; |
| | | import com.iailab.module.data.common.utils.PageUtils; |
| | | import com.iailab.module.data.common.utils.R; |
| | | import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity; |
| | | import com.iailab.module.data.channel.opcua.service.ChannelOPCUATagService; |
| | | import com.sun.xml.internal.messaging.saaj.util.Base64; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | */ |
| | | @GetMapping("/info/{id}") |
| | | public R tagInfo(@PathVariable("id") String id){ |
| | | ChannelOPCUATagEntity info= channelOpcuaTagService.info(Base64.base64Decode(id)); |
| | | ChannelOPCUATagEntity info= channelOpcuaTagService.info(Base64.decodeStr(id)); |
| | | return R.ok().put("data", info); |
| | | } |
| | | /** |
| | |
| | | --- #################### 注册中心 + 配置中心相关配置 #################### |
| | | |
| | | spring: |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | | # 数据源配置项 |
| | |
| | | name: data-server |
| | | |
| | | profiles: |
| | | active: local |
| | | active: @profiles.active@ |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | main: |
| | | allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 |
| | |
| | | |
| | | logging: |
| | | file: |
| | | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | --- #################### 接口文档配置 #################### |
| | | |
| | |
| | | job: |
| | | executor: |
| | | appname: ${spring.application.name} # 执行器 AppName |
| | | logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | logpath: @log.path@/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | accessToken: default_token # 执行器通讯TOKEN |
| | | |
| | | |
| | |
| | | import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO; |
| | | import com.iailab.module.data.influxdb.pojo.InfluxPointValueSimPOJO; |
| | | import com.iailab.module.data.influxdb.service.InfluxDBService; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.junit.jupiter.api.Test; |
| | | |
| | | import javax.annotation.Resource; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | |
| | | * @Description |
| | | * @createTime 2023年12月10日 12:19:00 |
| | | */ |
| | | @SpringBootTest |
| | | @RunWith(SpringRunner.class) |
| | | public class InfluxDBTest { |
| | | |
| | | @Resource |
| | |
| | | package com.iailab; |
| | | |
| | | import com.iailab.module.collection.tag.impl.OadpTagCollector; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年04月25日 16:17:00 |
| | | */ |
| | | @SpringBootTest |
| | | @RunWith(SpringRunner.class) |
| | | public class OadpTagCollectorTest { |
| | | |
| | | @Resource |
| | | private OadpTagCollector tagCollector; |
| | | |
| | | @Test |
| | | public void test() { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | List<String> tags = new ArrayList<>(); |
| | | tags.add("source=producer-modbus;id=device0.change_random_int32"); |
| | | tags.add("source=producer-modbus;id=device0.change_random_float"); |
| | | tagCollector.collect(calendar.getTime(), tags); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testSp() { |
| | | String regex = "[+\\-\\*/()\\&&\\||]"; |
| | | String expression = "324123423&&34576||9999||66666+536345"; |
| | | String[] arr = expression.split(regex); |
| | | } |
| | | } |
| | | //package com.iailab; |
| | | // |
| | | //import org.testng.annotations.Test; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | // |
| | | //import java.util.ArrayList; |
| | | //import java.util.Calendar; |
| | | //import java.util.List; |
| | | // |
| | | ///** |
| | | // * @author PanZhibao |
| | | // * @Description |
| | | // * @createTime 2023年04月25日 16:17:00 |
| | | // */ |
| | | //public class OadpTagCollectorTest { |
| | | // |
| | | // @Resource |
| | | // private OadpTagCollector tagCollector; |
| | | // |
| | | // @Test |
| | | // public void test() { |
| | | // Calendar calendar = Calendar.getInstance(); |
| | | // calendar.set(Calendar.MILLISECOND, 0); |
| | | // List<String> tags = new ArrayList<>(); |
| | | // tags.add("source=producer-modbus;id=device0.change_random_int32"); |
| | | // tags.add("source=producer-modbus;id=device0.change_random_float"); |
| | | // tagCollector.collect(calendar.getTime(), tags); |
| | | // } |
| | | // |
| | | // |
| | | // @Test |
| | | // public void testSp() { |
| | | // String regex = "[+\\-\\*/()\\&&\\||]"; |
| | | // String expression = "324123423&&34576||9999||66666+536345"; |
| | | // String[] arr = expression.split(regex); |
| | | // } |
| | | //} |
| | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.module.infra.dal.dataobject.config.ConfigDO; |
| | | import com.iailab.module.infra.service.config.ConfigService; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | private ConfigService configService; |
| | | |
| | | @Override |
| | | public String queryConfigByCode(String configCode) { |
| | | ConfigDO configByKey = configService.getConfigByKey(configCode); |
| | | return ObjectUtils.isNotEmpty(configByKey) ? configByKey.getValue() : ""; |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<String> getConfigValueByKey(String key) { |
| | | ConfigDO config = configService.getConfigByKey(key); |
| | | return success(config != null ? config.getValue() : null); |
| | |
| | | @Operation(summary = "导出参数配置") |
| | | @PreAuthorize("@ss.hasPermission('infra:config:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportConfig(@Valid ConfigPageReqVO exportReqVO, |
| | | public void exportConfig(ConfigPageReqVO exportReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | | exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| | | List<ConfigDO> list = configService.getConfigPage(exportReqVO).getList(); |
| | |
| | | .region(buildRegion()) // Region |
| | | .credentials(config.getAccessKey(), config.getAccessSecret()) // 认证密钥 |
| | | .build(); |
| | | enableVirtualStyleEndpoint(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 开启 VirtualStyle 模式 |
| | | */ |
| | | private void enableVirtualStyleEndpoint() { |
| | | if (StrUtil.containsAll(config.getEndpoint(), |
| | | S3FileClientConfig.ENDPOINT_TENCENT, // 腾讯云 https://cloud.tencent.com/document/product/436/41284 |
| | | S3FileClientConfig.ENDPOINT_VOLCES)) { // 火山云 https://www.volcengine.com/docs/6349/1288493 |
| | | client.enableVirtualStyleEndpoint(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String upload(byte[] content, String path, String type) throws Exception { |
| | | // 执行上传 |
| | |
| | | public static final String ENDPOINT_QINIU = "qiniucs.com"; |
| | | public static final String ENDPOINT_ALIYUN = "aliyuncs.com"; |
| | | public static final String ENDPOINT_TENCENT = "myqcloud.com"; |
| | | public static final String ENDPOINT_VOLCES = "volces.com"; // 火山云(字节) |
| | | |
| | | /** |
| | | * 节点地址 |
| | |
| | | * @param reqVO 分页条件 |
| | | * @return 分页列表 |
| | | */ |
| | | PageResult<ConfigDO> getConfigPage(@Valid ConfigPageReqVO reqVO); |
| | | PageResult<ConfigDO> getConfigPage(ConfigPageReqVO reqVO); |
| | | |
| | | /** |
| | | * 根据参数编码,获取参数的value值 |
| | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | | |
| | | # 数据源配置项 |
| | | autoconfigure: |
| | | exclude: |
| | | - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 |
| | | # - de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置 |
| | | # - de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置 |
| | | # - de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置 |
| | | # - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置 |
| | | datasource: |
| | | druid: # Druid 【监控】相关的全局配置 |
| | | web-stat-filter: |
| | |
| | | multi-statement-allow: true |
| | | dynamic: # 多数据源配置 |
| | | druid: # Druid 【连接池】相关的全局配置 |
| | | initial-size: 5 # 初始连接数 |
| | | min-idle: 10 # 最小连接池数量 |
| | | initial-size: 1 # 初始连接数 |
| | | min-idle: 1 # 最小连接池数量 |
| | | max-active: 20 # 最大连接池数量 |
| | | max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒 |
| | | time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 |
| | |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | url: jdbc:mysql://172.16.8.100:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | # url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 |
| | | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 |
| | | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例 |
| | | # url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 |
| | | username: root |
| | | password: 123456 |
| | | slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 |
| | | # username: sa # SQL Server 连接的示例 |
| | | # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例 |
| | | # username: SYSDBA # DM 连接的示例 |
| | | # password: SYSDBA # DM 连接的示例 |
| | | slave: # 模拟从库,可根据自己需要修改 |
| | | lazy: true # 开启懒加载,保证启动速度 |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: 123456 |
| | | |
| | | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 |
| | | redis: |
| | | host: 127.0.0.1 # 地址 |
| | | host: 172.16.8.100 # 地址 |
| | | port: 6379 # 端口 |
| | | database: 1 # 数据库索引 |
| | | database: 0 # 数据库索引 |
| | | password: 123456 # 密码,建议生产环境开启 |
| | | |
| | | --- #################### MQ 消息队列相关配置 #################### |
| | | |
| | | # rocketmq 配置项,对应 RocketMQProperties 配置类 |
| | | rocketmq: |
| | | name-server: 127.0.0.1:9876 # RocketMQ Namesrv |
| | | name-server: 172.16.8.100:9876 # RocketMQ Namesrv |
| | | |
| | | spring: |
| | | # RabbitMQ 配置项,对应 RabbitProperties 配置类 |
| | | rabbitmq: |
| | | host: 127.0.0.1 # RabbitMQ 服务的地址 |
| | | host: 172.16.8.100 # RabbitMQ 服务的地址 |
| | | port: 5672 # RabbitMQ 服务的端口 |
| | | username: guest # RabbitMQ 服务的账号 |
| | | password: guest # RabbitMQ 服务的密码 |
| | | # Kafka 配置项,对应 KafkaProperties 配置类 |
| | | kafka: |
| | | bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 |
| | | bootstrap-servers: 172.16.8.100:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 |
| | | |
| | | --- #################### 定时任务相关配置 #################### |
| | | xxl: |
| | | job: |
| | | enabled: false # 是否开启调度中心,默认为 true 开启 |
| | | admin: |
| | | addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址 |
| | | addresses: http://172.16.8.100:9090/xxl-job-admin # 调度中心部署跟地址 |
| | | |
| | | --- #################### 服务保障相关配置 #################### |
| | | |
| | |
| | | # Spring Boot Admin Server 服务端的相关配置 |
| | | context-path: /admin # 配置 Spring |
| | | |
| | | # 日志文件配置 |
| | | logging: |
| | | level: |
| | | # 配置自己写的 MyBatis Mapper 打印日志 |
| | | com.iailab.module.infra.dal.mysql: debug |
| | | com.iailab.module.infra.dal.mysql.logger.ApiErrorLogMapper: INFO # 配置 ApiErrorLogMapper 的日志级别为 info,避免和 GlobalExceptionHandler 重复打印 |
| | | com.iailab.module.infra.dal.mysql.file.FileConfigMapper: INFO # 配置 FileConfigMapper 的日志级别为 info |
| | | |
| | | --- #################### 平台相关配置 #################### |
| | | |
| | | # 平台配置项,设置当前项目所有自定义的配置 |
| | | iailab: |
| | | xss: |
| | | env: # 多环境的配置项 |
| | | tag: ${HOSTNAME} |
| | | security: |
| | | mock-enable: true |
| | | access-log: # 访问日志的配置项 |
| | | enable: false |
| | | exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 |
| | | - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 |
| | | - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 |
| | | demo: true # 开启演示模式 |
| | |
| | | --- #################### 注册中心 + 配置中心相关配置 #################### |
| | | |
| | | spring: |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | | |
| | |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | url: jdbc:mysql://172.16.8.100:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | # url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 |
| | | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 |
| | | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 |
| | |
| | | |
| | | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 |
| | | redis: |
| | | host: 127.0.0.1 # 地址 |
| | | host: 172.16.8.100 # 地址 |
| | | port: 6379 # 端口 |
| | | database: 0 # 数据库索引 |
| | | password: 123456 # 密码,建议生产环境开启 |
| | |
| | | name: infra-server |
| | | |
| | | profiles: |
| | | active: local |
| | | active: @profiles.active@ |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @profiles.active@ |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: @profiles.active@ |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | main: |
| | | allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 |
| | |
| | | |
| | | logging: |
| | | file: |
| | | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | --- #################### 接口文档配置 #################### |
| | | |
| | |
| | | job: |
| | | executor: |
| | | appname: ${spring.application.name} # 执行器 AppName |
| | | logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | logpath: @log.path@/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | accessToken: default_token # 执行器通讯TOKEN |
| | | |
| | | --- #################### 平台相关配置 #################### |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-websocket</artifactId> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>io.swagger.core.v3</groupId>--> |
| | | <!-- <artifactId>swagger-annotations</artifactId>--> |
| | | <!-- <version>2.2.21</version>--> |
| | | <!-- <scope>compile</scope>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.iailab</groupId> |
| | | <artifactId>iailab-module-data-biz</artifactId> |
| | | <version>0.0.1</version> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.junit.jupiter</groupId> |
| | | <artifactId>junit-jupiter</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <!-- 设置构建的 jar 包名 --> |
| | | <finalName>${project.artifactId}</finalName> |
| | | <plugins> |
| | | <!-- 打包 --> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>3.1</version> |
| | | </plugin> |
| | | |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-maven-plugin</artifactId>--> |
| | | <!-- <version>${spring.boot.version}</version>--> |
| | | <!-- <executions>--> |
| | | <!-- <execution>--> |
| | | <!-- <goals>--> |
| | | <!-- <goal>repackage</goal> <!– 将引入的 jar 打入其中 –>--> |
| | | <!-- </goals>--> |
| | | <!-- </execution>--> |
| | | <!-- </executions>--> |
| | | <!-- </plugin>--> |
| | | </plugins> |
| | | </build> |
| | | |
| | | |
| | | </project> |
| | |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | --- #################### 数据库相关配置 #################### |
| | |
| | | --- #################### 注册中心 + 配置中心相关配置 #################### |
| | | |
| | | spring: |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | | # 数据源配置项 |
| | |
| | | name: model-server |
| | | |
| | | profiles: |
| | | active: local |
| | | active: ${spring.profiles.active} |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | main: |
| | | allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 |
| | |
| | | |
| | | logging: |
| | | file: |
| | | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | --- #################### 接口文档配置 #################### |
| | | |
| | |
| | | job: |
| | | executor: |
| | | appname: ${spring.application.name} # 执行器 AppName |
| | | logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | logpath: @log.path@/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | accessToken: default_token # 执行器通讯TOKEN |
| | | |
| | | |
| | |
| | | package com.iailab; |
| | | |
| | | import com.iailab.module.model.influxdb.pojo.InfluxPointValuePOJO; |
| | | import com.iailab.module.model.influxdb.pojo.InfluxPointValueSimPOJO; |
| | | import com.iailab.module.model.influxdb.service.InfluxDBService; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO; |
| | | import com.iailab.module.data.influxdb.pojo.InfluxPointValueSimPOJO; |
| | | import com.iailab.module.data.influxdb.service.InfluxDBService; |
| | | import org.junit.jupiter.api.Test; |
| | | |
| | | import javax.annotation.Resource; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | |
| | | * @Description |
| | | * @createTime 2023年12月10日 12:19:00 |
| | | */ |
| | | @SpringBootTest |
| | | @RunWith(SpringRunner.class) |
| | | public class InfluxDBTest { |
| | | |
| | | @Resource |
| | |
| | | package com.iailab; |
| | | |
| | | import com.iailab.module.collection.tag.impl.OadpTagCollector; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年04月25日 16:17:00 |
| | | */ |
| | | @SpringBootTest |
| | | @RunWith(SpringRunner.class) |
| | | public class OadpTagCollectorTest { |
| | | |
| | | @Resource |
| | | private OadpTagCollector tagCollector; |
| | | |
| | | @Test |
| | | public void test() { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | List<String> tags = new ArrayList<>(); |
| | | tags.add("source=producer-modbus;id=device0.change_random_int32"); |
| | | tags.add("source=producer-modbus;id=device0.change_random_float"); |
| | | tagCollector.collect(calendar.getTime(), tags); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testSp() { |
| | | String regex = "[+\\-\\*/()\\&&\\||]"; |
| | | String expression = "324123423&&34576||9999||66666+536345"; |
| | | String[] arr = expression.split(regex); |
| | | } |
| | | } |
| | | //package com.iailab; |
| | | // |
| | | //import org.testng.annotations.Test; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | // |
| | | //import java.util.ArrayList; |
| | | //import java.util.Calendar; |
| | | //import java.util.List; |
| | | // |
| | | ///** |
| | | // * @author PanZhibao |
| | | // * @Description |
| | | // * @createTime 2023年04月25日 16:17:00 |
| | | // */ |
| | | //public class OadpTagCollectorTest { |
| | | // |
| | | // @Resource |
| | | // private OadpTagCollector tagCollector; |
| | | // |
| | | // @Test |
| | | // public void test() { |
| | | // Calendar calendar = Calendar.getInstance(); |
| | | // calendar.set(Calendar.MILLISECOND, 0); |
| | | // List<String> tags = new ArrayList<>(); |
| | | // tags.add("source=producer-modbus;id=device0.change_random_int32"); |
| | | // tags.add("source=producer-modbus;id=device0.change_random_float"); |
| | | // tagCollector.collect(calendar.getTime(), tags); |
| | | // } |
| | | // |
| | | // |
| | | // @Test |
| | | // public void testSp() { |
| | | // String regex = "[+\\-\\*/()\\&&\\||]"; |
| | | // String expression = "324123423&&34576||9999||66666+536345"; |
| | | // String[] arr = expression.split(regex); |
| | | // } |
| | | //} |
| | |
| | | <dependencies> |
| | | <!-- Spring Cloud 基础 --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bootstrap</artifactId> |
| | | <groupId>com.iailab</groupId> |
| | | <artifactId>iailab-common-env</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 依赖服务 --> |
| | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | | |
| | | # 数据源配置项 |
| | | autoconfigure: |
| | | exclude: |
| | |
| | | tag: ${HOSTNAME} |
| | | security: |
| | | mock-enable: true |
| | | xss: |
| | | enable: false |
| | | exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 |
| | | - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 |
| | | - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 |
| | | access-log: # 访问日志的配置项 |
| | | enable: false |
| | | demo: false # 关闭演示模式 |
| | |
| | | spring: |
| | | application: |
| | | name: report-server |
| | | |
| | | profiles: |
| | | active: ${spring.profiles.active} |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: ${spring.profiles.active} |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | main: |
| | | allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 |
| | | allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务 |
| | | |
| | | config: |
| | | import: |
| | | - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置 |
| | | - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置 |
| | | |
| | | # Servlet 配置 |
| | | servlet: |
| | |
| | | type: REDIS |
| | | redis: |
| | | time-to-live: 1h # 设置过期时间为 1 小时 |
| | | |
| | | server: |
| | | port: 48084 |
| | | |
| | | # 日志文件配置。注意,如果 logging.file.name 不放在 bootstrap.yaml 配置文件,而是放在 application.yaml 中,会导致出现 LOG_FILE_IS_UNDEFINED 文件 |
| | | logging: |
| | | file: |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | --- #################### 接口文档配置 #################### |
| | | |
| | |
| | | web: |
| | | admin-ui: |
| | | url: http://dashboard.iailab.iocoder.cn # Admin 管理后台 UI 的地址 |
| | | xss: |
| | | enable: false |
| | | exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 |
| | | - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 |
| | | swagger: |
| | | title: 管理后台 |
| | | description: 提供管理员管理的所有功能 |
| | | version: ${iailab.info.version} |
| | | base-package: ${iailab.info.base-package} |
| | | tenant: # 多租户相关配置项 |
| | | enable: true |
| | | enable: false |
| | | |
| | | debug: false |
| | |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: |
| | | namespace: @nacos.namespace@ # 命名空间。这里使用 dev 开发环境 |
| | | namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 |
| | | autoRegister: true |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | |
| | | # 日志文件配置。注意,如果 logging.file.name 不放在 bootstrap.yaml 配置文件,而是放在 application.yaml 中,会导致出现 LOG_FILE_IS_UNDEFINED 文件 |
| | | logging: |
| | | file: |
| | | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | |
| | | pay-notify-url: http://niubi.natapp1.cc/api/pay/order/notify |
| | | pay-return-url: http://niubi.natapp1.cc/api/pay/order/return |
| | | refund-notify-url: http://niubi.natapp1.cc/api/pay/refund/notify |
| | | demo: true # 开启演示模式 |
| | | demo: false # 开启演示模式 |
| | | |
| | | justauth: |
| | | enabled: true |
| | |
| | | --- #################### 注册中心 + 配置中心相关配置 #################### |
| | | spring: |
| | | cloud: |
| | | nacos: |
| | | server-addr: 127.0.0.1:8848 # Nacos 服务器地址 |
| | | username: nacos |
| | | password: nacos |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: a7112341-c9e2-4177-bc5b-0d2e8cf0b3bb |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: 1.0.0 # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: a7112341-c9e2-4177-bc5b-0d2e8cf0b3bb |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | #spring: |
| | | # cloud: |
| | | # nacos: |
| | | # server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | # username: @nacos.username@ |
| | | # password: @nacos.password@ |
| | | # discovery: # 【配置中心】配置项 |
| | | # namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 |
| | | # group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | # metadata: |
| | | # version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | # config: # 【注册中心】配置项 |
| | | # namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 |
| | | # group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | --- #################### 数据库相关配置 #################### |
| | | spring: |
| | |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | url: jdbc:mysql://172.16.8.100:3306/iailab-platform?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| | | # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 |
| | | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 |
| | | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 |
| | |
| | | password: guest # RabbitMQ 服务的密码 |
| | | # Kafka 配置项,对应 KafkaProperties 配置类 |
| | | kafka: |
| | | bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 |
| | | bootstrap-servers: 172.16.8.100:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 |
| | | |
| | | --- #################### 定时任务相关配置 #################### |
| | | |
| | |
| | | job: |
| | | enabled: true # 是否开启调度中心,默认为 true 开启 |
| | | admin: |
| | | addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址 |
| | | addresses: http://172.16.8.100:9090/xxl-job-admin # 调度中心部署跟地址 |
| | | |
| | | --- #################### 服务保障相关配置 #################### |
| | | |
| | |
| | | --- #################### 注册中心 + 配置中心相关配置 #################### |
| | | spring: |
| | | application: |
| | | name: system-server |
| | | |
| | | profiles: |
| | | active: local |
| | | active: @profiles.active@ |
| | | |
| | | cloud: |
| | | nacos: |
| | | server-addr: @nacos.server@ # Nacos 服务器地址 |
| | | username: @nacos.username@ |
| | | password: @nacos.password@ |
| | | discovery: # 【配置中心】配置项 |
| | | namespace: @profiles.active@ |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | metadata: |
| | | version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 |
| | | config: # 【注册中心】配置项 |
| | | namespace: @profiles.active@ |
| | | group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP |
| | | |
| | | main: |
| | | allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 |
| | |
| | | |
| | | logging: |
| | | file: |
| | | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 |
| | | |
| | | --- #################### 接口文档配置 #################### |
| | | |
| | |
| | | job: |
| | | executor: |
| | | appname: ${spring.application.name} # 执行器 AppName |
| | | logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | logpath: @log.path@/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 |
| | | accessToken: default_token # 执行器通讯TOKEN |
| | | |
| | | --- #################### 验证码相关配置 #################### |
| | |
| | | description: 提供管理员管理的所有功能 |
| | | version: ${iailab.info.version} |
| | | tenant: # 多租户相关配置项 |
| | | enable: false |
| | | enable: true |
| | | ignore-urls: |
| | | - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号 |
| | | - /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号 |
| | |
| | | - /rpc-api/system/tenant/valid # 防止递归。避免调用 /rpc-api/system/tenant/valid 接口时,又去触发 /rpc-api/system/tenant/valid 去校验 |
| | | - /rpc-api/system/tenant/id-list # 获得租户列表的时候,无需传递租户编号 |
| | | - /rpc-api/system/oauth2/token/check # 访问令牌校验时,无需传递租户编号;主要解决上传文件的场景,前端不会传递 tenant-id! |
| | | ignore-caches: |
| | | - permission_menu_ids |
| | | - oauth_client |
| | | - notify_template |
| | | - mail_account |
| | | - mail_template |
| | | - sms_template |
| | | ignore-tables: |
| | | - system_tenant |
| | | - system_tenant_package |
| | |
| | | <module>iailab-framework</module> |
| | | <module>iailab-cloud</module> |
| | | <!-- 各种 module 拓展 --> |
| | | <!-- <module>iailab-module-ai</module>--> |
| | | <module>iailab-module-system</module> |
| | | <module>iailab-module-infra</module> |
| | | <module>iailab-module-bpm</module> |
| | |
| | | <dynamic-datasource.version>4.3.1</dynamic-datasource.version> |
| | | <mybatis-plus-join.version>1.4.13</mybatis-plus-join.version> |
| | | <easy-trans.version>3.0.5</easy-trans.version> |
| | | <redisson.version>3.32.0</redisson.version> <!-- Spring Boot 2.X 最多使用 3.18.0 版本,否则会报 Tuple NoClassDefFoundError --> |
| | | <redisson.version>3.18.0</redisson.version> <!-- Spring Boot 2.X 最多使用 3.18.0 版本,否则会报 Tuple NoClassDefFoundError --> |
| | | <dm8.jdbc.version>8.1.3.62</dm8.jdbc.version> |
| | | <!-- 消息队列 --> |
| | | <rocketmq-spring.version>2.3.0</rocketmq-spring.version> |
| | |
| | | <nacos.config.group>DEFAULT_GROUP</nacos.config.group> |
| | | <nacos.username>nacos</nacos.username> |
| | | <nacos.password>nacos</nacos.password> |
| | | <nacos.namespace>a7112341-c9e2-4177-bc5b-0d2e8cf0b3bb</nacos.namespace> |
| | | <nacos.metadata.version>1.0.0</nacos.metadata.version> |
| | | <log.path>D:\data</log.path> |
| | | <logstash.address>127.0.0.1:4560</logstash.address> |
| | | </properties> |
| | | <activation> |
| | |
| | | <nacos.config.group>DEFAULT_GROUP</nacos.config.group> |
| | | <nacos.username>nacos</nacos.username> |
| | | <nacos.password>nacos</nacos.password> |
| | | <nacos.namespace>a7112341-c9e2-4177-bc5b-0d2e8cf0b3bb</nacos.namespace> |
| | | <nacos.metadata.version>1.0.0</nacos.metadata.version> |
| | | <log.path>/home/iailab</log.path> |
| | | <logstash.address>127.0.0.1:4560</logstash.address> |
| | | </properties> |
| | | </profile> |