diff --git a/cloud-auth/pom.xml b/cloud-auth/pom.xml index 3921e2a..66dd4f4 100644 --- a/cloud-auth/pom.xml +++ b/cloud-auth/pom.xml @@ -16,11 +16,31 @@ + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + org.springframework.boot @@ -45,6 +65,7 @@ cloud-common-api-doc + com.alibaba.cloud @@ -87,6 +108,7 @@ cloud-common-log + diff --git a/cloud-auth/src/main/java/com/muyu/auth/controller/TokenController.java b/cloud-auth/src/main/java/com/muyu/auth/controller/TokenController.java index 8c84466..c0203ca 100644 --- a/cloud-auth/src/main/java/com/muyu/auth/controller/TokenController.java +++ b/cloud-auth/src/main/java/com/muyu/auth/controller/TokenController.java @@ -10,7 +10,11 @@ import com.muyu.common.security.auth.AuthUtil; import com.muyu.common.security.service.TokenService; import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.system.domain.LoginUser; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -25,16 +29,20 @@ import jakarta.servlet.http.HttpServletRequest; */ @RestController public class TokenController { + @Resource private TokenService tokenService; - @Resource + @Autowired + private SysLoginService sysLoginService; @PostMapping("login") public Result login (@RequestBody LoginBody form) { // 用户登录 + LoginUser userInfo = sysLoginService.login(form); + // 获取登录token return Result.success(tokenService.createToken(userInfo)); } diff --git a/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java b/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java index be8e264..da6d2ca 100644 --- a/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java +++ b/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java @@ -1,16 +1,21 @@ package com.muyu.auth.form; + import lombok.Data; + + /** * 用户登录对象 * * @author muyu */ + @Data public class LoginBody { private String firmCode; + /** * 用户名 */ @@ -20,4 +25,16 @@ public class LoginBody { * 用户密码 */ private String password; + + + + public String getUsername () { + return username; + } + + public void setUsername (String username) { + this.username = username; + } + + } diff --git a/cloud-auth/src/main/java/com/muyu/auth/service/SysLoginService.java b/cloud-auth/src/main/java/com/muyu/auth/service/SysLoginService.java index 929536e..a0008f5 100644 --- a/cloud-auth/src/main/java/com/muyu/auth/service/SysLoginService.java +++ b/cloud-auth/src/main/java/com/muyu/auth/service/SysLoginService.java @@ -13,14 +13,13 @@ import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.utils.ip.IpUtils; import com.muyu.common.redis.service.RedisService; import com.muyu.common.security.utils.SecurityUtils; +import com.muyu.common.system.domain.LoginUser; +import com.muyu.common.system.domain.SysUser; import com.muyu.common.system.remote.RemoteSaasService; import com.muyu.common.system.remote.RemoteUserService; -import com.muyu.common.system.domain.SysUser; -import com.muyu.common.system.domain.LoginUser; -import javax.annotation.Resource; import org.springframework.stereotype.Component; -import java.util.Set; +import javax.annotation.Resource; /** diff --git a/cloud-auth/src/main/java/com/muyu/auth/service/SysPasswordService.java b/cloud-auth/src/main/java/com/muyu/auth/service/SysPasswordService.java index 3303738..5a57e3b 100644 --- a/cloud-auth/src/main/java/com/muyu/auth/service/SysPasswordService.java +++ b/cloud-auth/src/main/java/com/muyu/auth/service/SysPasswordService.java @@ -6,7 +6,11 @@ import com.muyu.common.core.exception.ServiceException; import com.muyu.common.redis.service.RedisService; import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.system.domain.SysUser; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Component; import java.util.concurrent.TimeUnit; @@ -18,14 +22,22 @@ import java.util.concurrent.TimeUnit; */ @Component public class SysPasswordService { + @Resource + + @Autowired + private RedisService redisService; private int maxRetryCount = CacheConstants.PASSWORD_MAX_RETRY_COUNT; private Long lockTime = CacheConstants.PASSWORD_LOCK_TIME; + @Resource + + @Autowired + private SysRecordLogService recordLogService; /** diff --git a/cloud-auth/src/main/java/com/muyu/auth/service/SysRecordLogService.java b/cloud-auth/src/main/java/com/muyu/auth/service/SysRecordLogService.java index c4ae5e1..7bf50e1 100644 --- a/cloud-auth/src/main/java/com/muyu/auth/service/SysRecordLogService.java +++ b/cloud-auth/src/main/java/com/muyu/auth/service/SysRecordLogService.java @@ -6,7 +6,11 @@ import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.utils.ip.IpUtils; import com.muyu.common.system.remote.RemoteLogService; import com.muyu.common.system.domain.SysLogininfor; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Component; /** @@ -16,7 +20,11 @@ import org.springframework.stereotype.Component; */ @Component public class SysRecordLogService { + @Resource + + @Autowired + private RemoteLogService remoteLogService; /** diff --git a/cloud-common/cloud-common-core/pom.xml b/cloud-common/cloud-common-core/pom.xml index 45e6f33..29f8379 100644 --- a/cloud-common/cloud-common-core/pom.xml +++ b/cloud-common/cloud-common-core/pom.xml @@ -16,6 +16,7 @@ + com.github.yulichang mybatis-plus-join-boot-starter @@ -169,6 +170,13 @@ cn.hutool hutool-all + + + org.eclipse.paho + org.eclipse.paho.client.mqttv3 + 1.2.2 + + diff --git a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/SecurityConstants.java b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/SecurityConstants.java index 0e9b22d..c10b99f 100644 --- a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/SecurityConstants.java +++ b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/SecurityConstants.java @@ -46,8 +46,10 @@ public class SecurityConstants { */ public static final String ROLE_PERMISSION = "role_permission"; + /** * SAAS请求头的key */ public static final String SAAS_KEY = "ent-code"; + } diff --git a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java index fee414d..4397df7 100644 --- a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java +++ b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java @@ -29,4 +29,5 @@ public class ServiceNameConstants { public static final String ENT_SERVICE = "cloud-ent"; public static final String SAAS_SERVICE = "cloud-system-saas"; + } diff --git a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/context/SecurityContextHolder.java b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/context/SecurityContextHolder.java index f8866f7..51ae810 100644 --- a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/context/SecurityContextHolder.java +++ b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/context/SecurityContextHolder.java @@ -81,6 +81,7 @@ public class SecurityContextHolder { THREAD_LOCAL.remove(); } + public static String getSaasKey() { return get(SecurityConstants.SAAS_KEY); } @@ -88,4 +89,5 @@ public class SecurityContextHolder { set(SecurityConstants.SAAS_KEY,saasKey); } + } diff --git a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/JwtUtils.java b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/JwtUtils.java index c94e051..a063141 100644 --- a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/JwtUtils.java +++ b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/JwtUtils.java @@ -163,6 +163,7 @@ public class JwtUtils { return Convert.toStr(claims.get(key), ""); } + /** * 根据身份信息获取SAASKey * @@ -173,4 +174,5 @@ public class JwtUtils { public static String getSaasKey(Claims claims) { return getValue(claims, SecurityConstants.SAAS_KEY); } + } diff --git a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/ip/IpUtils.java b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/ip/IpUtils.java index e750583..d0b1c8c 100644 --- a/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/ip/IpUtils.java +++ b/cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/utils/ip/IpUtils.java @@ -58,7 +58,8 @@ public class IpUtils { ip = request.getRemoteAddr(); } - return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip); + + return "0:0:0:0:0:0:0:1".equals(ip) ? "106.54.193.225" : getMultistageReverseProxyIp(ip); } /** @@ -70,7 +71,10 @@ public class IpUtils { */ public static boolean internalIp (String ip) { byte[] addr = textToNumericFormatV4(ip); - return internalIp(addr) || "127.0.0.1".equals(ip); + + return internalIp(addr) || "106.54.193.225".equals(ip); + + } /** @@ -197,7 +201,8 @@ public class IpUtils { return InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { } - return "127.0.0.1"; + + return "106.54.193.225"; } /** diff --git a/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/aspect/LogAspect.java b/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/aspect/LogAspect.java index b8cabc4..5b7a752 100644 --- a/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/aspect/LogAspect.java +++ b/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/aspect/LogAspect.java @@ -18,7 +18,11 @@ import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.core.NamedThreadLocal; import org.springframework.http.HttpMethod; import org.springframework.stereotype.Component; @@ -48,7 +52,11 @@ public class LogAspect { */ private static final ThreadLocal TIME_THREADLOCAL = new NamedThreadLocal("Cost Time"); + @Resource + + @Autowired + private AsyncLogService asyncLogService; /** @@ -82,7 +90,7 @@ public class LogAspect { protected void handleLog (final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) { try { - // *========数据库日志=========*// + // *=数据库日志==*// SysOperLog operLog = new SysOperLog(); operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); // 请求的地址 diff --git a/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/service/AsyncLogService.java b/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/service/AsyncLogService.java index ab2d064..99f7962 100644 --- a/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/service/AsyncLogService.java +++ b/cloud-common/cloud-common-log/src/main/java/com/muyu/common/log/service/AsyncLogService.java @@ -4,6 +4,7 @@ import com.muyu.common.core.constant.SecurityConstants; import com.muyu.common.system.remote.RemoteLogService; import com.muyu.common.system.domain.SysOperLog; import javax.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -14,7 +15,7 @@ import org.springframework.stereotype.Service; */ @Service public class AsyncLogService { - @Resource + @Autowired private RemoteLogService remoteLogService; /** diff --git a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/callback/ConfirmCallback.java b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/callback/ConfirmCallback.java new file mode 100644 index 0000000..fe4c6b2 --- /dev/null +++ b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/callback/ConfirmCallback.java @@ -0,0 +1,44 @@ +package com.muyu.common.rabbit.callback; + +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.rabbit.connection.CorrelationData; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.stereotype.Component; + +/** + * @author Lenovo + * @Description 消息发送到broker确认回调 + */ + +@Slf4j +@Component +public class ConfirmCallback implements RabbitTemplate.ConfirmCallback { + + @Resource + private RabbitTemplate rabbitTemplate; + + /** + * 初始化 + */ + @PostConstruct + public void init() { + this.rabbitTemplate.setConfirmCallback(this); + } + + /** + * 回调确认方法(消息发送之后 消息无论发送成功还是失败都会执行这个回调方法) + * @param correlationData 回调的相关数据 + * @param ack 确认结果(true表示消息已经被broker接收,false表示消息未被broker接收) + * @param cause 失败原因(当ack为false时,表示拒绝接收消息的原因;当ack为true时,该值为空) + */ + @Override + public void confirm(CorrelationData correlationData, boolean ack, String cause) { + if (ack) { + log.info("消息发送到broker成功!"); + } else { + log.info("消息发送到broker失败,失败原因:{}", cause); + } + } +} diff --git a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/callback/ReturnsCallback.java b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/callback/ReturnsCallback.java new file mode 100644 index 0000000..6145c2c --- /dev/null +++ b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/callback/ReturnsCallback.java @@ -0,0 +1,39 @@ +package com.muyu.common.rabbit.callback; + +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.core.ReturnedMessage; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.stereotype.Component; + +/** + * @author Lenovo + * @Description 消息发送失败时回调 + */ + +@Slf4j +@Component +public class ReturnsCallback implements RabbitTemplate.ReturnsCallback { + + @Resource + private RabbitTemplate rabbitTemplate; + + /** + * 初始化 + */ + @PostConstruct + public void init() { + rabbitTemplate.setReturnsCallback(this); + } + + /** + * 消息发送到队列失败时执行 + * @param returnedMessage 返回的消息和元数据 + */ + @Override + public void returnedMessage(ReturnedMessage returnedMessage) { + log.info("消息:{}被交换机:{}回退!回退原因:{}", returnedMessage.getMessage().toString(), + returnedMessage.getExchange(), returnedMessage.getReplyText()); + } +} diff --git a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitAdminConfig.java b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitAdminConfig.java new file mode 100644 index 0000000..d87c912 --- /dev/null +++ b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitAdminConfig.java @@ -0,0 +1,72 @@ +package com.muyu.common.rabbit.config; + +import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; +import org.springframework.amqp.rabbit.connection.ConnectionFactory; +import org.springframework.amqp.rabbit.core.RabbitAdmin; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author Lenovo + * @Description RabbitMQ连接和管理功能配置 + */ + +@Configuration +public class RabbitAdminConfig { + + /** + * RabbitMQ服务器的主机地址 + */ + @Value("${spring.rabbitmq.host}") + private String host; + + /** + * RabbitMQ的用户名 + */ + @Value("${spring.rabbitmq.username}") + private String username; + + /** + * RabbitMQ的密码 + */ + @Value("${spring.rabbitmq.password}") + private String password; + + /** + * RabbitMQ的虚拟主机 + */ + @Value("${spring.rabbitmq.virtualhost}") + private String virtualhost; + + /** + * 创建并初始化RabbitAdmin实例 + * + * @return RabbitAdmin 实例 + */ + @Bean + public RabbitAdmin rabbitAdmin() { + RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory()); + rabbitAdmin.setAutoStartup(true); + return rabbitAdmin; + } + + /** + * 创建RabbitMQ连接工厂 + * + * @return ConnectionFactory 实例 + */ + @Bean + public ConnectionFactory connectionFactory() { + CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); + connectionFactory.setAddresses(host); + connectionFactory.setUsername(username); + connectionFactory.setPassword(password); + connectionFactory.setVirtualHost(virtualhost); + + // 配置发送确认回调时,次配置必须配置,否则即使在RabbitTemplate配置了ConfirmCallback也不会生效 + connectionFactory.setPublisherConfirmType(CachingConnectionFactory.ConfirmType.CORRELATED); + connectionFactory.setPublisherReturns(true); + return connectionFactory; + } +} diff --git a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitListenerConfig.java b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitListenerConfig.java new file mode 100644 index 0000000..0c99e3f --- /dev/null +++ b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitListenerConfig.java @@ -0,0 +1,57 @@ +package com.muyu.common.rabbit.config; + +import org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer; +import org.springframework.amqp.rabbit.connection.ConnectionFactory; +import org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.messaging.converter.MappingJackson2MessageConverter; +import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; + +/** + * @author Lenovo + * @Description rabbitMQ的监听器配置 + */ + +@Configuration +public class RabbitListenerConfig implements RabbitListenerConfigurer { + + static { + // 设置为信任所有类型的反序列化,确保消息能够正确反序列化 + System.setProperty("spring.amqp.deserialization.trust.all", "true"); + } + + /** + * RabbitMQ连接工厂,用于创建连接 + */ + @Autowired + public ConnectionFactory connectionFactory; + + + /** + * 创建处理器方法工厂的bean + * + * @return DefaultMessageHandlerMethodFactory 实例,用于处理消息的转换和方法调用 + */ + @Bean + public DefaultMessageHandlerMethodFactory handlerMethodFactory() { + DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); + // 这里的转换器设置实现了 通过 @Payload 注解 自动反序列化message body + factory.setMessageConverter(new MappingJackson2MessageConverter()); + return factory; + } + + /** + * 配置RabbitMQ监听器的消息处理方法工厂。 + * + * @param rabbitListenerEndpointRegistrar 实例,用于注册监听器的配置 + */ + @Override + public void configureRabbitListeners(RabbitListenerEndpointRegistrar rabbitListenerEndpointRegistrar) { + // 注册自定义的消息处理方法工厂 + rabbitListenerEndpointRegistrar.setMessageHandlerMethodFactory(handlerMethodFactory()); + } + +} + diff --git a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitListenerConfigurer.java b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitListenerConfigurer.java index ba95bbb..abf3718 100644 --- a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitListenerConfigurer.java +++ b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitListenerConfigurer.java @@ -2,7 +2,7 @@ package com.muyu.common.rabbit.config; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar; -import javax.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.converter.MappingJackson2MessageConverter; @@ -16,7 +16,7 @@ public class RabbitListenerConfigurer implements org.springframework.amqp.rabbit } //以下配置RabbitMQ消息服务 - @Resource + @Autowired public ConnectionFactory connectionFactory; diff --git a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitMQMessageConverterConfig.java b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitMQMessageConverterConfig.java new file mode 100644 index 0000000..6096282 --- /dev/null +++ b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/config/RabbitMQMessageConverterConfig.java @@ -0,0 +1,26 @@ + +package com.muyu.common.rabbit.config; + +import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; +import org.springframework.amqp.support.converter.MessageConverter; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author Lenovo + * @Description rabbitMQ消息转换器配置 + */ + +@Configuration +public class RabbitMQMessageConverterConfig { + + /** + * 消息转换配置 + * + * @return 消息转换器 + */ + @Bean + public MessageConverter jsonMessageConverter() { + return new Jackson2JsonMessageConverter(); + } +} diff --git a/cloud-common/cloud-common-rabbit/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/cloud-common/cloud-common-rabbit/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index f276344..292c5ed 100644 --- a/cloud-common/cloud-common-rabbit/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/cloud-common/cloud-common-rabbit/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,3 +1,7 @@ -com.muyu.common.rabbit.config.RabbitListenerConfigurer -com.muyu.common.rabbit.config.ConfirmCallbackConfig -com.muyu.common.rabbit.config.ReturnCallbackConfig + +com.muyu.common.rabbit.config.RabbitListenerConfig +com.muyu.common.rabbit.config.RabbitAdminConfig +com.muyu.common.rabbit.config.RabbitMQMessageConverterConfig + +com.muyu.common.rabbit.RabbitListenerConfigurer + diff --git a/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java b/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java index cbd59db..2c1cad4 100644 --- a/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java +++ b/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java @@ -1,12 +1,14 @@ package com.muyu.common.redis.service; -import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.BoundSetOperations; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Component; +import javax.annotation.Resource; import java.util.*; import java.util.concurrent.TimeUnit; @@ -18,7 +20,11 @@ import java.util.concurrent.TimeUnit; @SuppressWarnings(value = {"unchecked", "rawtypes"}) @Component public class RedisService { + @Resource + + @Autowired + public RedisTemplate redisTemplate; /** diff --git a/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/constents/DatasourceContent.java b/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/constents/DatasourceContent.java index 2ceb282..976d688 100644 --- a/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/constents/DatasourceContent.java +++ b/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/constents/DatasourceContent.java @@ -13,7 +13,7 @@ public class DatasourceContent { public final static String PASSWORD = "bawei2112A"; - public final static String IP = "127.0.0.1"; + public final static String IP = "106.54.193.225"; public final static Integer PORT = 3306; } diff --git a/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/interceptor/HeaderInterceptor.java b/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/interceptor/HeaderInterceptor.java index 44cff61..6207d20 100644 --- a/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/interceptor/HeaderInterceptor.java +++ b/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/interceptor/HeaderInterceptor.java @@ -28,7 +28,10 @@ public class HeaderInterceptor implements AsyncHandlerInterceptor { } SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID)); + SecurityContextHolder.setSaasKey(ServletUtils.getHeader(request, SecurityConstants.SAAS_KEY)); + + SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME)); SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY)); diff --git a/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/utils/SecurityUtils.java b/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/utils/SecurityUtils.java index 89b57a6..3539983 100644 --- a/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/utils/SecurityUtils.java +++ b/cloud-common/cloud-common-security/src/main/java/com/muyu/common/security/utils/SecurityUtils.java @@ -30,10 +30,13 @@ public class SecurityUtils { return SecurityContextHolder.getUserName(); } + public static String getSaasKey () { return SecurityContextHolder.getSaasKey(); } + + /** * 获取用户key */ diff --git a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/LoginUser.java b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/LoginUser.java index 4c8aa05..9bdf66b 100644 --- a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/LoginUser.java +++ b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/LoginUser.java @@ -65,4 +65,7 @@ public class LoginUser implements Serializable { + + + } diff --git a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java index 6c2f7c2..e65790e 100644 --- a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java +++ b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysDept.java @@ -34,8 +34,11 @@ public class SysDept extends BaseEntity { */ private Long parentId; + private String firmCode; + + /** * 祖级列表 */ diff --git a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysRole.java b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysRole.java index 9844e5a..568efee 100644 --- a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysRole.java +++ b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysRole.java @@ -36,8 +36,11 @@ public class SysRole extends BaseEntity { @Excel(name = "角色名称") private String roleName; + private String firmCode; + + /** * 角色权限 */ diff --git a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/RemoteUserService.java b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/RemoteUserService.java index ca0bb3f..4bf1629 100644 --- a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/RemoteUserService.java +++ b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/RemoteUserService.java @@ -3,6 +3,7 @@ package com.muyu.common.system.remote; import com.muyu.common.core.constant.SecurityConstants; import com.muyu.common.core.constant.ServiceNameConstants; import com.muyu.common.core.domain.Result; + import com.muyu.common.system.domain.*; import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -11,6 +12,14 @@ import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Set; + +import com.muyu.common.system.domain.SysUser; +import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory; +import com.muyu.common.system.domain.LoginUser; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + + /** * 用户服务 * @@ -19,6 +28,19 @@ import java.util.Set; @FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class) public interface RemoteUserService { + + /** + * 通过用户名查询用户信息 + * + * @param username 用户名 + * @param source 请求来源 + * + * @return 结果 + */ + @GetMapping("/user/info/{username}") + public Result getUserInfo (@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + /** * 注册用户信息 * @@ -30,6 +52,7 @@ public interface RemoteUserService { @PostMapping("/user/register") public Result registerUserInfo (@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + @GetMapping("/user/companyList") public Result> companyList (); @@ -98,4 +121,6 @@ public interface RemoteUserService { */ @PostMapping("/user") public Result addUser (@RequestBody SysUser user); + + } diff --git a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/factory/RemoteUserFallbackFactory.java b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/factory/RemoteUserFallbackFactory.java index 2e0ecf6..69fff6f 100644 --- a/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/factory/RemoteUserFallbackFactory.java +++ b/cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/remote/factory/RemoteUserFallbackFactory.java @@ -1,17 +1,26 @@ package com.muyu.common.system.remote.factory; import com.muyu.common.core.domain.Result; + import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.system.domain.*; import com.muyu.common.system.remote.RemoteUserService; + +import com.muyu.common.system.remote.RemoteUserService; +import com.muyu.common.system.domain.SysUser; +import com.muyu.common.system.domain.LoginUser; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; + import java.util.List; import java.util.Set; + + /** * 用户服务降级处理 * @@ -26,11 +35,19 @@ public class RemoteUserFallbackFactory implements FallbackFactory getUserInfo (String username, String source) { + return Result.error("获取用户失败:" + throwable.getMessage()); + } + + @Override public Result registerUserInfo (SysUser sysUser, String source) { return Result.error("注册用户失败:" + throwable.getMessage()); } + @Override public Result> companyList() { return Result.error("获取企业列表失败:" + throwable.getMessage()); @@ -76,6 +93,8 @@ public class RemoteUserFallbackFactory implements FallbackFactoryknife4j-gateway-spring-boot-starter 4.5.0 + + diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/CloudGatewayApplication.java b/cloud-gateway/src/main/java/com/muyu/gateway/CloudGatewayApplication.java index f962432..18712cd 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/CloudGatewayApplication.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/CloudGatewayApplication.java @@ -13,6 +13,9 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; public class CloudGatewayApplication { public static void main (String[] args) { SpringApplication.run(CloudGatewayApplication.class, args); + System.out.println("CloudGateway 模块启动成功!"); + + } } diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/config/RouterFunctionConfiguration.java b/cloud-gateway/src/main/java/com/muyu/gateway/config/RouterFunctionConfiguration.java index cc95d0a..4cb258e 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/config/RouterFunctionConfiguration.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/config/RouterFunctionConfiguration.java @@ -1,7 +1,11 @@ package com.muyu.gateway.config; import com.muyu.gateway.handler.ValidateCodeHandler; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; @@ -16,7 +20,11 @@ import org.springframework.web.reactive.function.server.RouterFunctions; */ @Configuration public class RouterFunctionConfiguration { + @Resource + + @Autowired + private ValidateCodeHandler validateCodeHandler; @SuppressWarnings("rawtypes") diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/filter/AccessLogFilter.java b/cloud-gateway/src/main/java/com/muyu/gateway/filter/AccessLogFilter.java index 9ceec12..08d026b 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/filter/AccessLogFilter.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/filter/AccessLogFilter.java @@ -177,7 +177,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered { }; } - // ========== 参考 ModifyRequestBodyGatewayFilterFactory 中的方法 ========== + // === 参考 ModifyRequestBodyGatewayFilterFactory 中的方法 === /** * 请求装饰器,支持重新计算 headers、body 缓存 @@ -210,7 +210,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered { }; } - // ========== 参考 ModifyResponseBodyGatewayFilterFactory 中的方法 ========== + // === 参考 ModifyResponseBodyGatewayFilterFactory 中的方法 === private byte[] readContent(List dataBuffers) { // 合并多个流集合,解决返回体分段传输 diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/filter/XssFilter.java b/cloud-gateway/src/main/java/com/muyu/gateway/filter/XssFilter.java index 719dd4d..4b8adad 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/filter/XssFilter.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/filter/XssFilter.java @@ -4,7 +4,11 @@ import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.utils.html.EscapeUtil; import com.muyu.gateway.config.properties.XssProperties; import io.netty.buffer.ByteBufAllocator; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.cloud.gateway.filter.GatewayFilterChain; import org.springframework.cloud.gateway.filter.GlobalFilter; @@ -31,7 +35,11 @@ import java.nio.charset.StandardCharsets; @ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true") public class XssFilter implements GlobalFilter, Ordered { // 跨站脚本的 xss 配置,nacos自行添加 + @Resource + + @Autowired + private XssProperties xss; @Override diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/handler/ValidateCodeHandler.java b/cloud-gateway/src/main/java/com/muyu/gateway/handler/ValidateCodeHandler.java index 3daceb5..9b5ad59 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/handler/ValidateCodeHandler.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/handler/ValidateCodeHandler.java @@ -3,7 +3,11 @@ package com.muyu.gateway.handler; import com.muyu.common.core.exception.CaptchaException; import com.muyu.common.core.domain.Result; import com.muyu.gateway.service.ValidateCodeService; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.BodyInserters; @@ -21,7 +25,11 @@ import java.io.IOException; */ @Component public class ValidateCodeHandler implements HandlerFunction { + @Resource + + @Autowired + private ValidateCodeService validateCodeService; @Override diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java b/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java index 8e00059..978a3b4 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java @@ -12,7 +12,7 @@ import com.muyu.common.redis.service.RedisService; import com.muyu.gateway.config.properties.CaptchaProperties; import com.muyu.gateway.model.resp.CaptchaCodeResp; import com.muyu.gateway.service.ValidateCodeService; -import javax.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.FastByteArrayOutputStream; @@ -35,10 +35,10 @@ public class ValidateCodeServiceImpl implements ValidateCodeService { @Resource(name = "captchaProducerMath") private Producer captchaProducerMath; - @Resource + @Autowired private RedisService redisService; - @Resource + @Autowired private CaptchaProperties captchaProperties; /** diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/utils/WebFrameworkUtils.java b/cloud-gateway/src/main/java/com/muyu/gateway/utils/WebFrameworkUtils.java index 68b0a19..ec559e1 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/utils/WebFrameworkUtils.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/utils/WebFrameworkUtils.java @@ -4,6 +4,11 @@ import cn.hutool.core.net.NetUtil; import cn.hutool.core.util.ArrayUtil; import com.alibaba.fastjson2.JSONObject; import lombok.extern.log4j.Log4j2; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import org.springframework.cloud.gateway.route.Route; import org.springframework.cloud.gateway.support.ServerWebExchangeUtils; import org.springframework.core.io.buffer.DataBufferFactory; @@ -16,6 +21,11 @@ import reactor.core.publisher.Mono; /** * Web 工具类 + + + * + * + */ @Log4j2 public class WebFrameworkUtils { @@ -68,6 +78,11 @@ public class WebFrameworkUtils { /** * 获得客户端 IP + + + * + * + * @param exchange 请求 * @param otherHeaderNames 其它 header 名字的数组 * @return 客户端 IP @@ -85,6 +100,10 @@ public class WebFrameworkUtils { return NetUtil.getMultistageReverseProxyIp(ip); } } + + + + // 方式二,通过 remoteAddress 获取 if (exchange.getRequest().getRemoteAddress() == null) { return null; @@ -95,6 +114,10 @@ public class WebFrameworkUtils { /** * 获得请求匹配的 Route 路由 + + + * + * @param exchange 请求 * @return 路由 */ diff --git a/cloud-modules/cloud-modules-car-gateway/pom.xml b/cloud-modules/cloud-modules-car-gateway/pom.xml new file mode 100644 index 0000000..814c945 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/pom.xml @@ -0,0 +1,114 @@ + + + 4.0.0 + + com.muyu + cloud-modules + 3.6.3 + + + cloud-modules-car-gateway + + + 17 + 17 + UTF-8 + + + + com.muyu + cloud-common-core + + + com.muyu + cloud-common-security + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + com.mysql + mysql-connector-j + + + + + com.muyu + cloud-common-datasource + + + + + com.muyu + cloud-common-datascope + + + + + com.muyu + cloud-common-api-doc + + + com.muyu + cloud-common-rabbit + + + + + org.apache.httpcomponents + httpcore + 4.4.12 + + + org.apache.httpcomponents + httpclient + 4.5.13 + + + + com.aliyun + ecs20140526 + 5.1.8 + + + com.aliyun + tea-openapi + 0.3.2 + + + com.aliyun + tea-console + 0.0.1 + + + com.aliyun + tea-util + 0.2.21 + + + + diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/Aliyun/AliYunConfig.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/Aliyun/AliYunConfig.java new file mode 100644 index 0000000..489a044 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/Aliyun/AliYunConfig.java @@ -0,0 +1,41 @@ +package com.muyu.cargateway.Aliyun; + +import com.aliyun.ecs20140526.Client; +import com.aliyun.teaopenapi.models.Config; +import com.muyu.cargateway.config.AliProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author Lenovo + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-07-18:40 + * @ Version:1.0 + * @ Description:Ali客户端 + */ +@Configuration +public class AliYunConfig { + + @Autowired + private AliProperties aliProperties; + + @Bean + public Client createClient() { + // 工程代码泄露可能会导致 AccessKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考。 + Config config = new Config() + // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。 + .setAccessKeyId(aliProperties.getAccessKeyId()) + // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。 + .setAccessKeySecret(aliProperties.getAccessKeySecret()); + // Endpoint 请参考 https://api.aliyun.com/product/Ecs + config.endpoint = aliProperties.getEndpoint(); + try { + return new Client(config); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/Aliyun/service/AliYunEcsService.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/Aliyun/service/AliYunEcsService.java new file mode 100644 index 0000000..753c3e3 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/Aliyun/service/AliYunEcsService.java @@ -0,0 +1,199 @@ +package com.muyu.cargateway.Aliyun.service; + +import com.aliyun.ecs20140526.Client; +import com.aliyun.ecs20140526.models.*; +import com.aliyun.tea.TeaException; +import com.aliyun.teautil.models.RuntimeOptions; +import com.muyu.cargateway.config.AliProperties; +import com.muyu.cargateway.domain.AliInstance; +import com.muyu.common.core.exception.ServiceException; +import com.muyu.common.redis.service.RedisService; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Lenovo + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-07-18:43 + * @ Version:1.0 + * @ Description:ali业务层 + */ +@Log4j2 +@Service +public class AliYunEcsService { + /** + * 阿里云配置 + */ + @Autowired + private AliProperties aliProperties; + /** + * 阿里云客户端 + */ + @Autowired + private Client client; + /** + * redis缓存 + */ + @Autowired + private RedisService redisService; + + /** + * 生成实例 + * + * @param amount 生成数量 + * @return 实例id集合 + */ + public List generateInstance(Integer amount) { + redisService.deleteObject("instanceIds"); + redisService.deleteObject("instanceList"); + // 检查生成实例的数量是否有效 + if (amount == null || amount <= 0) { + throw new ServiceException("生成数量不能小于1"); + } + +// 初始化系统盘配置 + RunInstancesRequest.RunInstancesRequestSystemDisk systemDisk = new RunInstancesRequest.RunInstancesRequestSystemDisk(); + systemDisk.setSize("40"); + systemDisk.setCategory("cloud_essd"); + +// 创建创建实例请求对象并设置参数 + RunInstancesRequest runInstancesRequest = new RunInstancesRequest() + // 设置地域ID + .setRegionId(aliProperties.getRegionId()) + // 设置镜像ID + .setImageId(aliProperties.getImageId()) + // 设置实例规格类型 + .setInstanceType(aliProperties.getInstanceType()) + // 设置安全组ID + .setSecurityGroupId(aliProperties.getSecurityGroupId()) + // 设置虚拟交换机ID + .setVSwitchId(aliProperties.getSwitchId()) + // 设置实例名称 + .setInstanceName("server-mqtt") + // 设置付费类型 按量付费 + .setInstanceChargeType("PostPaid") + // 设置系统盘配置 + .setSystemDisk(systemDisk) + // 设置用户名 + .setHostName("root") + // 设置密码 + .setPassword("10160810@a") + // 设置要创建的实例数量 + .setAmount(amount) + .setInternetChargeType("PayByTraffic") + .setInternetMaxBandwidthOut(1); + + // 创建运行时选项对象 + RuntimeOptions runtimeOptions = new RuntimeOptions(); + + // 尝试执行创建实例请求 + try { + // 复制代码运行请自行打印 API 的返回值 + RunInstancesResponse runInstancesResponse = client.runInstancesWithOptions(runInstancesRequest, runtimeOptions); + if (runInstancesResponse.getStatusCode() != 200) { + throw new ServiceException("查询实例状态失败"); + } + log.info("实例创建成功: {}", runInstancesResponse.getBody().getInstanceIdSets().instanceIdSet); + RunInstancesResponseBody body = runInstancesResponse.getBody(); + RunInstancesResponseBody.RunInstancesResponseBodyInstanceIdSets instanceIdSets = body.getInstanceIdSets(); + return new ArrayList<>(instanceIdSets.instanceIdSet); + } catch (Exception error) { + log.error("创建阿里云实例报错:[{}]", error.getMessage()); + throw new ServiceException(error.getMessage()); + } + } + + /** + * 根据实例id查询实例信息 + * + * @param instanceIds 实例id集合 + */ + public List selectInstance(List instanceIds) throws Exception { + // 检查实例ID列表是否为空,如果为空则抛出异常 + if (instanceIds == null || instanceIds.isEmpty()) { + throw new ServiceException("实例id不能为空"); + } + // 创建查询实例的请求对象 + DescribeInstancesRequest request = new DescribeInstancesRequest() + .setRegionId(aliProperties.getRegionId()); + + // 创建运行时选项对象,用于配置请求的额外参数 + RuntimeOptions runtimeOptions = new RuntimeOptions(); + List aliInstances = new ArrayList<>(); + try { + // 发送请求并获取响应对象 + DescribeInstancesResponse describeInstancesResponse = client.describeInstancesWithOptions(request, runtimeOptions); + // 检查响应状态码,如果为200则表示查询失败,抛出异常 + if (describeInstancesResponse.getStatusCode() != 200) { + throw new ServiceException("查询实例状态失败"); + } + List instance = describeInstancesResponse.getBody().getInstances().getInstance(); + for (DescribeInstancesResponseBody.DescribeInstancesResponseBodyInstancesInstance bodyInstance : instance) { + // 实例id + String instanceId = bodyInstance.getInstanceId(); + log.info("实例id为:{}", instanceId); + // ip地址 + String ipAddress = bodyInstance.getPublicIpAddress().getIpAddress().get(0); + log.info("实例ip为:{}", ipAddress); + // 实例状态 + String status = bodyInstance.getStatus(); + log.info("实例状态为:{}", status); + AliInstance aliInstance = new AliInstance(instanceId, ipAddress, status); + aliInstances.add(aliInstance); + } + log.info("查询成功"); + } catch (Exception e) { + log.error("查询服务器实例错误:[{}]", e.getMessage(), e); + throw new RuntimeException(e); + } + return aliInstances; + } + + /** + * 删除实例 + */ + public void deleteInstance() throws Exception { + DescribeInstancesRequest attributeRequest = new DescribeInstancesRequest(); + attributeRequest.setRegionId(aliProperties.getRegionId()); + + RuntimeOptions runtimeOptions = new RuntimeOptions(); + + DescribeInstancesResponse instancesWithOptions = client.describeInstancesWithOptions(attributeRequest, runtimeOptions); + ArrayList list = new ArrayList<>(); + DescribeInstancesResponseBody body = instancesWithOptions.getBody(); + for (DescribeInstancesResponseBody.DescribeInstancesResponseBodyInstancesInstance instance : body.instances.instance) { + list.add(instance.getInstanceId()); + } + log.info("list:" + list); + DeleteInstancesRequest deleteInstancesRequest = new DeleteInstancesRequest(); + deleteInstancesRequest.setRegionId(aliProperties.getRegionId()) + .setDryRun(false) + .setForce(true) + .setTerminateSubscription(true) + .setInstanceId(list); + RuntimeOptions runtime = new RuntimeOptions(); + try { + client.deleteInstancesWithOptions(deleteInstancesRequest, runtime); + } catch (TeaException error) { + // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。 + // 错误 message + System.out.println(error.getMessage()); + // 诊断地址 + System.out.println(error.getData().get("Recommend")); + com.aliyun.teautil.Common.assertAsString(error.message); + } catch (Exception _error) { + TeaException error = new TeaException(_error.getMessage(), _error); + // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。 + // 错误 message + System.out.println(error.getMessage()); + // 诊断地址 + System.out.println(error.getData().get("Recommend")); + com.aliyun.teautil.Common.assertAsString(error.message); + } + } +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/CarGatewayApplication.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/CarGatewayApplication.java new file mode 100644 index 0000000..bce08e8 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/CarGatewayApplication.java @@ -0,0 +1,25 @@ +package com.muyu.cargateway; + +import com.muyu.common.security.annotation.EnableCustomConfig; +import lombok.extern.log4j.Log4j2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-17-15:00 + * @ Version:1.0 + * @ Description:故障启动类 + * @author Lenovo + */ +@Log4j2 +@EnableCustomConfig +@EnableFeignClients +@SpringBootApplication +public class CarGatewayApplication { + public static void main(String[] args) { + SpringApplication.run(CarGatewayApplication.class, args); + } +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/config/AliProperties.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/config/AliProperties.java new file mode 100644 index 0000000..c0ff543 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/config/AliProperties.java @@ -0,0 +1,55 @@ +package com.muyu.cargateway.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * @author Lenovo + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-07-18:34 + * @ Version:1.0 + * @ Description:Ali配置类 + */ +@Data +@Configuration +@ConfigurationProperties(prefix = "aliyun") +public class AliProperties { + /** + * key + */ + private String accessKeyId; + /** + * secret + */ + private String accessKeySecret; + /** + * 地域 + */ + private String endpoint; + /** + * 地域id + */ + private String regionId; + /** + * 镜像id + */ + private String imageId; + /** + * 实例规格 + */ + private String instanceType; + /** + * 安全组id + */ + private String securityGroupId; + /** + * 虚拟交换机ID + */ + private String switchId; + /** + * 生成实例数量 + */ + private Integer amount; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/config/RabbitmqConfig.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/config/RabbitmqConfig.java new file mode 100644 index 0000000..734b37f --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/config/RabbitmqConfig.java @@ -0,0 +1,100 @@ +package com.muyu.cargateway.config; + +import lombok.extern.log4j.Log4j2; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.amqp.core.*; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author Lenovo + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-04-15:13 + * @ Version:1.0 + * @ Description:rabbitmq配置类 + */ +@Log4j2 +@Configuration +public class RabbitmqConfig { + // 日志 + private static final Logger logger = LoggerFactory.getLogger(RabbitmqConfig.class); + + /** + * 队列 + */ + public static final String QUEUE_INFORM_EMAIL = "queue_inform_email"; + /** + * 队列 + */ + public static final String QUEUE_INFORM_SMS = "queue_inform_sms"; + /** + * 交换机 + */ + public static final String EXCHANGE_TOPICS_INFORM = "exchange_topics_inform"; + /** + * 路由key + */ + public static final String ROUTINGKEY_EMAIL = "inform.#.email.#"; + /** + * 路由key + */ + public static final String ROUTINGKEY_SMS = "inform.#.sms.#"; + + /** + * 声明交换机,做持久化 + */ + @Bean(EXCHANGE_TOPICS_INFORM) + public Exchange exchangeTopicsInform() { + try { + Exchange exchange = ExchangeBuilder.topicExchange(EXCHANGE_TOPICS_INFORM).durable(true).build(); + log.info("创建的交换机为: {}", EXCHANGE_TOPICS_INFORM); + return exchange; + } catch (Exception e) { + log.error("创建该: {} 交换机失败", EXCHANGE_TOPICS_INFORM, e); + throw e; + } + } + + // 声明QUEUE_INFORM_EMAIL队列 + @Bean(QUEUE_INFORM_EMAIL) + public Queue queueInformEmail() { + try { + Queue queue = new Queue(QUEUE_INFORM_EMAIL); + log.info("创建的队列为: {}", QUEUE_INFORM_EMAIL); + return queue; + } catch (Exception e) { + log.error("创建该: {} 队列失败", QUEUE_INFORM_EMAIL, e); + throw e; + } + } + + // 声明QUEUE_INFORM_SMS队列 + @Bean(QUEUE_INFORM_SMS) + public Queue queueInformSms() { + try { + Queue queue = new Queue(QUEUE_INFORM_SMS); + log.info("创建的队列为: {}", QUEUE_INFORM_SMS); + return queue; + } catch (Exception e) { + log.error("创建该: {} 队列失败", QUEUE_INFORM_SMS, e); + throw e; + } + } + + //ROUTINGKEY_EMAIL队列绑定交换机,指定routingKey + @Bean + public Binding bindingQueueInformEmail(@Qualifier(QUEUE_INFORM_EMAIL) Queue queue, + @Qualifier(EXCHANGE_TOPICS_INFORM) Exchange exchange) { + return BindingBuilder.bind(queue).to(exchange).with(ROUTINGKEY_EMAIL).noargs(); + } + + //ROUTINGKEY_SMS队列绑定交换机,指定routingKey + @Bean + public Binding bindingRoutingKeySms(@Qualifier(QUEUE_INFORM_SMS) Queue queue, + @Qualifier(EXCHANGE_TOPICS_INFORM) Exchange exchange) { + return BindingBuilder.bind(queue).to(exchange).with(ROUTINGKEY_SMS).noargs(); + } +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/controller/CarOneClickOperationController.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/controller/CarOneClickOperationController.java new file mode 100644 index 0000000..8173dc7 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/controller/CarOneClickOperationController.java @@ -0,0 +1,42 @@ +package com.muyu.cargateway.controller; + +import com.muyu.cargateway.domain.model.MqttServerModel; +import com.muyu.cargateway.domain.req.VehicleConnectionReq; +import com.muyu.cargateway.service.CarOneClickOperationService; +import com.muyu.common.core.domain.Result; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +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; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-26-20:14 + * @ Version:1.0 + * @ Description:车辆 + * @author Lenovo + */ +@Log4j2 +@RestController +@RequestMapping("/vehicleGateway") +@Tag(name = "连接车辆控制层") +public class CarOneClickOperationController { + @Autowired + private CarOneClickOperationService carOneClickOperationService; + + /** + * 获取http连接的参数 + * @param vehicleConnectionReq + * @return + */ + @PostMapping("/receiveMsg/connect") + public Result receiveMsg(@RequestBody VehicleConnectionReq vehicleConnectionReq){ + log.info(">"+vehicleConnectionReq); + MqttServerModel mqttServerModel =carOneClickOperationService.getConnect(vehicleConnectionReq); + return Result.success(mqttServerModel); + } +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/AliInstance.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/AliInstance.java new file mode 100644 index 0000000..eb1b4ae --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/AliInstance.java @@ -0,0 +1,34 @@ +package com.muyu.cargateway.domain; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-30-9:33 + * @ Version:1.0 + * @ Description: + * @author Lenovo + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AliInstance { + /** + *实例ID + */ + private String instanceId; + /** + * 实例IP + */ + private String ipAddress; + /** + * 实例状态 + */ + private String status; + +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/AliServerConfig.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/AliServerConfig.java new file mode 100644 index 0000000..b6d545a --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/AliServerConfig.java @@ -0,0 +1,46 @@ +package com.muyu.cargateway.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-28-16:37 + * @ Version:1.0 + * @ Description:创建实例的配置 + * @author Lenovo + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AliServerConfig { + /** + * 主键 + */ + private Long id; + /** + * 地域ID + */ + private String regionId; + /** + * 镜像ID + */ + private String imageId; + /** + * 实例规格 + */ + private String instanceType; + /** + * 安全组ID + */ + private String securityGroupId; + /** + * 虚拟交换机ID + */ + private String vSwitchId; + + +} + diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/ConnectWeight.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/ConnectWeight.java new file mode 100644 index 0000000..efd0076 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/ConnectWeight.java @@ -0,0 +1,27 @@ +package com.muyu.cargateway.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-04-15:16 + * @ Version:1.0 + * @ Description:车辆服务器 + * @author Lenovo + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ConnectWeight { + /** + * 车辆服务器IP + */ + private String carServerIp; + /** + * 权重值 + */ + private Integer weightValue; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/HttpStatus.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/HttpStatus.java new file mode 100644 index 0000000..8665adb --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/HttpStatus.java @@ -0,0 +1,93 @@ +package com.muyu.cargateway.domain; + +/** + * 返回状态码 + * + * @author ruoyi + */ +public class HttpStatus { + /** + * 操作成功 + */ + public static final int SUCCESS = 200; + + /** + * 对象创建成功 + */ + public static final int CREATED = 201; + + /** + * 请求已经被接受 + */ + public static final int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + public static final int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + public static final int MOVED_PERM = 301; + + /** + * 重定向 + */ + public static final int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + public static final int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + public static final int BAD_REQUEST = 400; + + /** + * 未授权 + */ + public static final int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + public static final int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + public static final int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + public static final int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + public static final int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + public static final int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + public static final int ERROR = 500; + + /** + * 接口未实现 + */ + public static final int NOT_IMPLEMENTED = 501; + + /** + * 系统警告消息 + */ + public static final int WARN = 601; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/ServerConfig.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/ServerConfig.java new file mode 100644 index 0000000..6628de0 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/ServerConfig.java @@ -0,0 +1,58 @@ +package com.muyu.cargateway.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-27-20:56 + * @ Version:1.0 + * @ Description:服务器配置 + * @author Lenovo + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@TableName(value="server_config") +public class ServerConfig { + /** + * 主键 + */ + @TableId(value = "id",type = IdType.AUTO) + private Long id; + /** + * 租户id + */ + private String tenantId; + /** + * 主机地址 + */ + private String host; + /** + * 端口 + */ + private String port; + /** + * 负载的地址 + */ + private String uri; + /** + * 默认MQTT地址 + */ + private String defaultMqttAddr; + /** + * 默认MQTT主题 + */ + private String defaultMqttTopic; + /** + * 默认MQTT QOS + */ + private Integer defaultMqttQos; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/VehicleConnection.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/VehicleConnection.java new file mode 100644 index 0000000..819d48e --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/VehicleConnection.java @@ -0,0 +1,39 @@ +package com.muyu.cargateway.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-06-11:05 + * @ Version:1.0 + * @ Description:车辆鉴权的参数 + * @author Lenovo + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VehicleConnection { + /** + * 车辆VIN + */ + private String vehicleVin; + /** + * 用户名 + */ + private String username; + /** + * 时间戳 + */ + private String timestamp; + /** + * 随机数 + */ + private String nonce; + /** + * 密码 + */ + private String password; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/VinIp.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/VinIp.java new file mode 100644 index 0000000..b6787f9 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/VinIp.java @@ -0,0 +1,27 @@ +package com.muyu.cargateway.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-03-10:10 + * @ Version:1.0 + * @ Description:车辆vin + * @author Lenovo + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VinIp { + /** + * 车辆的vin + */ + String vehicleVin; + /** + * 车辆的ip + */ + String ipAddress; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/model/MqttServerModel.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/model/MqttServerModel.java new file mode 100644 index 0000000..2f29353 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/model/MqttServerModel.java @@ -0,0 +1,29 @@ +package com.muyu.cargateway.domain.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-03-10:12 + * @ Version:1.0 + * @ Description:Mqtt服务模型 + * @author Lenovo + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class MqttServerModel { + /** + * Mqtt服务节点 + */ + private String broker; + /** + * MQTT订阅主题 + */ + private String topic; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/model/TaskModel.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/model/TaskModel.java new file mode 100644 index 0000000..f4ea58c --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/model/TaskModel.java @@ -0,0 +1,87 @@ +package com.muyu.cargateway.domain.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.log4j.Log4j2; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-26-20:23 + * @ Version:1.0 + * @ Description:任务执行模型 + * @author Lenovo + */ +@Data +@Log4j2 +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaskModel { + /** + * 任务状态 默认为false状态 + * true为执行中,false为未执行 + */ + private final AtomicBoolean status =new AtomicBoolean(Boolean.FALSE); + /** + * 堵塞计数器 + */ + private CountDownLatch countDownLatch; + /** + * 任务执行堵塞队列 + */ + private LinkedBlockingDeque carQueue =new LinkedBlockingDeque<>(); + /** + * 任务是否执行 + * true 执行中 + * false 未执行 + * @return 是否有任务执行 + */ + private boolean isExecution(){ + return !status.get(); + } + /** + * 任务名称 + */ + private String taskName; + /** + * 任务执行次数 + */ + private Integer taskExecutionCount=0; + /** + * 任务开始时间 + */ + private Long taskStartTime; + /** + * 任务成功执行次数 + */ + private AtomicInteger taskSuccessSum=new AtomicInteger(); + /** + * 任务执行失败次数 + */ + private AtomicInteger taskErrorSum=new AtomicInteger(); + + /** + * 判断是否有任务 + * @return true 有任务 + */ + public boolean hashNext(){ + return !carQueue.isEmpty(); + } + + /** + * 获取下一个任务节点 + * @return 任务VIN + */ + public String next(){ + return carQueue.poll(); + } + +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/properties/MqttProperties.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/properties/MqttProperties.java new file mode 100644 index 0000000..f848275 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/properties/MqttProperties.java @@ -0,0 +1,45 @@ +package com.muyu.cargateway.domain.properties; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Lenovo + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-26-22:13 + * @ Version:1.0 + * @ Description:Mqtt的配置 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MqttProperties { + /** + * 节点 + */ + private String broker; + /** + * 主题 + */ + private String topic; + /** + * 用户名 + */ + private String userName; + /** + * 密码 + */ + private String password; + /** + * 客户端id + */ + private String clientId; + /** + * 上报级别 + */ + private int qos = 0; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/req/VehicleConnectionReq.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/req/VehicleConnectionReq.java new file mode 100644 index 0000000..3101fac --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/req/VehicleConnectionReq.java @@ -0,0 +1,38 @@ +package com.muyu.cargateway.domain.req; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-03-10:04 + * @ Version:1.0 + * @ Description:车辆获取连接地址 + * @author Lenovo + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class VehicleConnectionReq { + /** + * 车辆VIN + */ + private String vehicleVin; + /** + * 用户名 + */ + private String username; + /** + * 时间戳 + */ + private String timestamp; + /** + * 随机数 + */ + private String nonce; + +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/resp/AliServerConfig.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/resp/AliServerConfig.java new file mode 100644 index 0000000..ded0cc8 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/domain/resp/AliServerConfig.java @@ -0,0 +1,37 @@ +package com.muyu.cargateway.domain.resp; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-26-15:53 + * @ Version:1.0 + * @ Description:调用Ali服务器配置实体类 + * @author Lenovo + */ +@Data +@SuperBuilder +@AllArgsConstructor +@NoArgsConstructor +public class AliServerConfig { + /** + * 主键 + */ + private Long id; + /** + * 地域id (实例所属的地域ID) + */ + private String regionId; + /** + * 镜像id + */ + private String imageId; + /** + * 实例规格 (实例的资源规格) + */ + private String instanceType; +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/instance/DeleteSample.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/instance/DeleteSample.java new file mode 100644 index 0000000..d7cd031 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/instance/DeleteSample.java @@ -0,0 +1,34 @@ +package com.muyu.cargateway.instance; + +import com.muyu.cargateway.Aliyun.service.AliYunEcsService; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-07-21:51 + * @ Version:1.0 + * @ Description:删除实例方法 + * @author Lenovo + */ +@Log4j2 +@Component +public class DeleteSample implements DisposableBean { + @Autowired + private AliYunEcsService aliYunEcsService; + @Override + public void destroy() { + try { + log.info("===开始执行删除实例方法"); + Thread.sleep(10000); + aliYunEcsService.deleteInstance(); + } catch (Exception e) { + log.info("删除实例失败"); + throw new RuntimeException(e); + } + log.info("删除实例成功"); + } +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/instance/Sample.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/instance/Sample.java new file mode 100644 index 0000000..ecf2176 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/instance/Sample.java @@ -0,0 +1,71 @@ +package com.muyu.cargateway.instance; + +import com.muyu.cargateway.Aliyun.service.AliYunEcsService; +import com.muyu.cargateway.config.AliProperties; +import com.muyu.cargateway.domain.AliInstance; +import com.muyu.common.redis.service.RedisService; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author Lenovo + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-28-21:10 + * @ Version:1.0 + * @ Description:调用ali的类 + */ +@Log4j2 +@Component +public class Sample implements ApplicationRunner{ + + @Autowired + private AliYunEcsService aliYunEcsService; + @Autowired + private AliProperties aliProperties; + @Autowired + private RedisService redisService; + + @Override + public void run(ApplicationArguments args) throws Exception { + List list; + try { + log.info("开始创建实例"); + list = aliYunEcsService.generateInstance(aliProperties.getAmount()); + } catch (Exception e) { + log.info("创建实例失败"); + throw new RuntimeException(e); + } + log.info("创建实例成功"); + redisService.setCacheList("instanceIds", list); + try { + Thread.sleep(6000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + List aliInstances = aliYunEcsService.selectInstance(list); + log.info("查询实例信息成功:{}",aliInstances); + // 将查询到的实例信息列表存储到Redis中 + redisService.setCacheList("instanceList", aliInstances); + log.info("redis存储成功:{}", aliInstances); + } + +// @Override +// public void destroy(){ +// try { +// log.info("===开始执行删除实例方法"); +// aliYunEcsService.deleteInstance(); +// redisService.deleteObject("instanceIds"); +// redisService.deleteObject("instanceList"); +// } catch (Exception e) { +// log.info("删除实例失败"); +// throw new RuntimeException(e); +// } +// log.info("删除实例成功"); +// } +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/mapper/CarOneClickOperationMapper.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/mapper/CarOneClickOperationMapper.java new file mode 100644 index 0000000..3fc31fa --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/mapper/CarOneClickOperationMapper.java @@ -0,0 +1,21 @@ +package com.muyu.cargateway.mapper; + +import com.muyu.cargateway.domain.VehicleConnection; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-26-20:15 + * @ Version:1.0 + * @ Description:车辆一键操作持久层 + * @author Lenovo + */ +@Mapper +public interface CarOneClickOperationMapper { + void addConnect(VehicleConnection vehicleConnection); + + List selectByVehicleVin(String vehicleVin); +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/service/CarOneClickOperationService.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/service/CarOneClickOperationService.java new file mode 100644 index 0000000..71c639f --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/service/CarOneClickOperationService.java @@ -0,0 +1,22 @@ +package com.muyu.cargateway.service; + +import com.muyu.cargateway.domain.model.MqttServerModel; +import com.muyu.cargateway.domain.req.VehicleConnectionReq; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-26-20:15 + * @ Version:1.0 + * @ Description:车辆一键操作业务层 + * @author Lenovo + */ +public interface CarOneClickOperationService { + + /** + * 获取连接 + * @param vehicleConnectionReq 车辆连接请求参数 + * @return + */ + MqttServerModel getConnect(VehicleConnectionReq vehicleConnectionReq); +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/service/Impl/CarOneClickOperationServiceImpl.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/service/Impl/CarOneClickOperationServiceImpl.java new file mode 100644 index 0000000..5792030 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/service/Impl/CarOneClickOperationServiceImpl.java @@ -0,0 +1,78 @@ +package com.muyu.cargateway.service.Impl; + +import com.muyu.cargateway.domain.VehicleConnection; +import com.muyu.cargateway.domain.VinIp; +import com.muyu.cargateway.domain.model.MqttServerModel; +import com.muyu.cargateway.domain.req.VehicleConnectionReq; +import com.muyu.cargateway.mapper.CarOneClickOperationMapper; +import com.muyu.cargateway.service.CarOneClickOperationService; +import com.muyu.common.redis.service.RedisService; +import lombok.extern.log4j.Log4j2; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-09-26-20:16 + * @ Version:1.0 + * @ Description:车辆一键操作业务实现层 + * @author Lenovo + */ +@Log4j2 +@Service +public class CarOneClickOperationServiceImpl implements CarOneClickOperationService { + + @Autowired + private CarOneClickOperationMapper carOneClickOperationMapper; + + @Autowired + private RabbitTemplate rabbitTemplate; + @Autowired + private RedisService redisService; + + /** + * 获取连接信息 + * @param vehicleConnectionReq 车辆连接请求参数 + * @return + */ + @Override + public MqttServerModel getConnect(VehicleConnectionReq vehicleConnectionReq) { + log.info("车辆连接请求:{}",vehicleConnectionReq.toString()); + + // 使用交换机发送消息 + rabbitTemplate.convertAndSend("exchange_topics_inform","inform.#.email.#",vehicleConnectionReq.getVehicleVin()); + log.info("发送消息成功:{}",vehicleConnectionReq.getVehicleVin()); + + + VehicleConnection vehicleConnection = new VehicleConnection(); + //车辆vin + vehicleConnection.setVehicleVin(vehicleConnectionReq.getVehicleVin()); + //用户名 + vehicleConnection.setUsername(vehicleConnectionReq.getUsername()); + //密码(vin+时间戳+随机数) + vehicleConnection.setPassword(vehicleConnectionReq.getVehicleVin()+vehicleConnectionReq.getTimestamp()+vehicleConnectionReq.getNonce()); + //查询车辆vin集合 + List vehicleConnections =carOneClickOperationMapper.selectByVehicleVin(vehicleConnectionReq.getVehicleVin()); + if(vehicleConnections.isEmpty()){ + //添加 + carOneClickOperationMapper.addConnect(vehicleConnection); + } + log.info("该车辆已存在,不能重复预上线"); + //TODO 返回连接信息 做轮询操作 + + + return new MqttServerModel("tcp://"+"106.15.136.7"+":1883","vehicle"); + + } + /** + * 添加车辆绑定IP地址存入redis中 + */ + public void addIpAddress(VinIp vinIp){ + redisService.setCacheObject("vehicle_ip_address:"+vinIp.getVehicleVin(),vinIp.getIpAddress()); + } + +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/utils/ECSTool.java b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/utils/ECSTool.java new file mode 100644 index 0000000..e96fac4 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/java/com/muyu/cargateway/utils/ECSTool.java @@ -0,0 +1,135 @@ +package com.muyu.cargateway.utils; + +import com.aliyun.ecs20140526.Client; +import com.aliyun.ecs20140526.models.DeleteInstanceRequest; +import com.aliyun.ecs20140526.models.DescribeInstancesRequest; +import com.aliyun.ecs20140526.models.DescribeInstancesResponse; +import com.aliyun.ecs20140526.models.RunInstancesRequest; +import com.aliyun.tea.TeaException; +import com.aliyun.teaopenapi.models.Config; +import com.aliyun.teautil.Common; +import com.aliyun.teautil.models.RuntimeOptions; +import lombok.extern.log4j.Log4j2; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @ Tool:IntelliJ IDEA + * @ Author:CHX + * @ Date:2024-10-02-16:04 + * @ Version:1.0 + * @ Description:ecs实例工具类 + * @author Lenovo + */ +@Log4j2 +public class ECSTool { + + public static final String ACCESS_KEY_ID = "LTAI5tDH3FyRx4PRr6anx2TL"; + public static final String ACCESS_KEY_SECRET = "xdQnX2tDattY50raNkUWmHzE2tondP"; + + public static Client createClient() throws Exception { + // 工程代码泄露可能会导致 AccessKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考。 + Config config = new Config() + // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。 + .setAccessKeyId(ACCESS_KEY_ID) + // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。 + .setAccessKeySecret(ACCESS_KEY_SECRET); + // Endpoint 请参考 https://api.aliyun.com/product/Ecs + config.endpoint = "ecs-cn-hangzhou.aliyuncs.com"; + return new Client(config); + } + public static void runEcsInstance(String regionId, String launchTemplateId) throws Exception { + Client client = ECSTool.createClient(); + RunInstancesRequest request = new RunInstancesRequest(); + request.setRegionId(regionId) + .setLaunchTemplateId(launchTemplateId); + RuntimeOptions runtimeOptions = new RuntimeOptions(); + try{ + client.runInstancesWithOptions(request, runtimeOptions); + }catch (Exception error){ + // 处理API调用过程中出现的异常 + System.out.println(error.getMessage()); + if (error instanceof TeaException) { + // 处理特定类型的异常,如TeaException + TeaException teaError = (TeaException) error; + // 打印诊断推荐链接 + System.out.println(teaError.getData().get("Recommend")); + // 断言错误信息 + com.aliyun.teautil.Common.assertAsString(teaError.getMessage()); + } else { + // 处理其他类型的异常 + System.out.println(error.getMessage()); + } + } + } + + /** + *销毁实例 + */ + public static void runEcsRemove(String instanceId) throws Exception { + Client client = ECSTool.createClient(); + DeleteInstanceRequest deleteInstancesRequest = new DeleteInstanceRequest(); + deleteInstancesRequest.setInstanceId(instanceId); + RuntimeOptions runtimeOptions = new RuntimeOptions(); + + try { + // 复制代码运行请自行打印 API 的返回值 + client.deleteInstanceWithOptions(deleteInstancesRequest, runtimeOptions); + } catch (TeaException error) { + // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。 + // 错误 message + System.out.println(error.getMessage()); + // 诊断地址 + System.out.println(error.getData().get("Recommend")); + com.aliyun.teautil.Common.assertAsString(error.message); + } catch (Exception _error) { + TeaException error = new TeaException(_error.getMessage(), _error); + // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。 + // 错误 message + System.out.println(error.getMessage()); + // 诊断地址 + System.out.println(error.getData().get("Recommend")); + com.aliyun.teautil.Common.assertAsString(error.message); + } + } + + /** + * 查询实例列表 + * @param regionId 地域ID + */ + public static List findInstance(String regionId) throws Exception { + Client client = ECSTool.createClient(); + DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest(); + describeInstancesRequest.setRegionId(regionId); + RuntimeOptions runtimeOptions = new RuntimeOptions(); + List stringArrayList = new ArrayList<>(); + try { + DescribeInstancesResponse response = client.describeInstancesWithOptions(describeInstancesRequest, runtimeOptions); + List> ipListList = response.getBody().instances.getInstance().stream().map(instance -> instance.publicIpAddress.ipAddress).collect(Collectors.toList()); + for (List strings : ipListList) { + for (String ip : strings) { + stringArrayList.add(ip); + } + return stringArrayList; + } + } catch (TeaException error) { + // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。 + // 错误 message + System.out.println(error.getMessage()); + // 诊断地址 + System.out.println(error.getData().get("Recommend")); + Common.assertAsString(error.message); + } catch (Exception _error) { + TeaException error = new TeaException(_error.getMessage(), _error); + // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。 + // 错误 message + System.out.println(error.getMessage()); + // 诊断地址 + System.out.println(error.getData().get("Recommend")); + Common.assertAsString(error.message); + } + return null; + } +} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/resources/banner.txt b/cloud-modules/cloud-modules-car-gateway/src/main/resources/banner.txt new file mode 100644 index 0000000..0dd5eee --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-car-gateway/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..e33efb2 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/resources/bootstrap.yml @@ -0,0 +1,85 @@ +# Tomcat +server: + port: 12900 + +# nacos线上地址 +nacos: + addr: 47.116.173.119:8848 + user-name: nacos + password: nacos + namespace: one +# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all +# Spring +spring: + rabbitmq: + host: 47.116.173.119 + port: 5672 + username: guest + password: guest + virtual-host: / + listener: + simple: + prefetch: 1 # 默认每次取出一条消息消费, 消费完成取下一条 + acknowledge-mode: manual # 设置消费端手动ack确认 + retry: + enabled: true # 是否支持重试 + publisher-confirm-type: correlated #确认消息已发送到交换机(Exchange) + publisher-returns: true #确认消息已发送到队列(Queue) + amqp: + deserialization: + trust: + all: true + main: + allow-bean-definition-overriding: true + + application: + # 应用名称 + name: cloud-car-gateway + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + config: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + # 系统共享配置 + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # 系统环境Config共享配置 + - application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # xxl-job 配置文件 + - application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # rabbit 配置文件 + - application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.muyu.breakdown.mapper: DEBUG +aliyun: + access-key-id: LTAI5tDH3FyRx4PRr6anx2TL + access-key-secret: xdQnX2tDattY50raNkUWmHzE2tondP + endpoint: ecs-cn-hangzhou.aliyuncs.com + region-id: cn-shanghai + image-id: m-uf6ih0vnl5f51pquns11 + instance-type: ecs.t6-c1m1.large + security-group-id: sg-uf642d5u4ja5gsiitx8y + switch-id: vsw-uf66lifrkhxqc94xi06v3 + amount: 1 diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/dev.xml b/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/dev.xml new file mode 100644 index 0000000..34cd186 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/dev.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/prod.xml b/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/prod.xml new file mode 100644 index 0000000..1193d09 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/prod.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + + diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/test.xml b/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/test.xml new file mode 100644 index 0000000..1193d09 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/resources/logback/test.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + + diff --git a/cloud-modules/cloud-modules-car-gateway/src/main/resources/mapper/CarOneClickOperationMapper.xml b/cloud-modules/cloud-modules-car-gateway/src/main/resources/mapper/CarOneClickOperationMapper.xml new file mode 100644 index 0000000..814cfa2 --- /dev/null +++ b/cloud-modules/cloud-modules-car-gateway/src/main/resources/mapper/CarOneClickOperationMapper.xml @@ -0,0 +1,19 @@ + + + + + + + insert into car_one_click_operation + (vehicle_vin,user_name,password) + values + (#{vehicleVin},#{username},#{password}) + + + + + diff --git a/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..c5229d5 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml @@ -0,0 +1,58 @@ +# Tomcat +server: + port: 10011 + +# nacos线上地址 +nacos: + addr: 47.116.173.119:8848 + user-name: nacos + password: nacos + namespace: public +# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all +# Spring +spring: + amqp: + deserialization: + trust: + all: true + main: + allow-bean-definition-overriding: true + application: + # 应用名称 + name: cloud-car + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + config: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + # 系统共享配置 + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # 系统环境Config共享配置 + - application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +logging: + level: + com.muyu.carrail.mapper: DEBUG + diff --git a/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/CloudFileApplication.java b/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/CloudFileApplication.java index 1e21c73..8d26d5c 100644 --- a/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/CloudFileApplication.java +++ b/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/CloudFileApplication.java @@ -13,7 +13,10 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; public class CloudFileApplication { public static void main (String[] args) { SpringApplication.run(CloudFileApplication.class, args); + System.out.println("CloudFile 模块启动成功!"); + + } } diff --git a/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/controller/SysFileController.java b/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/controller/SysFileController.java index fa9ff45..a9546e7 100644 --- a/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/controller/SysFileController.java +++ b/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/controller/SysFileController.java @@ -6,7 +6,11 @@ import com.muyu.file.service.ISysFileService; import com.muyu.common.system.domain.SysFile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; @@ -21,7 +25,11 @@ import org.springframework.web.multipart.MultipartFile; public class SysFileController { private static final Logger log = LoggerFactory.getLogger(SysFileController.class); + @Resource + + @Autowired + private ISysFileService sysFileService; /** diff --git a/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/service/MinioSysFileServiceImpl.java b/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/service/MinioSysFileServiceImpl.java index 29dfe17..2fd4795 100644 --- a/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/service/MinioSysFileServiceImpl.java +++ b/cloud-modules/cloud-modules-file/src/main/java/com/muyu/file/service/MinioSysFileServiceImpl.java @@ -5,10 +5,11 @@ import com.muyu.file.config.MinioConfig; import com.muyu.file.utils.FileUploadUtils; import io.minio.MinioClient; import io.minio.PutObjectArgs; -import javax.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import java.io.InputStream; /** @@ -18,10 +19,13 @@ import java.io.InputStream; */ @Service public class MinioSysFileServiceImpl implements ISysFileService { + @Resource private MinioConfig minioConfig; - @Resource + + @Autowired + private MinioClient client; /** diff --git a/cloud-modules/cloud-modules-warn/cloud-warn-server/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-warn/cloud-warn-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..a12bfd9 --- /dev/null +++ b/cloud-modules/cloud-modules-warn/cloud-warn-server/src/main/resources/bootstrap.yml @@ -0,0 +1,48 @@ +# Tomcat +server: + port: 10003 + +# nacos线上地址 +nacos: + addr: 47.116.173.119:8848 + user-name: nacos + password: nacos + namespace: one + +# Spring +spring: + main: + allow-bean-definition-overriding: true + application: + # 应用名称 + name: cloud-warn + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: ${nacos.addr} + # 命名空间 + namespace: ${nacos.namespace} + config: + # 服务注册地址 + server-addr: ${nacos.addr} + # 命名空间 + namespace: ${nacos.namespace} + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + # 系统共享配置 + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # 系统环境Config共享配置 + - application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # xxl-job 配置文件 + - application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # engine配置 + - engine-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.muyu.system.mapper: DEBUG diff --git a/cloud-modules/pom.xml b/cloud-modules/pom.xml index 82e9797..53595e2 100644 --- a/cloud-modules/pom.xml +++ b/cloud-modules/pom.xml @@ -15,6 +15,8 @@ cloud-modules-openbusiness cloud-modules-data-processing cloud-modules-parsing + cloud-modules-carmanage + cloud-modules-car-gateway cloud-modules diff --git a/init-file/cloud-system.sql b/init-file/cloud-system.sql new file mode 100644 index 0000000..6966381 --- /dev/null +++ b/init-file/cloud-system.sql @@ -0,0 +1,687 @@ +/* + Navicat Premium Data Transfer + + Source Server : MySQL80-local + Source Server Type : MySQL + Source Server Version : 80401 (8.4.1) + Source Host : 10.100.1.2:3306 + Source Schema : cloud-system + + Target Server Type : MySQL + Target Server Version : 80401 (8.4.1) + File Encoding : 65001 + + Date: 17/07/2024 09:01:52 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for gen_table +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table`; +CREATE TABLE `gen_table` ( + `table_id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', + `table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '表名称', + `table_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '表描述', + `sub_table_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '关联子表的表名', + `sub_table_fk_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '子表关联的外键名', + `class_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '实体类名称', + `tpl_category` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'crud' COMMENT '使用的模板(crud单表操作 tree树表操作)', + `package_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生成包路径', + `module_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生成模块名', + `business_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生成业务名', + `function_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生成功能名', + `function_author` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生成功能作者', + `gen_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '生成代码方式(0zip压缩包 1自定义路径)', + `gen_path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '/' COMMENT '生成路径(不填默认项目路径)', + `options` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '其它生成选项', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`table_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='代码生成业务表'; + +-- ---------------------------- +-- Records of gen_table +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for gen_table_column +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table_column`; +CREATE TABLE `gen_table_column` ( + `column_id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', + `table_id` bigint DEFAULT NULL COMMENT '归属表编号', + `column_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '列名称', + `column_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '列描述', + `column_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '列类型', + `java_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'JAVA类型', + `java_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'JAVA字段名', + `is_pk` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否主键(1是)', + `is_increment` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否自增(1是)', + `is_required` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否必填(1是)', + `is_insert` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否为插入字段(1是)', + `is_edit` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否编辑字段(1是)', + `is_list` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否列表字段(1是)', + `is_query` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否查询字段(1是)', + `query_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'EQ' COMMENT '查询方式(等于、不等于、大于、小于、范围)', + `html_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)', + `dict_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '字典类型', + `sort` int DEFAULT NULL COMMENT '排序', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`column_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='代码生成业务表字段'; + +-- ---------------------------- +-- Records of gen_table_column +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for sys_config +-- ---------------------------- +DROP TABLE IF EXISTS `sys_config`; +CREATE TABLE `sys_config` ( + `config_id` int NOT NULL AUTO_INCREMENT COMMENT '参数主键', + `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '参数名称', + `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '参数键名', + `config_value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '参数键值', + `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'N' COMMENT '系统内置(Y是 N否)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`config_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='参数配置表'; + +-- ---------------------------- +-- Records of sys_config +-- ---------------------------- +BEGIN; +INSERT INTO `sys_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', '2024-05-23 15:08:18', '', NULL, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); +INSERT INTO `sys_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', '2024-05-23 15:08:18', '', NULL, '初始化密码 123456'); +INSERT INTO `sys_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', '2024-05-23 15:08:18', '', NULL, '深色主题theme-dark,浅色主题theme-light'); +INSERT INTO `sys_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', '2024-05-23 15:08:18', '', NULL, '是否开启注册用户功能(true开启,false关闭)'); +INSERT INTO `sys_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (5, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', '2024-05-23 15:08:18', '', NULL, '设置登录IP黑名单限制,多个匹配项以;分隔,支持匹配(*通配、网段)'); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dept`; +CREATE TABLE `sys_dept` ( + `dept_id` bigint NOT NULL AUTO_INCREMENT COMMENT '部门id', + `parent_id` bigint DEFAULT '0' COMMENT '父部门id', + `ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '祖级列表', + `dept_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '部门名称', + `order_num` int DEFAULT '0' COMMENT '显示顺序', + `leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '负责人', + `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系电话', + `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '邮箱', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '部门状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`dept_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=200 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='部门表'; + +-- ---------------------------- +-- Records of sys_dept +-- ---------------------------- +BEGIN; +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_dict_data +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_data`; +CREATE TABLE `sys_dict_data` ( + `dict_code` bigint NOT NULL AUTO_INCREMENT COMMENT '字典编码', + `dict_sort` int DEFAULT '0' COMMENT '字典排序', + `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '字典标签', + `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '字典键值', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '字典类型', + `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '样式属性(其他样式扩展)', + `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '表格回显样式', + `is_default` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'N' COMMENT '是否默认(Y是 N否)', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_code`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='字典数据表'; + +-- ---------------------------- +-- Records of sys_dict_data +-- ---------------------------- +BEGIN; +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '性别男'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '性别女'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '性别未知'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '显示菜单'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '隐藏菜单'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '默认分组'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '系统分组'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '系统默认是'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '系统默认否'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '通知'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '公告'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '关闭状态'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '其他操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '新增操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '修改操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '删除操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '授权操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '导出操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '导入操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '强退操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '生成操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '清空操作'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '停用状态'); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_dict_type +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_type`; +CREATE TABLE `sys_dict_type` ( + `dict_id` bigint NOT NULL AUTO_INCREMENT COMMENT '字典主键', + `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '字典名称', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '字典类型', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_id`) USING BTREE, + UNIQUE KEY `dict_type` (`dict_type`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='字典类型表'; + +-- ---------------------------- +-- Records of sys_dict_type +-- ---------------------------- +BEGIN; +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, '用户性别', 'sys_user_sex', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '用户性别列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, '菜单状态', 'sys_show_hide', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '菜单状态列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3, '系统开关', 'sys_normal_disable', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '系统开关列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (4, '任务状态', 'sys_job_status', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '任务状态列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (5, '任务分组', 'sys_job_group', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '任务分组列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (6, '系统是否', 'sys_yes_no', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '系统是否列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (7, '通知类型', 'sys_notice_type', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '通知类型列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (8, '通知状态', 'sys_notice_status', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '通知状态列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (9, '操作类型', 'sys_oper_type', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '操作类型列表'); +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (10, '系统状态', 'sys_common_status', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '登录状态列表'); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_logininfor +-- ---------------------------- +DROP TABLE IF EXISTS `sys_logininfor`; +CREATE TABLE `sys_logininfor` ( + `info_id` bigint NOT NULL AUTO_INCREMENT COMMENT '访问ID', + `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '用户账号', + `ipaddr` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '登录IP地址', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '登录状态(0成功 1失败)', + `msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '提示信息', + `access_time` datetime DEFAULT NULL COMMENT '访问时间', + PRIMARY KEY (`info_id`) USING BTREE, + KEY `idx_sys_logininfor_s` (`status`) USING BTREE, + KEY `idx_sys_logininfor_lt` (`access_time`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='系统访问记录'; + +-- ---------------------------- +-- Records of sys_logininfor +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for sys_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_menu`; +CREATE TABLE `sys_menu` ( + `menu_id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单ID', + `menu_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单名称', + `parent_id` bigint DEFAULT '0' COMMENT '父菜单ID', + `order_num` int DEFAULT '0' COMMENT '显示顺序', + `path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '路由地址', + `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '组件路径', + `query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '路由参数', + `is_frame` int DEFAULT '1' COMMENT '是否为外链(0是 1否)', + `is_cache` int DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', + `menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', + `visible` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', + `perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '权限标识', + `icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '#' COMMENT '菜单图标', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`menu_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=2000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='菜单权限表'; + +-- ---------------------------- +-- Records of sys_menu +-- ---------------------------- +BEGIN; +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, '系统管理', 0, 1, 'system', NULL, '', 1, 0, 'M', '0', '0', '', 'system', 'admin', '2024-05-23 15:08:18', '', NULL, '系统管理目录'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, '系统监控', 0, 2, 'monitor', NULL, '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', '2024-05-23 15:08:18', '', NULL, '系统监控目录'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3, '系统工具', 0, 3, 'tool', NULL, '', 1, 0, 'M', '0', '0', '', 'tool', 'admin', '2024-05-23 15:08:18', '', NULL, '系统工具目录'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (4, '若依官网', 0, 4, 'http://muyu.vip', NULL, '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', '2024-05-23 15:08:18', '', NULL, '若依官网地址'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', '2024-05-23 15:08:18', '', NULL, '用户管理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', '2024-05-23 15:08:18', '', NULL, '角色管理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', '2024-05-23 15:08:18', '', NULL, '菜单管理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2024-05-23 15:08:18', '', NULL, '部门管理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', '2024-05-23 15:08:18', '', NULL, '岗位管理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', '2024-05-23 15:08:18', '', NULL, '字典管理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (106, '参数设置', 1, 7, 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', '2024-05-23 15:08:18', '', NULL, '参数设置菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (107, '通知公告', 1, 8, 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', '2024-05-23 15:08:18', '', NULL, '通知公告菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (108, '日志管理', 1, 9, 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', '2024-05-23 15:08:18', '', NULL, '日志管理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (109, '在线用户', 2, 1, 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', '2024-05-23 15:08:18', '', NULL, '在线用户菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (110, '定时任务', 2, 2, 'http://admin.xxl.muyu.icu/toLogin', 'monitor/job/index', '', 0, 0, 'M', '0', '0', 'monitor:job:list', 'job', 'admin', '2024-05-23 15:08:18', 'admin', '2024-07-15 12:50:44', '定时任务菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (111, 'Sentinel控制台', 2, 3, 'http://localhost:8718', '', '', 0, 0, 'C', '0', '0', 'monitor:sentinel:list', 'sentinel', 'admin', '2024-05-23 15:08:18', '', NULL, '流量控制菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (112, 'Nacos控制台', 2, 4, 'http://localhost:8848/nacos', '', '', 0, 0, 'C', '0', '0', 'monitor:nacos:list', 'nacos', 'admin', '2024-05-23 15:08:18', '', NULL, '服务治理菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (113, 'Admin控制台', 2, 5, 'http://localhost:9100/login', '', '', 0, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', '2024-05-23 15:08:18', '', NULL, '服务监控菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (114, '表单构建', 3, 1, 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', '2024-05-23 15:08:18', '', NULL, '表单构建菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (115, '代码生成', 3, 2, 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', '2024-05-23 15:08:18', '', NULL, '代码生成菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (116, '系统接口', 3, 3, 'http://localhost:8080/doc.html', '', '', 0, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', '2024-05-23 15:08:18', '', NULL, '系统接口菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (500, '操作日志', 108, 1, 'operlog', 'system/operlog/index', '', 1, 0, 'C', '0', '0', 'system:operlog:list', 'form', 'admin', '2024-05-23 15:08:18', '', NULL, '操作日志菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (501, '登录日志', 108, 2, 'logininfor', 'system/logininfor/index', '', 1, 0, 'C', '0', '0', 'system:logininfor:list', 'logininfor', 'admin', '2024-05-23 15:08:18', '', NULL, '登录日志菜单'); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1000, '用户查询', 100, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1001, '用户新增', 100, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1002, '用户修改', 100, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1003, '用户删除', 100, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1004, '用户导出', 100, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1005, '用户导入', 100, 6, '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1006, '重置密码', 100, 7, '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1007, '角色查询', 101, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1008, '角色新增', 101, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1009, '角色修改', 101, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1010, '角色删除', 101, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1011, '角色导出', 101, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1012, '菜单查询', 102, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1013, '菜单新增', 102, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1014, '菜单修改', 102, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1015, '菜单删除', 102, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1016, '部门查询', 103, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1017, '部门新增', 103, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1018, '部门修改', 103, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1019, '部门删除', 103, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1020, '岗位查询', 104, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1021, '岗位新增', 104, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1022, '岗位修改', 104, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1023, '岗位删除', 104, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1024, '岗位导出', 104, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1025, '字典查询', 105, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1026, '字典新增', 105, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1027, '字典修改', 105, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1028, '字典删除', 105, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1029, '字典导出', 105, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1030, '参数查询', 106, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1031, '参数新增', 106, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1032, '参数修改', 106, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1033, '参数删除', 106, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1034, '参数导出', 106, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1035, '公告查询', 107, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1036, '公告新增', 107, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1037, '公告修改', 107, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1038, '公告删除', 107, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1039, '操作查询', 500, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1040, '操作删除', 500, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1041, '日志导出', 500, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:export', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1042, '登录查询', 501, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1043, '登录删除', 501, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1044, '日志导出', 501, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:export', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1045, '账户解锁', 501, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:unlock', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1046, '在线查询', 109, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1047, '批量强退', 109, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1048, '单条强退', 109, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1055, '生成查询', 115, 1, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1056, '生成修改', 115, 2, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1057, '生成删除', 115, 3, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1058, '导入代码', 115, 2, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1059, '预览代码', 115, 4, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1060, '生成代码', 115, 5, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_notice +-- ---------------------------- +DROP TABLE IF EXISTS `sys_notice`; +CREATE TABLE `sys_notice` ( + `notice_id` int NOT NULL AUTO_INCREMENT COMMENT '公告ID', + `notice_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公告标题', + `notice_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公告类型(1通知 2公告)', + `notice_content` longblob COMMENT '公告内容', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`notice_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='通知公告表'; + +-- ---------------------------- +-- Records of sys_notice +-- ---------------------------- +BEGIN; +INSERT INTO `sys_notice` (`notice_id`, `notice_title`, `notice_type`, `notice_content`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, '温馨提醒:2018-07-01 若依新版本发布啦', '2', 0xE696B0E78988E69CACE58685E5AEB9, '0', 'admin', '2024-05-23 15:08:18', '', NULL, '管理员'); +INSERT INTO `sys_notice` (`notice_id`, `notice_title`, `notice_type`, `notice_content`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, '维护通知:2018-07-01 若依系统凌晨维护', '1', 0xE7BBB4E68AA4E58685E5AEB9, '0', 'admin', '2024-05-23 15:08:18', '', NULL, '管理员'); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_oper_log +-- ---------------------------- +DROP TABLE IF EXISTS `sys_oper_log`; +CREATE TABLE `sys_oper_log` ( + `oper_id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志主键', + `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '模块标题', + `business_type` int DEFAULT '0' COMMENT '业务类型(0其它 1新增 2修改 3删除)', + `method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '方法名称', + `request_method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '请求方式', + `operator_type` int DEFAULT '0' COMMENT '操作类别(0其它 1后台用户 2手机端用户)', + `oper_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '操作人员', + `dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '部门名称', + `oper_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '请求URL', + `oper_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '主机地址', + `oper_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '操作地点', + `oper_param` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '请求参数', + `json_result` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '返回参数', + `status` int DEFAULT '0' COMMENT '操作状态(0正常 1异常)', + `error_msg` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '错误消息', + `oper_time` datetime DEFAULT NULL COMMENT '操作时间', + `cost_time` bigint DEFAULT '0' COMMENT '消耗时间', + PRIMARY KEY (`oper_id`) USING BTREE, + KEY `idx_sys_oper_log_bt` (`business_type`) USING BTREE, + KEY `idx_sys_oper_log_s` (`status`) USING BTREE, + KEY `idx_sys_oper_log_ot` (`oper_time`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='操作日志记录'; + +-- ---------------------------- +-- Records of sys_oper_log +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for sys_post +-- ---------------------------- +DROP TABLE IF EXISTS `sys_post`; +CREATE TABLE `sys_post` ( + `post_id` bigint NOT NULL AUTO_INCREMENT COMMENT '岗位ID', + `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '岗位编码', + `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '岗位名称', + `post_sort` int NOT NULL COMMENT '显示顺序', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`post_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='岗位信息表'; + +-- ---------------------------- +-- Records of sys_post +-- ---------------------------- +BEGIN; +INSERT INTO `sys_post` (`post_id`, `post_code`, `post_name`, `post_sort`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, 'ceo', '董事长', 1, '0', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_post` (`post_id`, `post_code`, `post_name`, `post_sort`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, 'se', '项目经理', 2, '0', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_post` (`post_id`, `post_code`, `post_name`, `post_sort`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3, 'hr', '人力资源', 3, '0', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +INSERT INTO `sys_post` (`post_id`, `post_code`, `post_name`, `post_sort`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (4, 'user', '普通员工', 4, '0', 'admin', '2024-05-23 15:08:18', '', NULL, ''); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role`; +CREATE TABLE `sys_role` ( + `role_id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID', + `role_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色名称', + `role_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色权限字符串', + `role_sort` int NOT NULL COMMENT '显示顺序', + `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '1' COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', + `menu_check_strictly` tinyint(1) DEFAULT '1' COMMENT '菜单树选择项是否关联显示', + `dept_check_strictly` tinyint(1) DEFAULT '1' COMMENT '部门树选择项是否关联显示', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`role_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='角色信息表'; + +-- ---------------------------- +-- Records of sys_role +-- ---------------------------- +BEGIN; +INSERT INTO `sys_role` (`role_id`, `role_name`, `role_key`, `role_sort`, `data_scope`, `menu_check_strictly`, `dept_check_strictly`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, '超级管理员', 'admin', 1, '1', 1, 1, '0', '0', 'admin', '2024-05-23 15:08:18', '', NULL, '超级管理员'); +INSERT INTO `sys_role` (`role_id`, `role_name`, `role_key`, `role_sort`, `data_scope`, `menu_check_strictly`, `dept_check_strictly`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, '普通角色', 'common', 2, '2', 1, 1, '0', '0', 'admin', '2024-05-23 15:08:18', 'admin', '2024-07-15 12:42:34', '普通角色'); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_role_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_dept`; +CREATE TABLE `sys_role_dept` ( + `role_id` bigint NOT NULL COMMENT '角色ID', + `dept_id` bigint NOT NULL COMMENT '部门ID', + PRIMARY KEY (`role_id`,`dept_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='角色和部门关联表'; + +-- ---------------------------- +-- Records of sys_role_dept +-- ---------------------------- +BEGIN; +INSERT INTO `sys_role_dept` (`role_id`, `dept_id`) VALUES (2, 100); +INSERT INTO `sys_role_dept` (`role_id`, `dept_id`) VALUES (2, 101); +INSERT INTO `sys_role_dept` (`role_id`, `dept_id`) VALUES (2, 105); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_role_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_menu`; +CREATE TABLE `sys_role_menu` ( + `role_id` bigint NOT NULL COMMENT '角色ID', + `menu_id` bigint NOT NULL COMMENT '菜单ID', + PRIMARY KEY (`role_id`,`menu_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='角色和菜单关联表'; + +-- ---------------------------- +-- Records of sys_role_menu +-- ---------------------------- +BEGIN; +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 3); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 4); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 100); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 101); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 102); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 103); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 104); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 105); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 106); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 107); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 108); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 109); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 111); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 112); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 113); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 114); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 115); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 116); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 500); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 501); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1000); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1001); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1002); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1003); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1004); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1005); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1006); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1007); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1008); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1009); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1010); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1011); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1012); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1013); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1014); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1015); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1016); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1017); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1018); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1019); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1020); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1021); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1022); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1023); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1024); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1025); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1026); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1027); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1028); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1029); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1030); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1031); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1032); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1033); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1034); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1035); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1036); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1037); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1038); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1039); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1040); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1041); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1042); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1043); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1044); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1045); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1046); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1047); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1048); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1055); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1056); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1057); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1058); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1059); +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 1060); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_user +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user`; +CREATE TABLE `sys_user` ( + `user_id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `dept_id` bigint DEFAULT NULL COMMENT '部门ID', + `user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户账号', + `nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户昵称', + `user_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '00' COMMENT '用户类型(00系统用户)', + `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '用户邮箱', + `phonenumber` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '手机号码', + `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '用户性别(0男 1女 2未知)', + `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '头像地址', + `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '密码', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '帐号状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '最后登录IP', + `login_date` datetime DEFAULT NULL COMMENT '最后登录时间', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`user_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户信息表'; + +-- ---------------------------- +-- Records of sys_user +-- ---------------------------- +BEGIN; + +INSERT INTO `sys_user` (`user_id`, `dept_id`, `user_name`, `nick_name`, `user_type`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `status`, `del_flag`, `login_ip`, `login_date`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '106.54.193.225', '2024-05-23 15:08:18', 'admin', '2024-05-23 15:08:18', '', NULL, '管理员'); +INSERT INTO `sys_user` (`user_id`, `dept_id`, `user_name`, `nick_name`, `user_type`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `status`, `del_flag`, `login_ip`, `login_date`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '106.54.193.225', '2024-05-23 15:08:18', 'admin', '2024-05-23 15:08:18', '', NULL, '测试员'); + +INSERT INTO `sys_user` (`user_id`, `dept_id`, `user_name`, `nick_name`, `user_type`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `status`, `del_flag`, `login_ip`, `login_date`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2024-05-23 15:08:18', 'admin', '2024-05-23 15:08:18', '', NULL, '管理员'); +INSERT INTO `sys_user` (`user_id`, `dept_id`, `user_name`, `nick_name`, `user_type`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `status`, `del_flag`, `login_ip`, `login_date`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2024-05-23 15:08:18', 'admin', '2024-05-23 15:08:18', '', NULL, '测试员'); + +COMMIT; + +-- ---------------------------- +-- Table structure for sys_user_post +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_post`; +CREATE TABLE `sys_user_post` ( + `user_id` bigint NOT NULL COMMENT '用户ID', + `post_id` bigint NOT NULL COMMENT '岗位ID', + PRIMARY KEY (`user_id`,`post_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户与岗位关联表'; + +-- ---------------------------- +-- Records of sys_user_post +-- ---------------------------- +BEGIN; +INSERT INTO `sys_user_post` (`user_id`, `post_id`) VALUES (1, 1); +INSERT INTO `sys_user_post` (`user_id`, `post_id`) VALUES (2, 2); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_user_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_role`; +CREATE TABLE `sys_user_role` ( + `user_id` bigint NOT NULL COMMENT '用户ID', + `role_id` bigint NOT NULL COMMENT '角色ID', + PRIMARY KEY (`user_id`,`role_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户和角色关联表'; + +-- ---------------------------- +-- Records of sys_user_role +-- ---------------------------- +BEGIN; +INSERT INTO `sys_user_role` (`user_id`, `role_id`) VALUES (1, 1); +INSERT INTO `sys_user_role` (`user_id`, `role_id`) VALUES (2, 2); +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/skywalking/agent/LICENSE b/skywalking/agent/LICENSE index a5c6f78..66d312d 100644 --- a/skywalking/agent/LICENSE +++ b/skywalking/agent/LICENSE @@ -200,7 +200,7 @@ See the License for the specific language governing permissions and limitations under the License. -======================================================================= += Apache SkyWalking Subcomponents: The Apache SkyWalking project contains subcomponents with separate copyright @@ -208,9 +208,9 @@ notices and license terms. Your use of the source code for the these subcomponents is subject to the terms and conditions of the following licenses. -======================================================================== +== Apache 2.0 licenses -======================================================================== +== The following components are provided under the Apache License. See project link for details. The text of each license is the standard Apache 2.0 license. @@ -223,9 +223,9 @@ The text of each license is the standard Apache 2.0 license. Google: guava 32.0.1: https://github.com/google/guava , Apache 2.0 netty 4.1.100: https://github.com/netty/netty/blob/4.1/LICENSE.txt, Apache 2.0 -======================================================================== +== BSD licenses -======================================================================== +== The following components are provided under a BSD license. See project link for details. The text of each license is also included at licenses/LICENSE-[project].txt. diff --git a/skywalking/agent/NOTICE b/skywalking/agent/NOTICE index f95d82a..a9714f6 100644 --- a/skywalking/agent/NOTICE +++ b/skywalking/agent/NOTICE @@ -4,11 +4,11 @@ Copyright 2017-2024 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). -======================================================================== +== grpc-java NOTICE -======================================================================== +== Copyright 2014, gRPC Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); @@ -46,11 +46,11 @@ networking library, which can be obtained at: * LOCATION_IN_GRPC: * netty/third_party/netty -======================================================================== +== grpc NOTICE -======================================================================== +== Copyright 2014 gRPC authors. @@ -67,15 +67,15 @@ See the License for the specific language governing permissions and limitations under the License. -======================================================================== +== netty NOTICE -======================================================================== +== The Netty Project - ================= + === Please visit the Netty web site for more information: