正在显示
100 个修改的文件
包含
463 行增加
和
479 行删除
| @@ -12,29 +12,9 @@ | @@ -12,29 +12,9 @@ | ||
| 12 | <artifactId>lh-central-control</artifactId> | 12 | <artifactId>lh-central-control</artifactId> |
| 13 | 13 | ||
| 14 | <dependencies> | 14 | <dependencies> |
| 15 | - <!-- spring-boot-devtools --> | ||
| 16 | - <dependency> | ||
| 17 | - <groupId>org.springframework.boot</groupId> | ||
| 18 | - <artifactId>spring-boot-devtools</artifactId> | ||
| 19 | - <optional>true</optional> <!-- 表示依赖不会传递 --> | ||
| 20 | - </dependency> | ||
| 21 | - <!-- Spring框架基本的核心工具 --> | ||
| 22 | - <dependency> | ||
| 23 | - <groupId>org.springframework</groupId> | ||
| 24 | - <artifactId>spring-context-support</artifactId> | ||
| 25 | - </dependency> | ||
| 26 | - <!-- 系统模块--> | ||
| 27 | - <dependency> | ||
| 28 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 29 | - <artifactId>ruoyi-common</artifactId> | ||
| 30 | - </dependency> | ||
| 31 | - <dependency> | ||
| 32 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 33 | - <artifactId>ruoyi-common-redis</artifactId> | ||
| 34 | - </dependency> | ||
| 35 | <dependency> | 15 | <dependency> |
| 36 | <groupId>com.zhonglai.luhui</groupId> | 16 | <groupId>com.zhonglai.luhui</groupId> |
| 37 | - <artifactId>lh-domain</artifactId> | 17 | + <artifactId>lh-jar-device-service</artifactId> |
| 38 | </dependency> | 18 | </dependency> |
| 39 | </dependencies> | 19 | </dependencies> |
| 40 | 20 |
| @@ -5,7 +5,7 @@ import com.ruoyi.common.core.domain.Message; | @@ -5,7 +5,7 @@ import com.ruoyi.common.core.domain.Message; | ||
| 5 | import com.ruoyi.common.core.domain.MessageCode; | 5 | import com.ruoyi.common.core.domain.MessageCode; |
| 6 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 7 | import com.ruoyi.common.utils.html.HttpUtils; | 7 | import com.ruoyi.common.utils.html.HttpUtils; |
| 8 | -import com.ruoyi.system.domain.iot.IotDevice; | 8 | +import com.zhonglai.luhui.device.domain.IotDevice; |
| 9 | import com.zhonglai.luhui.redis.service.RedisCache; | 9 | import com.zhonglai.luhui.redis.service.RedisCache; |
| 10 | import okhttp3.Response; | 10 | import okhttp3.Response; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 1 | package com.ruoyi.system.domain.entity; | 1 | package com.ruoyi.system.domain.entity; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Excel; | 3 | import com.ruoyi.common.annotation.Excel; |
| 4 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | import com.ruoyi.common.tool.BaseEntity; | 5 | import com.ruoyi.common.tool.BaseEntity; |
| 5 | import org.apache.commons.lang3.builder.ToStringBuilder; | 6 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 6 | import org.apache.commons.lang3.builder.ToStringStyle; | 7 | import org.apache.commons.lang3.builder.ToStringStyle; |
| @@ -15,6 +16,7 @@ import javax.validation.constraints.Size; | @@ -15,6 +16,7 @@ import javax.validation.constraints.Size; | ||
| 15 | */ | 16 | */ |
| 16 | public class SysDictData extends BaseEntity | 17 | public class SysDictData extends BaseEntity |
| 17 | { | 18 | { |
| 19 | + @PublicSQLConfig(isSelect=false) | ||
| 18 | private static final long serialVersionUID = 1L; | 20 | private static final long serialVersionUID = 1L; |
| 19 | 21 | ||
| 20 | /** 字典编码 */ | 22 | /** 字典编码 */ |
| 1 | -package com.ruoyi.system.domain.entity; import javax.validation.constraints.NotBlank;import javax.validation.constraints.Size; import com.ruoyi.common.annotation.Excel;import org.apache.commons.lang3.builder.ToStringBuilder;import org.apache.commons.lang3.builder.ToStringStyle;import com.ruoyi.common.tool.BaseEntity; /** * 字典类型表 sys_dict_type * * @author ruoyi */public class SysDictType extends BaseEntity{ private static final long serialVersionUID = 1L; /** 字典主键 */ @Excel(name = "字典主键", cellType = Excel.ColumnType.NUMERIC) private Long dictId; /** 字典名称 */ @Excel(name = "字典名称") private String dictName; /** 字典类型 */ @Excel(name = "字典类型") private String dictType; /** 状态(0正常 1停用) */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; public Long getDictId() { return dictId; } public void setDictId(Long dictId) { this.dictId = dictId; } @NotBlank(message = "字典名称不能为空") @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") public String getDictName() { return dictName; } public void setDictName(String dictName) { this.dictName = dictName; } @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") public String getDictType() { return dictType; } public void setDictType(String dictType) { this.dictType = dictType; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("dictId", getDictId()) .append("dictName", getDictName()) .append("dictType", getDictType()) .append("status", getStatus()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); }} | ||
| 1 | +package com.ruoyi.system.domain.entity; import javax.validation.constraints.NotBlank;import javax.validation.constraints.Size; import com.ruoyi.common.annotation.Excel;import com.ruoyi.common.annotation.PublicSQLConfig;import org.apache.commons.lang3.builder.ToStringBuilder;import org.apache.commons.lang3.builder.ToStringStyle;import com.ruoyi.common.tool.BaseEntity; /** * 字典类型表 sys_dict_type * * @author ruoyi */public class SysDictType extends BaseEntity{ @PublicSQLConfig(isSelect=false) private static final long serialVersionUID = 1L; /** 字典主键 */ @Excel(name = "字典主键", cellType = Excel.ColumnType.NUMERIC) private Long dictId; /** 字典名称 */ @Excel(name = "字典名称") private String dictName; /** 字典类型 */ @Excel(name = "字典类型") private String dictType; /** 状态(0正常 1停用) */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; public Long getDictId() { return dictId; } public void setDictId(Long dictId) { this.dictId = dictId; } @NotBlank(message = "字典名称不能为空") @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") public String getDictName() { return dictName; } public void setDictName(String dictName) { this.dictName = dictName; } @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") public String getDictType() { return dictType; } public void setDictType(String dictType) { this.dictType = dictType; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("dictId", getDictId()) .append("dictName", getDictName()) .append("dictType", getDictType()) .append("status", getStatus()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); }} |
| 1 | package com.ruoyi.system.domain.entity; | 1 | package com.ruoyi.system.domain.entity; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Excel; | 3 | import com.ruoyi.common.annotation.Excel; |
| 4 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | import com.ruoyi.common.tool.BaseEntity; | 5 | import com.ruoyi.common.tool.BaseEntity; |
| 5 | import org.apache.commons.lang3.builder.ToStringBuilder; | 6 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 6 | import org.apache.commons.lang3.builder.ToStringStyle; | 7 | import org.apache.commons.lang3.builder.ToStringStyle; |
| @@ -15,6 +16,7 @@ import javax.validation.constraints.Size; | @@ -15,6 +16,7 @@ import javax.validation.constraints.Size; | ||
| 15 | */ | 16 | */ |
| 16 | public class SysRole extends BaseEntity | 17 | public class SysRole extends BaseEntity |
| 17 | { | 18 | { |
| 19 | + @PublicSQLConfig(isSelect=false) | ||
| 18 | private static final long serialVersionUID = 1L; | 20 | private static final long serialVersionUID = 1L; |
| 19 | 21 | ||
| 20 | /** 角色ID */ | 22 | /** 角色ID */ |
| @@ -6,6 +6,7 @@ import com.ruoyi.common.annotation.Excel; | @@ -6,6 +6,7 @@ import com.ruoyi.common.annotation.Excel; | ||
| 6 | import com.ruoyi.common.annotation.Excel.ColumnType; | 6 | import com.ruoyi.common.annotation.Excel.ColumnType; |
| 7 | import com.ruoyi.common.annotation.Excel.Type; | 7 | import com.ruoyi.common.annotation.Excel.Type; |
| 8 | import com.ruoyi.common.annotation.Excels; | 8 | import com.ruoyi.common.annotation.Excels; |
| 9 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 9 | import com.ruoyi.common.utils.xss.Xss; | 10 | import com.ruoyi.common.utils.xss.Xss; |
| 10 | import com.ruoyi.common.tool.BaseEntity; | 11 | import com.ruoyi.common.tool.BaseEntity; |
| 11 | import org.apache.commons.lang3.builder.ToStringBuilder; | 12 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| @@ -24,6 +25,7 @@ import java.util.List; | @@ -24,6 +25,7 @@ import java.util.List; | ||
| 24 | */ | 25 | */ |
| 25 | public class SysUser extends BaseEntity | 26 | public class SysUser extends BaseEntity |
| 26 | { | 27 | { |
| 28 | + @PublicSQLConfig(isSelect=false) | ||
| 27 | private static final long serialVersionUID = 1L; | 29 | private static final long serialVersionUID = 1L; |
| 28 | 30 | ||
| 29 | /** 用户ID */ | 31 | /** 用户ID */ |
| @@ -202,14 +202,10 @@ public class PublicSQL { | @@ -202,14 +202,10 @@ public class PublicSQL { | ||
| 202 | { | 202 | { |
| 203 | Object object = para.get("object"); | 203 | Object object = para.get("object"); |
| 204 | String whereFieldNames = (String) para.get("whereFieldNames"); | 204 | String whereFieldNames = (String) para.get("whereFieldNames"); |
| 205 | - if( null != para.get("tablename")) | ||
| 206 | - { | ||
| 207 | - | ||
| 208 | - } | ||
| 209 | - String tableName = (String) para.get("tablename"); | ||
| 210 | - if(null == tableName) | 205 | + String tableName = changTableNameFromObject(object); |
| 206 | + if(para.containsKey("tablename")) | ||
| 211 | { | 207 | { |
| 212 | - tableName = changTableNameFromObject(object); | 208 | + tableName = (String) para.get("tablename"); |
| 213 | } | 209 | } |
| 214 | String sql = "update "; | 210 | String sql = "update "; |
| 215 | sql += tableName; | 211 | sql += tableName; |
| @@ -4,6 +4,7 @@ import java.util.Date; | @@ -4,6 +4,7 @@ import java.util.Date; | ||
| 4 | import javax.validation.constraints.NotBlank; | 4 | import javax.validation.constraints.NotBlank; |
| 5 | import javax.validation.constraints.Size; | 5 | import javax.validation.constraints.Size; |
| 6 | 6 | ||
| 7 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 7 | import com.ruoyi.common.tool.BaseEntity; | 8 | import com.ruoyi.common.tool.BaseEntity; |
| 8 | import org.apache.commons.lang3.builder.ToStringBuilder; | 9 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 9 | import org.apache.commons.lang3.builder.ToStringStyle; | 10 | import org.apache.commons.lang3.builder.ToStringStyle; |
| @@ -21,6 +22,7 @@ import com.ruoyi.quartz.util.CronUtils; | @@ -21,6 +22,7 @@ import com.ruoyi.quartz.util.CronUtils; | ||
| 21 | */ | 22 | */ |
| 22 | public class SysJob extends BaseEntity | 23 | public class SysJob extends BaseEntity |
| 23 | { | 24 | { |
| 25 | + @PublicSQLConfig(isSelect=false) | ||
| 24 | private static final long serialVersionUID = 1L; | 26 | private static final long serialVersionUID = 1L; |
| 25 | 27 | ||
| 26 | /** 任务ID */ | 28 | /** 任务ID */ |
| @@ -3,6 +3,7 @@ package com.ruoyi.quartz.domain; | @@ -3,6 +3,7 @@ package com.ruoyi.quartz.domain; | ||
| 3 | import java.util.Date; | 3 | import java.util.Date; |
| 4 | 4 | ||
| 5 | import com.ruoyi.common.annotation.Excel; | 5 | import com.ruoyi.common.annotation.Excel; |
| 6 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 6 | import com.ruoyi.common.tool.BaseEntity; | 7 | import com.ruoyi.common.tool.BaseEntity; |
| 7 | import org.apache.commons.lang3.builder.ToStringBuilder; | 8 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 8 | import org.apache.commons.lang3.builder.ToStringStyle; | 9 | import org.apache.commons.lang3.builder.ToStringStyle; |
| @@ -14,6 +15,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; | @@ -14,6 +15,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; | ||
| 14 | */ | 15 | */ |
| 15 | public class SysJobLog extends BaseEntity | 16 | public class SysJobLog extends BaseEntity |
| 16 | { | 17 | { |
| 18 | + @PublicSQLConfig(isSelect=false) | ||
| 17 | private static final long serialVersionUID = 1L; | 19 | private static final long serialVersionUID = 1L; |
| 18 | 20 | ||
| 19 | /** ID */ | 21 | /** ID */ |
| @@ -27,12 +27,10 @@ | @@ -27,12 +27,10 @@ | ||
| 27 | <module>lh-quartz</module> | 27 | <module>lh-quartz</module> |
| 28 | <module>ruoyi-auth</module> | 28 | <module>ruoyi-auth</module> |
| 29 | <module>ruoyi-common</module> | 29 | <module>ruoyi-common</module> |
| 30 | - <module>ruoyi-common-core</module> | ||
| 31 | <module>ruoyi-common-redis</module> | 30 | <module>ruoyi-common-redis</module> |
| 32 | <module>ruoyi-common-security</module> | 31 | <module>ruoyi-common-security</module> |
| 33 | <module>ruoyi-framework</module> | 32 | <module>ruoyi-framework</module> |
| 34 | <module>ruoyi-generator</module> | 33 | <module>ruoyi-generator</module> |
| 35 | - <module>ruoyi-system</module> | ||
| 36 | </modules> | 34 | </modules> |
| 37 | 35 | ||
| 38 | <packaging>pom</packaging> | 36 | <packaging>pom</packaging> |
lh-common/ruoyi-common-core/pom.xml
已删除
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | - <modelVersion>4.0.0</modelVersion> | ||
| 6 | - <parent> | ||
| 7 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 8 | - <artifactId>lh-common</artifactId> | ||
| 9 | - <version>1.0-SNAPSHOT</version> | ||
| 10 | - </parent> | ||
| 11 | - | ||
| 12 | - <artifactId>ruoyi-common-core</artifactId> | ||
| 13 | - | ||
| 14 | - <properties> | ||
| 15 | - <maven.compiler.source>8</maven.compiler.source> | ||
| 16 | - <maven.compiler.target>8</maven.compiler.target> | ||
| 17 | - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 18 | - </properties> | ||
| 19 | - | ||
| 20 | -</project> |
| 1 | +package com.zhonglai.luhui.security.config; | ||
| 2 | + | ||
| 3 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
| 4 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; | ||
| 5 | +import org.springframework.context.annotation.Configuration; | ||
| 6 | +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; | ||
| 7 | +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
| 8 | +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
| 9 | + | ||
| 10 | +@Configuration | ||
| 11 | +@EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true, securedEnabled = true) | ||
| 12 | +@EnableWebSecurity | ||
| 13 | +@ConditionalOnClass(WebSecurityConfigurerAdapter.class) | ||
| 14 | +@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) | ||
| 15 | +public class CustomSpringBootWebSecurityConfiguration { | ||
| 16 | + | ||
| 17 | +} |
| 1 | +package com.zhonglai.luhui.security.config; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.tool.SysLogininforType; | ||
| 4 | +import org.springframework.security.authentication.AuthenticationManager; | ||
| 5 | +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | ||
| 6 | +import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
| 7 | +import org.springframework.security.config.annotation.web.builders.WebSecurity; | ||
| 8 | +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
| 9 | +import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 10 | +import org.springframework.security.crypto.password.PasswordEncoder; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * spring security配置 | ||
| 14 | + * | ||
| 15 | + * @author ruoyi | ||
| 16 | + */ | ||
| 17 | +public abstract class DefaultSecurityConfig extends WebSecurityConfigurerAdapter | ||
| 18 | +{ | ||
| 19 | + /** | ||
| 20 | + * 解决 无法直接注入 AuthenticationManager | ||
| 21 | + * | ||
| 22 | + * @return | ||
| 23 | + * @throws Exception | ||
| 24 | + */ | ||
| 25 | + @Override | ||
| 26 | + public AuthenticationManager authenticationManagerBean() throws Exception | ||
| 27 | + { | ||
| 28 | + return super.authenticationManagerBean(); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + @Override | ||
| 32 | + public void configure(WebSecurity web) throws Exception { | ||
| 33 | + super.configure(web); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * anyRequest | 匹配所有请求路径 | ||
| 38 | + * access | SpringEl表达式结果为true时可以访问 | ||
| 39 | + * anonymous | 匿名可以访问 | ||
| 40 | + * denyAll | 用户不能访问 | ||
| 41 | + * fullyAuthenticated | 用户完全认证可以访问(非remember-me下自动登录) | ||
| 42 | + * hasAnyAuthority | 如果有参数,参数表示权限,则其中任何一个权限可以访问 | ||
| 43 | + * hasAnyRole | 如果有参数,参数表示角色,则其中任何一个角色可以访问 | ||
| 44 | + * hasAuthority | 如果有参数,参数表示权限,则其权限可以访问 | ||
| 45 | + * hasIpAddress | 如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问 | ||
| 46 | + * hasRole | 如果有参数,参数表示角色,则其角色可以访问 | ||
| 47 | + * permitAll | 用户可以任意访问 | ||
| 48 | + * rememberMe | 允许通过remember-me登录的用户访问 | ||
| 49 | + * authenticated | 用户登录后可访问 | ||
| 50 | + */ | ||
| 51 | + @Override | ||
| 52 | + protected void configure(HttpSecurity httpSecurity) throws Exception | ||
| 53 | + { | ||
| 54 | + configHttpSecurity(httpSecurity); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 身份认证接口 | ||
| 59 | + */ | ||
| 60 | + @Override | ||
| 61 | + protected void configure(AuthenticationManagerBuilder auth) throws Exception | ||
| 62 | + { | ||
| 63 | + auth.userDetailsService(getUserDetailsService()).passwordEncoder(bCryptPasswordEncoder()); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 自定义用户认证逻辑 | ||
| 68 | + */ | ||
| 69 | + public abstract UserDetailsService getUserDetailsService(); | ||
| 70 | + public abstract void configHttpSecurity(HttpSecurity httpSecurity) throws Exception; | ||
| 71 | + | ||
| 72 | + public abstract PasswordEncoder bCryptPasswordEncoder(); | ||
| 73 | + | ||
| 74 | + public abstract SysLogininforType sysLogininforType(); | ||
| 75 | +} |
| 1 | package com.zhonglai.luhui.security.domain; | 1 | package com.zhonglai.luhui.security.domain; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | import com.ruoyi.common.tool.BaseEntity; | 5 | import com.ruoyi.common.tool.BaseEntity; |
| 5 | 6 | ||
| 6 | import java.util.ArrayList; | 7 | import java.util.ArrayList; |
| @@ -13,6 +14,7 @@ import java.util.List; | @@ -13,6 +14,7 @@ import java.util.List; | ||
| 13 | */ | 14 | */ |
| 14 | public class TreeEntity extends BaseEntity | 15 | public class TreeEntity extends BaseEntity |
| 15 | { | 16 | { |
| 17 | + @PublicSQLConfig(isSelect=false) | ||
| 16 | private static final long serialVersionUID = 1L; | 18 | private static final long serialVersionUID = 1L; |
| 17 | 19 | ||
| 18 | /** 父菜单名称 */ | 20 | /** 父菜单名称 */ |
| 1 | package com.zhonglai.luhui.security.domain; | 1 | package com.zhonglai.luhui.security.domain; |
| 2 | 2 | ||
| 3 | import com.fasterxml.jackson.annotation.JsonInclude; | 3 | import com.fasterxml.jackson.annotation.JsonInclude; |
| 4 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | import com.ruoyi.system.domain.entity.SysDept; | 5 | import com.ruoyi.system.domain.entity.SysDept; |
| 5 | import com.ruoyi.system.domain.entity.SysMenu; | 6 | import com.ruoyi.system.domain.entity.SysMenu; |
| 6 | 7 | ||
| @@ -15,6 +16,7 @@ import java.util.stream.Collectors; | @@ -15,6 +16,7 @@ import java.util.stream.Collectors; | ||
| 15 | */ | 16 | */ |
| 16 | public class TreeSelect implements Serializable | 17 | public class TreeSelect implements Serializable |
| 17 | { | 18 | { |
| 19 | + @PublicSQLConfig(isSelect=false) | ||
| 18 | private static final long serialVersionUID = 1L; | 20 | private static final long serialVersionUID = 1L; |
| 19 | 21 | ||
| 20 | /** 节点ID */ | 22 | /** 节点ID */ |
| 1 | package com.zhonglai.luhui.security.dto; | 1 | package com.zhonglai.luhui.security.dto; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 3 | import com.ruoyi.common.utils.DESUtil; | 4 | import com.ruoyi.common.utils.DESUtil; |
| 4 | import com.ruoyi.common.tool.SysLogininforType; | 5 | import com.ruoyi.common.tool.SysLogininforType; |
| 5 | import com.zhonglai.luhui.security.utils.SecurityUtils; | 6 | import com.zhonglai.luhui.security.utils.SecurityUtils; |
| @@ -8,6 +9,7 @@ import org.springframework.security.core.GrantedAuthority; | @@ -8,6 +9,7 @@ import org.springframework.security.core.GrantedAuthority; | ||
| 8 | import java.util.Collection; | 9 | import java.util.Collection; |
| 9 | 10 | ||
| 10 | public class ApiLoginUser extends BaseLoginUser { | 11 | public class ApiLoginUser extends BaseLoginUser { |
| 12 | + @PublicSQLConfig(isSelect=false) | ||
| 11 | private static final long serialVersionUID = -2519976444812946707L; | 13 | private static final long serialVersionUID = -2519976444812946707L; |
| 12 | private Yu2leUserInfo yu2leUserInfo; | 14 | private Yu2leUserInfo yu2leUserInfo; |
| 13 | private Yu2leUserLogin yu2leUserLogin; | 15 | private Yu2leUserLogin yu2leUserLogin; |
| 1 | package com.zhonglai.luhui.security.dto; | 1 | package com.zhonglai.luhui.security.dto; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.tool.SysLogininforType; | 3 | import com.ruoyi.common.tool.SysLogininforType; |
| 4 | +import org.springframework.security.core.GrantedAuthority; | ||
| 5 | +import org.springframework.security.core.authority.SimpleGrantedAuthority; | ||
| 4 | import org.springframework.security.core.userdetails.UserDetails; | 6 | import org.springframework.security.core.userdetails.UserDetails; |
| 5 | 7 | ||
| 8 | +import java.util.ArrayList; | ||
| 9 | +import java.util.Collection; | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 6 | 12 | ||
| 7 | public abstract class BaseLoginUser implements UserDetails { | 13 | public abstract class BaseLoginUser implements UserDetails { |
| 8 | /** | 14 | /** |
| @@ -47,7 +53,7 @@ public abstract class BaseLoginUser implements UserDetails { | @@ -47,7 +53,7 @@ public abstract class BaseLoginUser implements UserDetails { | ||
| 47 | /** | 53 | /** |
| 48 | * 浏览器类型 | 54 | * 浏览器类型 |
| 49 | */ | 55 | */ |
| 50 | - private SysLogininforType sysLogininforType; | 56 | + protected SysLogininforType sysLogininforType; |
| 51 | 57 | ||
| 52 | public Long getUserId() { | 58 | public Long getUserId() { |
| 53 | return userId; | 59 | return userId; |
| @@ -119,7 +125,8 @@ public abstract class BaseLoginUser implements UserDetails { | @@ -119,7 +125,8 @@ public abstract class BaseLoginUser implements UserDetails { | ||
| 119 | return sysLogininforType; | 125 | return sysLogininforType; |
| 120 | } | 126 | } |
| 121 | 127 | ||
| 122 | - public void setSysLogininforType(SysLogininforType sysLogininforType) { | 128 | + public BaseLoginUser setSysLogininforType(SysLogininforType sysLogininforType) { |
| 123 | this.sysLogininforType = sysLogininforType; | 129 | this.sysLogininforType = sysLogininforType; |
| 130 | + return this; | ||
| 124 | } | 131 | } |
| 125 | } | 132 | } |
| @@ -5,8 +5,11 @@ import com.ruoyi.system.domain.entity.SysUser; | @@ -5,8 +5,11 @@ import com.ruoyi.system.domain.entity.SysUser; | ||
| 5 | import com.ruoyi.common.annotation.PublicSQLConfig; | 5 | import com.ruoyi.common.annotation.PublicSQLConfig; |
| 6 | import com.ruoyi.common.tool.SysLogininforType; | 6 | import com.ruoyi.common.tool.SysLogininforType; |
| 7 | import org.springframework.security.core.GrantedAuthority; | 7 | import org.springframework.security.core.GrantedAuthority; |
| 8 | +import org.springframework.security.core.authority.SimpleGrantedAuthority; | ||
| 8 | 9 | ||
| 10 | +import java.util.ArrayList; | ||
| 9 | import java.util.Collection; | 11 | import java.util.Collection; |
| 12 | +import java.util.List; | ||
| 10 | import java.util.Set; | 13 | import java.util.Set; |
| 11 | 14 | ||
| 12 | /** | 15 | /** |
| @@ -91,6 +94,11 @@ public class SysLoginUser extends BaseLoginUser | @@ -91,6 +94,11 @@ public class SysLoginUser extends BaseLoginUser | ||
| 91 | this.permissions = permissions; | 94 | this.permissions = permissions; |
| 92 | } | 95 | } |
| 93 | 96 | ||
| 97 | + @Override | ||
| 98 | + public Collection<? extends GrantedAuthority> getAuthorities() { | ||
| 99 | + return null; | ||
| 100 | + } | ||
| 101 | + | ||
| 94 | @JSONField(serialize = false) | 102 | @JSONField(serialize = false) |
| 95 | public String getPassword() | 103 | public String getPassword() |
| 96 | { | 104 | { |
| @@ -165,9 +173,5 @@ public class SysLoginUser extends BaseLoginUser | @@ -165,9 +173,5 @@ public class SysLoginUser extends BaseLoginUser | ||
| 165 | this.user = user; | 173 | this.user = user; |
| 166 | } | 174 | } |
| 167 | 175 | ||
| 168 | - | ||
| 169 | - public Collection<? extends GrantedAuthority> getAuthorities() | ||
| 170 | - { | ||
| 171 | - return null; | ||
| 172 | - } | 176 | + |
| 173 | } | 177 | } |
| 1 | package com.zhonglai.luhui.security.dto; | 1 | package com.zhonglai.luhui.security.dto; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | import com.ruoyi.common.utils.DESUtil; | 5 | import com.ruoyi.common.utils.DESUtil; |
| 5 | import com.ruoyi.common.utils.DateUtils; | 6 | import com.ruoyi.common.utils.DateUtils; |
| 6 | 7 | ||
| @@ -10,6 +11,7 @@ import java.io.Serializable; | @@ -10,6 +11,7 @@ import java.io.Serializable; | ||
| 10 | * 登录令牌 | 11 | * 登录令牌 |
| 11 | */ | 12 | */ |
| 12 | public class Yu2leLoginToken implements Serializable { | 13 | public class Yu2leLoginToken implements Serializable { |
| 14 | + @PublicSQLConfig(isSelect=false) | ||
| 13 | private static final long serialVersionUID = -8696564127500370479L; | 15 | private static final long serialVersionUID = -8696564127500370479L; |
| 14 | private Integer userId; //当前用户id | 16 | private Integer userId; //当前用户id |
| 15 | private String userLoginName; //当前用户登录名 | 17 | private String userLoginName; //当前用户登录名 |
| 1 | package com.zhonglai.luhui.security.handle; | 1 | package com.zhonglai.luhui.security.handle; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | import com.ruoyi.common.constant.HttpStatus; | 5 | import com.ruoyi.common.constant.HttpStatus; |
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 6 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.common.utils.ServletUtils; | 7 | import com.ruoyi.common.utils.ServletUtils; |
| @@ -22,6 +23,7 @@ import java.io.Serializable; | @@ -22,6 +23,7 @@ import java.io.Serializable; | ||
| 22 | @Component | 23 | @Component |
| 23 | public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable | 24 | public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable |
| 24 | { | 25 | { |
| 26 | + @PublicSQLConfig(isSelect=false) | ||
| 25 | private static final long serialVersionUID = -8970718410437077606L; | 27 | private static final long serialVersionUID = -8970718410437077606L; |
| 26 | 28 | ||
| 27 | @Override | 29 | @Override |
| @@ -7,8 +7,8 @@ import com.ruoyi.common.core.domain.AjaxResult; | @@ -7,8 +7,8 @@ import com.ruoyi.common.core.domain.AjaxResult; | ||
| 7 | import com.ruoyi.common.utils.ServletUtils; | 7 | import com.ruoyi.common.utils.ServletUtils; |
| 8 | import com.ruoyi.common.utils.StringUtils; | 8 | import com.ruoyi.common.utils.StringUtils; |
| 9 | import com.zhonglai.luhui.security.dto.BaseLoginUser; | 9 | import com.zhonglai.luhui.security.dto.BaseLoginUser; |
| 10 | -import com.zhonglai.luhui.security.manager.AsyncManager; | ||
| 11 | -import com.zhonglai.luhui.security.manager.factory.AsyncFactory; | 10 | +import com.zhonglai.luhui.sys.manager.AsyncManager; |
| 11 | +import com.zhonglai.luhui.sys.manager.factory.AsyncFactory; | ||
| 12 | import com.zhonglai.luhui.security.service.TokenService; | 12 | import com.zhonglai.luhui.security.service.TokenService; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.context.annotation.Configuration; | 14 | import org.springframework.context.annotation.Configuration; |
| @@ -48,4 +48,5 @@ public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler | @@ -48,4 +48,5 @@ public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler | ||
| 48 | } | 48 | } |
| 49 | ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功"))); | 49 | ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功"))); |
| 50 | } | 50 | } |
| 51 | + | ||
| 51 | } | 52 | } |
| 1 | +package com.zhonglai.luhui.security.service; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.enums.UserStatus; | ||
| 4 | +import com.ruoyi.common.exception.ServiceException; | ||
| 5 | +import com.ruoyi.common.tool.SysLogininforType; | ||
| 6 | +import com.ruoyi.common.utils.StringUtils; | ||
| 7 | +import com.ruoyi.system.domain.entity.SysUser; | ||
| 8 | +import com.zhonglai.luhui.security.dto.SysLoginUser; | ||
| 9 | +import com.zhonglai.luhui.sys.service.ISysUserService; | ||
| 10 | +import org.slf4j.Logger; | ||
| 11 | +import org.slf4j.LoggerFactory; | ||
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.security.core.userdetails.UserDetails; | ||
| 14 | +import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 15 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 16 | +import org.springframework.stereotype.Service; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 用户验证处理 | ||
| 20 | + * | ||
| 21 | + * @author ruoyi | ||
| 22 | + */ | ||
| 23 | +@Service | ||
| 24 | +public class AdminDetailsServiceImpl implements UserDetailsService | ||
| 25 | +{ | ||
| 26 | + private static final Logger log = LoggerFactory.getLogger(AdminDetailsServiceImpl.class); | ||
| 27 | + | ||
| 28 | + @Autowired | ||
| 29 | + private ISysUserService userService; | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + @Override | ||
| 33 | + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException | ||
| 34 | + { | ||
| 35 | + SysUser user = userService.selectUserByUserName(username); | ||
| 36 | + if (StringUtils.isNull(user)) | ||
| 37 | + { | ||
| 38 | + log.info("登录用户:{} 不存在.", username); | ||
| 39 | + throw new ServiceException("登录用户:" + username + " 不存在"); | ||
| 40 | + } | ||
| 41 | + else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) | ||
| 42 | + { | ||
| 43 | + log.info("登录用户:{} 已被删除.", username); | ||
| 44 | + throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); | ||
| 45 | + } | ||
| 46 | + else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) | ||
| 47 | + { | ||
| 48 | + log.info("登录用户:{} 已被停用.", username); | ||
| 49 | + throw new ServiceException("对不起,您的账号:" + username + " 已停用"); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + return createLoginUser(user); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public UserDetails createLoginUser(SysUser user) | ||
| 56 | + { | ||
| 57 | + return new SysLoginUser(user.getUserId(), user.getDeptId(), user,null).setSysLogininforType(SysLogininforType.lhAdmin); | ||
| 58 | + } | ||
| 59 | +} |
| 1 | +package com.zhonglai.luhui.security.service; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.exception.ServiceException; | ||
| 4 | +import com.ruoyi.common.tool.SysLogininforType; | ||
| 5 | +import com.ruoyi.common.utils.StringUtils; | ||
| 6 | +import com.zhonglai.luhui.dao.service.PublicService; | ||
| 7 | +import com.zhonglai.luhui.security.dto.ApiLoginUser; | ||
| 8 | +import com.zhonglai.luhui.security.dto.Yu2leUserInfo; | ||
| 9 | +import com.zhonglai.luhui.security.dto.Yu2leUserLogin; | ||
| 10 | +import org.slf4j.Logger; | ||
| 11 | +import org.slf4j.LoggerFactory; | ||
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.security.core.userdetails.UserDetails; | ||
| 14 | +import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 15 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 16 | +import org.springframework.stereotype.Service; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 用户验证处理 | ||
| 20 | + * | ||
| 21 | + * @author ruoyi | ||
| 22 | + */ | ||
| 23 | +@Service | ||
| 24 | +public class ApiDetailsServiceImpl implements UserDetailsService | ||
| 25 | +{ | ||
| 26 | + private static final Logger log = LoggerFactory.getLogger(ApiDetailsServiceImpl.class); | ||
| 27 | + @Autowired | ||
| 28 | + private PublicService publicService; | ||
| 29 | + @Override | ||
| 30 | + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | ||
| 31 | + Yu2leUserLogin yu2leUserLogin = publicService.getObjectForTableName(Yu2leUserLogin.class,"loginName",username,"`liu_yu_le`.`user_login`"); | ||
| 32 | + Yu2leUserInfo yu2leUserInfo = publicService.getObjectForTableName(Yu2leUserInfo.class,"loginName",username,"`liu_yu_le`.`user_info`");; | ||
| 33 | + if (StringUtils.isNull(yu2leUserLogin) || StringUtils.isNull(yu2leUserInfo)) | ||
| 34 | + { | ||
| 35 | + log.info("登录用户:{} 不存在.", username); | ||
| 36 | + throw new ServiceException("登录用户:" + username + " 不存在"); | ||
| 37 | + } | ||
| 38 | + else if (1==yu2leUserInfo.getIsInvalid()) | ||
| 39 | + { | ||
| 40 | + log.info("登录用户:{} 已被停用.", username); | ||
| 41 | + throw new ServiceException("对不起,您的账号:" + username + " 已停用"); | ||
| 42 | + } | ||
| 43 | + return new ApiLoginUser(yu2leUserInfo, yu2leUserLogin).setSysLogininforType(SysLogininforType.lhApi); | ||
| 44 | + } | ||
| 45 | +} |
| 1 | -package com.zhonglai.luhui.security.service; | ||
| 2 | - | ||
| 3 | -import org.springframework.security.authentication.BadCredentialsException; | ||
| 4 | -import org.springframework.security.authentication.InternalAuthenticationServiceException; | ||
| 5 | -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | ||
| 6 | -import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider; | ||
| 7 | -import org.springframework.security.core.Authentication; | ||
| 8 | -import org.springframework.security.core.AuthenticationException; | ||
| 9 | -import org.springframework.security.core.userdetails.UserDetails; | ||
| 10 | -import org.springframework.security.core.userdetails.UserDetailsPasswordService; | ||
| 11 | -import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 12 | -import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 13 | -import org.springframework.security.crypto.factory.PasswordEncoderFactories; | ||
| 14 | -import org.springframework.security.crypto.password.PasswordEncoder; | ||
| 15 | -import org.springframework.util.Assert; | ||
| 16 | - | ||
| 17 | -import java.util.Map; | ||
| 18 | - | ||
| 19 | -public class CustomAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider { | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * The plaintext password used to perform PasswordEncoder#matches(CharSequence, | ||
| 23 | - * String)} on when the user is not found to avoid SEC-2056. | ||
| 24 | - */ | ||
| 25 | - private static final String USER_NOT_FOUND_PASSWORD = "userNotFoundPassword"; | ||
| 26 | - | ||
| 27 | - private PasswordEncoder passwordEncoder; | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * The password used to perform {@link PasswordEncoder#matches(CharSequence, String)} | ||
| 31 | - * on when the user is not found to avoid SEC-2056. This is necessary, because some | ||
| 32 | - * {@link PasswordEncoder} implementations will short circuit if the password is not | ||
| 33 | - * in a valid format. | ||
| 34 | - */ | ||
| 35 | - private volatile String userNotFoundEncodedPassword; | ||
| 36 | - | ||
| 37 | - private CustomUserDetailsService userDetailsService; | ||
| 38 | - | ||
| 39 | - private UserDetailsPasswordService userDetailsPasswordService; | ||
| 40 | - | ||
| 41 | - public CustomAuthenticationProvider() { | ||
| 42 | - setPasswordEncoder(PasswordEncoderFactories.createDelegatingPasswordEncoder()); | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - @Override | ||
| 46 | - @SuppressWarnings("deprecation") | ||
| 47 | - protected void additionalAuthenticationChecks(UserDetails userDetails, | ||
| 48 | - UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { | ||
| 49 | - if (authentication.getCredentials() == null) { | ||
| 50 | - this.logger.debug("Failed to authenticate since no credentials provided"); | ||
| 51 | - throw new BadCredentialsException(this.messages | ||
| 52 | - .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); | ||
| 53 | - } | ||
| 54 | - String presentedPassword = authentication.getCredentials().toString(); | ||
| 55 | - if (!this.passwordEncoder.matches(presentedPassword, userDetails.getPassword())) { | ||
| 56 | - this.logger.debug("Failed to authenticate since password does not match stored value"); | ||
| 57 | - throw new BadCredentialsException(this.messages | ||
| 58 | - .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); | ||
| 59 | - } | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - @Override | ||
| 63 | - protected void doAfterPropertiesSet() { | ||
| 64 | - Assert.notNull(this.userDetailsService, "A UserDetailsService must be set"); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - @Override | ||
| 68 | - protected final UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication) | ||
| 69 | - throws AuthenticationException { | ||
| 70 | - this.prepareTimingAttackProtection(); | ||
| 71 | - Map<String,String> map = (Map<String, String>) authentication.getDetails(); // 自定义添加 | ||
| 72 | - try { | ||
| 73 | - String userType = map.get("userType"); // 自定义添加 | ||
| 74 | - UserDetails loadedUser = this.getUserDetailsService().loadUserByUsername(username, userType); // 自定义添加userType参数 | ||
| 75 | - if (loadedUser == null) { | ||
| 76 | - throw new InternalAuthenticationServiceException("UserDetailsService returned null, which is an interface contract violation"); | ||
| 77 | - } else { | ||
| 78 | - return loadedUser; | ||
| 79 | - } | ||
| 80 | - } catch (UsernameNotFoundException var4) { | ||
| 81 | - this.mitigateAgainstTimingAttack(authentication); | ||
| 82 | - throw var4; | ||
| 83 | - } catch (InternalAuthenticationServiceException var5) { | ||
| 84 | - throw var5; | ||
| 85 | - } catch (Exception var6) { | ||
| 86 | - throw new InternalAuthenticationServiceException(var6.getMessage(), var6); | ||
| 87 | - } | ||
| 88 | - } | ||
| 89 | - | ||
| 90 | - @Override | ||
| 91 | - protected Authentication createSuccessAuthentication(Object principal, Authentication authentication, | ||
| 92 | - UserDetails user) { | ||
| 93 | - boolean upgradeEncoding = this.userDetailsPasswordService != null | ||
| 94 | - && this.passwordEncoder.upgradeEncoding(user.getPassword()); | ||
| 95 | - if (upgradeEncoding) { | ||
| 96 | - String presentedPassword = authentication.getCredentials().toString(); | ||
| 97 | - String newPassword = this.passwordEncoder.encode(presentedPassword); | ||
| 98 | - user = this.userDetailsPasswordService.updatePassword(user, newPassword); | ||
| 99 | - } | ||
| 100 | - return super.createSuccessAuthentication(principal, authentication, user); | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - private void prepareTimingAttackProtection() { | ||
| 104 | - if (this.userNotFoundEncodedPassword == null) { | ||
| 105 | - this.userNotFoundEncodedPassword = this.passwordEncoder.encode(USER_NOT_FOUND_PASSWORD); | ||
| 106 | - } | ||
| 107 | - } | ||
| 108 | - | ||
| 109 | - private void mitigateAgainstTimingAttack(UsernamePasswordAuthenticationToken authentication) { | ||
| 110 | - if (authentication.getCredentials() != null) { | ||
| 111 | - String presentedPassword = authentication.getCredentials().toString(); | ||
| 112 | - this.passwordEncoder.matches(presentedPassword, this.userNotFoundEncodedPassword); | ||
| 113 | - } | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - /** | ||
| 117 | - * Sets the PasswordEncoder instance to be used to encode and validate passwords. If | ||
| 118 | - * not set, the password will be compared using | ||
| 119 | - * {@link PasswordEncoderFactories#createDelegatingPasswordEncoder()} | ||
| 120 | - * @param passwordEncoder must be an instance of one of the {@code PasswordEncoder} | ||
| 121 | - * types. | ||
| 122 | - */ | ||
| 123 | - public void setPasswordEncoder(PasswordEncoder passwordEncoder) { | ||
| 124 | - Assert.notNull(passwordEncoder, "passwordEncoder cannot be null"); | ||
| 125 | - this.passwordEncoder = passwordEncoder; | ||
| 126 | - this.userNotFoundEncodedPassword = null; | ||
| 127 | - } | ||
| 128 | - | ||
| 129 | - protected PasswordEncoder getPasswordEncoder() { | ||
| 130 | - return this.passwordEncoder; | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | - public void setUserDetailsService(CustomUserDetailsService userDetailsService) { | ||
| 134 | - this.userDetailsService = userDetailsService; | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - protected CustomUserDetailsService getUserDetailsService() { | ||
| 138 | - return this.userDetailsService; | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - public void setUserDetailsPasswordService(UserDetailsPasswordService userDetailsPasswordService) { | ||
| 142 | - this.userDetailsPasswordService = userDetailsPasswordService; | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | -} | ||
| 146 | - |
| 1 | -package com.zhonglai.luhui.security.service; | ||
| 2 | - | ||
| 3 | -import org.springframework.security.core.userdetails.UserDetails; | ||
| 4 | -import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 5 | -import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 6 | - | ||
| 7 | -public interface CustomUserDetailsService extends UserDetailsService { | ||
| 8 | - UserDetails loadUserByUsername(String username, String usertype) throws UsernameNotFoundException; | ||
| 9 | -} |
| 1 | -package com.zhonglai.luhui.security.config; | 1 | +package com.zhonglai.luhui.security.service; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.tool.SysLogininforType; | ||
| 3 | import com.zhonglai.luhui.security.filter.JwtAuthenticationTokenFilter; | 4 | import com.zhonglai.luhui.security.filter.JwtAuthenticationTokenFilter; |
| 4 | import com.zhonglai.luhui.security.handle.AuthenticationEntryPointImpl; | 5 | import com.zhonglai.luhui.security.handle.AuthenticationEntryPointImpl; |
| 5 | import com.zhonglai.luhui.security.handle.LogoutSuccessHandlerImpl; | 6 | import com.zhonglai.luhui.security.handle.LogoutSuccessHandlerImpl; |
| 6 | -import com.zhonglai.luhui.security.service.CustomAuthenticationProvider; | ||
| 7 | -import com.zhonglai.luhui.security.service.CustomUserDetailsService; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.beans.factory.annotation.Value; | 8 | import org.springframework.beans.factory.annotation.Value; |
| 10 | import org.springframework.context.annotation.Bean; | 9 | import org.springframework.context.annotation.Bean; |
| 11 | import org.springframework.http.HttpMethod; | 10 | import org.springframework.http.HttpMethod; |
| 12 | -import org.springframework.security.authentication.AuthenticationManager; | ||
| 13 | -import org.springframework.security.authentication.AuthenticationProvider; | ||
| 14 | -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | ||
| 15 | -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; | ||
| 16 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; | 11 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| 17 | -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
| 18 | import org.springframework.security.config.http.SessionCreationPolicy; | 12 | import org.springframework.security.config.http.SessionCreationPolicy; |
| 13 | +import org.springframework.security.core.context.SecurityContextHolder; | ||
| 19 | import org.springframework.security.core.userdetails.UserDetailsService; | 14 | import org.springframework.security.core.userdetails.UserDetailsService; |
| 20 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | 15 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| 21 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; | 16 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; |
| 22 | import org.springframework.security.web.authentication.logout.LogoutFilter; | 17 | import org.springframework.security.web.authentication.logout.LogoutFilter; |
| 18 | +import org.springframework.stereotype.Service; | ||
| 23 | import org.springframework.web.filter.CorsFilter; | 19 | import org.springframework.web.filter.CorsFilter; |
| 24 | 20 | ||
| 25 | -/** | ||
| 26 | - * spring security配置 | ||
| 27 | - * | ||
| 28 | - * @author ruoyi | ||
| 29 | - */ | ||
| 30 | -@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) | ||
| 31 | -public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 32 | -{ | ||
| 33 | - /** | ||
| 34 | - * 自定义用户认证逻辑 | ||
| 35 | - */ | ||
| 36 | - @Autowired | ||
| 37 | - private CustomUserDetailsService userDetailsService; | ||
| 38 | - | 21 | +import javax.servlet.*; |
| 22 | +import java.io.IOException; | ||
| 23 | + | ||
| 24 | +@Service | ||
| 25 | +public class SecurityConfigService { | ||
| 39 | /** | 26 | /** |
| 40 | * 认证失败处理类 | 27 | * 认证失败处理类 |
| 41 | */ | 28 | */ |
| @@ -43,59 +30,41 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | @@ -43,59 +30,41 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 43 | private AuthenticationEntryPointImpl unauthorizedHandler; | 30 | private AuthenticationEntryPointImpl unauthorizedHandler; |
| 44 | 31 | ||
| 45 | /** | 32 | /** |
| 46 | - * 退出处理类 | ||
| 47 | - */ | ||
| 48 | - @Autowired | ||
| 49 | - private LogoutSuccessHandlerImpl logoutSuccessHandler; | ||
| 50 | - | ||
| 51 | - /** | ||
| 52 | * token认证过滤器 | 33 | * token认证过滤器 |
| 53 | */ | 34 | */ |
| 54 | @Autowired | 35 | @Autowired |
| 55 | private JwtAuthenticationTokenFilter authenticationTokenFilter; | 36 | private JwtAuthenticationTokenFilter authenticationTokenFilter; |
| 56 | - | 37 | + |
| 57 | /** | 38 | /** |
| 58 | * 跨域过滤器 | 39 | * 跨域过滤器 |
| 59 | */ | 40 | */ |
| 60 | @Autowired | 41 | @Autowired |
| 61 | private CorsFilter corsFilter; | 42 | private CorsFilter corsFilter; |
| 62 | 43 | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 退出处理类 | ||
| 47 | + */ | ||
| 48 | + @Autowired | ||
| 49 | + private LogoutSuccessHandlerImpl logoutSuccessHandler; | ||
| 50 | + | ||
| 63 | /** | 51 | /** |
| 64 | * 不拦截url | 52 | * 不拦截url |
| 65 | */ | 53 | */ |
| 66 | @Value("${sys.antMatchers}") | 54 | @Value("${sys.antMatchers}") |
| 67 | private String antMatchers; | 55 | private String antMatchers; |
| 68 | - | ||
| 69 | - /** | ||
| 70 | - * 解决 无法直接注入 AuthenticationManager | ||
| 71 | - * | ||
| 72 | - * @return | ||
| 73 | - * @throws Exception | ||
| 74 | - */ | ||
| 75 | - @Bean | ||
| 76 | - @Override | ||
| 77 | - public AuthenticationManager authenticationManagerBean() throws Exception | ||
| 78 | - { | ||
| 79 | - return super.authenticationManagerBean(); | 56 | + |
| 57 | + public void configHttpSecurity(HttpSecurity httpSecurity) throws Exception{ | ||
| 58 | + httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); | ||
| 59 | + defaultConfigHttpSecurity(httpSecurity); | ||
| 60 | + // 添加JWT filter | ||
| 61 | + httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); | ||
| 62 | + // 添加CORS filter | ||
| 63 | + httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); | ||
| 64 | + httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); | ||
| 80 | } | 65 | } |
| 81 | 66 | ||
| 82 | - /** | ||
| 83 | - * anyRequest | 匹配所有请求路径 | ||
| 84 | - * access | SpringEl表达式结果为true时可以访问 | ||
| 85 | - * anonymous | 匿名可以访问 | ||
| 86 | - * denyAll | 用户不能访问 | ||
| 87 | - * fullyAuthenticated | 用户完全认证可以访问(非remember-me下自动登录) | ||
| 88 | - * hasAnyAuthority | 如果有参数,参数表示权限,则其中任何一个权限可以访问 | ||
| 89 | - * hasAnyRole | 如果有参数,参数表示角色,则其中任何一个角色可以访问 | ||
| 90 | - * hasAuthority | 如果有参数,参数表示权限,则其权限可以访问 | ||
| 91 | - * hasIpAddress | 如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问 | ||
| 92 | - * hasRole | 如果有参数,参数表示角色,则其角色可以访问 | ||
| 93 | - * permitAll | 用户可以任意访问 | ||
| 94 | - * rememberMe | 允许通过remember-me登录的用户访问 | ||
| 95 | - * authenticated | 用户登录后可访问 | ||
| 96 | - */ | ||
| 97 | - @Override | ||
| 98 | - protected void configure(HttpSecurity httpSecurity) throws Exception | 67 | + public void defaultConfigHttpSecurity(HttpSecurity httpSecurity) throws Exception |
| 99 | { | 68 | { |
| 100 | httpSecurity | 69 | httpSecurity |
| 101 | // CSRF禁用,因为不使用session | 70 | // CSRF禁用,因为不使用session |
| @@ -126,12 +95,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | @@ -126,12 +95,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 126 | .anyRequest().authenticated() | 95 | .anyRequest().authenticated() |
| 127 | .and() | 96 | .and() |
| 128 | .headers().frameOptions().disable(); | 97 | .headers().frameOptions().disable(); |
| 129 | - httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); | ||
| 130 | - // 添加JWT filter | ||
| 131 | - httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); | ||
| 132 | - // 添加CORS filter | ||
| 133 | - httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); | ||
| 134 | - httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); | ||
| 135 | 98 | ||
| 136 | } | 99 | } |
| 137 | 100 | ||
| @@ -144,26 +107,4 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | @@ -144,26 +107,4 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 144 | return new BCryptPasswordEncoder(); | 107 | return new BCryptPasswordEncoder(); |
| 145 | } | 108 | } |
| 146 | 109 | ||
| 147 | -// /** | ||
| 148 | -// * 身份认证接口 | ||
| 149 | -// */ | ||
| 150 | -// @Override | ||
| 151 | -// protected void configure(AuthenticationManagerBuilder auth) throws Exception | ||
| 152 | -// { | ||
| 153 | -// auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); | ||
| 154 | -// } | ||
| 155 | - | ||
| 156 | - @Bean(name="customAuthenticationProvider") | ||
| 157 | - public AuthenticationProvider customAuthenticationProvider() { | ||
| 158 | - CustomAuthenticationProvider customAuthenticationProvider= new CustomAuthenticationProvider(); | ||
| 159 | - customAuthenticationProvider.setUserDetailsService(userDetailsService); | ||
| 160 | - customAuthenticationProvider.setHideUserNotFoundExceptions(false); | ||
| 161 | - customAuthenticationProvider.setPasswordEncoder(bCryptPasswordEncoder()); | ||
| 162 | - return customAuthenticationProvider; | ||
| 163 | - } | ||
| 164 | - | ||
| 165 | - @Override | ||
| 166 | - protected void configure(AuthenticationManagerBuilder auth) throws Exception { | ||
| 167 | - auth.authenticationProvider(customAuthenticationProvider()); | ||
| 168 | - } | ||
| 169 | } | 110 | } |
| 1 | package com.zhonglai.luhui.security.service; | 1 | package com.zhonglai.luhui.security.service; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.constant.Constants; | 3 | import com.ruoyi.common.constant.Constants; |
| 4 | +import com.ruoyi.common.tool.SysLogininforType; | ||
| 4 | import com.ruoyi.common.utils.ServletUtils; | 5 | import com.ruoyi.common.utils.ServletUtils; |
| 5 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 6 | import com.ruoyi.common.utils.ip.AddressUtils; | 7 | import com.ruoyi.common.utils.ip.AddressUtils; |
| @@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value; | @@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value; | ||
| 19 | import org.springframework.stereotype.Component; | 20 | import org.springframework.stereotype.Component; |
| 20 | 21 | ||
| 21 | import javax.servlet.http.HttpServletRequest; | 22 | import javax.servlet.http.HttpServletRequest; |
| 23 | +import java.util.Collection; | ||
| 22 | import java.util.HashMap; | 24 | import java.util.HashMap; |
| 23 | import java.util.Map; | 25 | import java.util.Map; |
| 24 | import java.util.concurrent.TimeUnit; | 26 | import java.util.concurrent.TimeUnit; |
| @@ -62,7 +64,7 @@ public class TokenService | @@ -62,7 +64,7 @@ public class TokenService | ||
| 62 | * | 64 | * |
| 63 | * @return 用户信息 | 65 | * @return 用户信息 |
| 64 | */ | 66 | */ |
| 65 | - public BaseLoginUser getLoginUser(HttpServletRequest request) | 67 | + public BaseLoginUser getLoginUser(HttpServletRequest request ) |
| 66 | { | 68 | { |
| 67 | // 获取请求携带的令牌 | 69 | // 获取请求携带的令牌 |
| 68 | String token = getToken(request); | 70 | String token = getToken(request); |
| @@ -74,7 +76,9 @@ public class TokenService | @@ -74,7 +76,9 @@ public class TokenService | ||
| 74 | // 解析对应的权限以及用户信息 | 76 | // 解析对应的权限以及用户信息 |
| 75 | String uuid = (String) claims.get(Constants.LOGIN_USER_KEY); | 77 | String uuid = (String) claims.get(Constants.LOGIN_USER_KEY); |
| 76 | String userKey = getTokenKey(uuid); | 78 | String userKey = getTokenKey(uuid); |
| 77 | - BaseLoginUser user = redisCache.getCacheObject(userKey); | 79 | + |
| 80 | + Collection<String> keys = redisCache.keys(userKey); | ||
| 81 | + BaseLoginUser user = redisCache.getCacheObject(keys.stream().findFirst().get()); | ||
| 78 | return user; | 82 | return user; |
| 79 | } | 83 | } |
| 80 | catch (Exception e) | 84 | catch (Exception e) |
| @@ -99,7 +103,7 @@ public class TokenService | @@ -99,7 +103,7 @@ public class TokenService | ||
| 99 | /** | 103 | /** |
| 100 | * 删除用户身份信息 | 104 | * 删除用户身份信息 |
| 101 | */ | 105 | */ |
| 102 | - public void delLoginUser(String token) | 106 | + public void delLoginUser(String token ) |
| 103 | { | 107 | { |
| 104 | if (StringUtils.isNotEmpty(token)) | 108 | if (StringUtils.isNotEmpty(token)) |
| 105 | { | 109 | { |
| @@ -126,7 +130,7 @@ public class TokenService | @@ -126,7 +130,7 @@ public class TokenService | ||
| 126 | return createToken(claims); | 130 | return createToken(claims); |
| 127 | } | 131 | } |
| 128 | 132 | ||
| 129 | - public void upUser(BaseLoginUser loginUser) | 133 | + public void upUser(BaseLoginUser loginUser, SysLogininforType sysLogininforType) |
| 130 | { | 134 | { |
| 131 | String userKey = getTokenKey(loginUser.getToken()); | 135 | String userKey = getTokenKey(loginUser.getToken()); |
| 132 | redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES); | 136 | redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES); |
| 1 | -package com.zhonglai.luhui.security.service; | ||
| 2 | - | ||
| 3 | -import org.springframework.security.core.userdetails.UserDetails; | ||
| 4 | -import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 5 | -import org.springframework.stereotype.Service; | ||
| 6 | - | ||
| 7 | -@Service | ||
| 8 | -public class UserDetailsServiceImpl implements CustomUserDetailsService { | ||
| 9 | - @Override | ||
| 10 | - public UserDetails loadUserByUsername(String username, String usertype) throws UsernameNotFoundException { | ||
| 11 | - return null; | ||
| 12 | - } | ||
| 13 | - | ||
| 14 | - @Override | ||
| 15 | - public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | ||
| 16 | - return null; | ||
| 17 | - } | ||
| 18 | -} |
| 1 | package com.ruoyi.common.core.domain; | 1 | package com.ruoyi.common.core.domain; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 3 | import com.ruoyi.common.constant.HttpStatus; | 4 | import com.ruoyi.common.constant.HttpStatus; |
| 4 | import com.ruoyi.common.utils.StringUtils; | 5 | import com.ruoyi.common.utils.StringUtils; |
| 5 | 6 | ||
| @@ -12,6 +13,7 @@ import java.util.HashMap; | @@ -12,6 +13,7 @@ import java.util.HashMap; | ||
| 12 | */ | 13 | */ |
| 13 | public class AjaxResult extends HashMap<String, Object> | 14 | public class AjaxResult extends HashMap<String, Object> |
| 14 | { | 15 | { |
| 16 | + @PublicSQLConfig(isSelect=false) | ||
| 15 | private static final long serialVersionUID = 1L; | 17 | private static final long serialVersionUID = 1L; |
| 16 | 18 | ||
| 17 | /** 状态码 */ | 19 | /** 状态码 */ |
| 1 | package com.ruoyi.common.exception; | 1 | package com.ruoyi.common.exception; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | + | ||
| 3 | /** | 5 | /** |
| 4 | * 工具类异常 | 6 | * 工具类异常 |
| 5 | * | 7 | * |
| @@ -7,6 +9,7 @@ package com.ruoyi.common.exception; | @@ -7,6 +9,7 @@ package com.ruoyi.common.exception; | ||
| 7 | */ | 9 | */ |
| 8 | public class UtilException extends RuntimeException | 10 | public class UtilException extends RuntimeException |
| 9 | { | 11 | { |
| 12 | + @PublicSQLConfig(isSelect=false) | ||
| 10 | private static final long serialVersionUID = 8247610319171014183L; | 13 | private static final long serialVersionUID = 8247610319171014183L; |
| 11 | 14 | ||
| 12 | public UtilException(Throwable e) | 15 | public UtilException(Throwable e) |
| 1 | package com.ruoyi.common.exception.job; | 1 | package com.ruoyi.common.exception.job; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 4 | + | ||
| 3 | /** | 5 | /** |
| 4 | * 计划策略异常 | 6 | * 计划策略异常 |
| 5 | * | 7 | * |
| @@ -7,6 +9,7 @@ package com.ruoyi.common.exception.job; | @@ -7,6 +9,7 @@ package com.ruoyi.common.exception.job; | ||
| 7 | */ | 9 | */ |
| 8 | public class TaskException extends Exception | 10 | public class TaskException extends Exception |
| 9 | { | 11 | { |
| 12 | + @PublicSQLConfig(isSelect=false) | ||
| 10 | private static final long serialVersionUID = 1L; | 13 | private static final long serialVersionUID = 1L; |
| 11 | 14 | ||
| 12 | private Code code; | 15 | private Code code; |
| 1 | package com.ruoyi.common.utils.uuid; | 1 | package com.ruoyi.common.utils.uuid; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 3 | import com.ruoyi.common.exception.UtilException; | 4 | import com.ruoyi.common.exception.UtilException; |
| 4 | 5 | ||
| 5 | import java.security.MessageDigest; | 6 | import java.security.MessageDigest; |
| @@ -15,6 +16,7 @@ import java.util.concurrent.ThreadLocalRandom; | @@ -15,6 +16,7 @@ import java.util.concurrent.ThreadLocalRandom; | ||
| 15 | */ | 16 | */ |
| 16 | public final class UUID implements java.io.Serializable, Comparable<UUID> | 17 | public final class UUID implements java.io.Serializable, Comparable<UUID> |
| 17 | { | 18 | { |
| 19 | + @PublicSQLConfig(isSelect=false) | ||
| 18 | private static final long serialVersionUID = -1185015143654744140L; | 20 | private static final long serialVersionUID = -1185015143654744140L; |
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| @@ -24,12 +24,9 @@ | @@ -24,12 +24,9 @@ | ||
| 24 | <groupId>com.github.oshi</groupId> | 24 | <groupId>com.github.oshi</groupId> |
| 25 | <artifactId>oshi-core</artifactId> | 25 | <artifactId>oshi-core</artifactId> |
| 26 | </dependency> | 26 | </dependency> |
| 27 | - | ||
| 28 | - <!-- 系统模块--> | ||
| 29 | <dependency> | 27 | <dependency> |
| 30 | <groupId>com.zhonglai.luhui</groupId> | 28 | <groupId>com.zhonglai.luhui</groupId> |
| 31 | - <artifactId>ruoyi-system</artifactId> | 29 | + <artifactId>ruoyi-common</artifactId> |
| 32 | </dependency> | 30 | </dependency> |
| 33 | - | ||
| 34 | </dependencies> | 31 | </dependencies> |
| 35 | </project> | 32 | </project> |
| @@ -332,7 +332,10 @@ public class GenTableServiceImpl implements IGenTableService | @@ -332,7 +332,10 @@ public class GenTableServiceImpl implements IGenTableService | ||
| 332 | genTable.setFunctionAuthor("钟来"); | 332 | genTable.setFunctionAuthor("钟来"); |
| 333 | genTable.setGenType("1"); | 333 | genTable.setGenType("1"); |
| 334 | genTable.setGenPath("/"); | 334 | genTable.setGenPath("/"); |
| 335 | - genTable.setDataSource("DataSourceType."+dataSource); | 335 | + if(StringUtils.isNotEmpty(dataSource)) |
| 336 | + { | ||
| 337 | + genTable.setDataSource("DataSourceType."+dataSource); | ||
| 338 | + } | ||
| 336 | List<GenTableColumn> columns = new ArrayList<>(); | 339 | List<GenTableColumn> columns = new ArrayList<>(); |
| 337 | for(Map<String,Object> table:list) | 340 | for(Map<String,Object> table:list) |
| 338 | { | 341 | { |
| @@ -364,7 +367,7 @@ public class GenTableServiceImpl implements IGenTableService | @@ -364,7 +367,7 @@ public class GenTableServiceImpl implements IGenTableService | ||
| 364 | switch (tableVules.getDataType()) | 367 | switch (tableVules.getDataType()) |
| 365 | { | 368 | { |
| 366 | case "int": | 369 | case "int": |
| 367 | - if(genTableColumn.getColumnName().equals("create_time")) | 370 | + if(genTableColumn.getColumnName().indexOf("_time")>=0 ) |
| 368 | { | 371 | { |
| 369 | genTableColumn.setQueryType("BETWEEN"); | 372 | genTableColumn.setQueryType("BETWEEN"); |
| 370 | }else{ | 373 | }else{ |
| @@ -2,21 +2,22 @@ | @@ -2,21 +2,22 @@ | ||
| 2 | <project xmlns="http://maven.apache.org/POM/4.0.0" | 2 | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 5 | + <modelVersion>4.0.0</modelVersion> | ||
| 5 | <parent> | 6 | <parent> |
| 6 | - <artifactId>lh-common</artifactId> | ||
| 7 | <groupId>com.zhonglai.luhui</groupId> | 7 | <groupId>com.zhonglai.luhui</groupId> |
| 8 | + <artifactId>lh-jar</artifactId> | ||
| 8 | <version>1.0-SNAPSHOT</version> | 9 | <version>1.0-SNAPSHOT</version> |
| 9 | </parent> | 10 | </parent> |
| 10 | - <modelVersion>4.0.0</modelVersion> | ||
| 11 | 11 | ||
| 12 | - <artifactId>ruoyi-system</artifactId> | 12 | + <artifactId>lh-jar-device-service</artifactId> |
| 13 | 13 | ||
| 14 | - <description> | ||
| 15 | - system系统模块 | ||
| 16 | - </description> | 14 | + <properties> |
| 15 | + <maven.compiler.source>8</maven.compiler.source> | ||
| 16 | + <maven.compiler.target>8</maven.compiler.target> | ||
| 17 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 18 | + </properties> | ||
| 17 | 19 | ||
| 18 | <dependencies> | 20 | <dependencies> |
| 19 | - | ||
| 20 | <!-- 通用工具--> | 21 | <!-- 通用工具--> |
| 21 | <dependency> | 22 | <dependency> |
| 22 | <groupId>com.zhonglai.luhui</groupId> | 23 | <groupId>com.zhonglai.luhui</groupId> |
| @@ -75,6 +76,7 @@ | @@ -75,6 +76,7 @@ | ||
| 75 | <groupId>com.zhonglai.luhui</groupId> | 76 | <groupId>com.zhonglai.luhui</groupId> |
| 76 | <artifactId>lh-jar-rocketmq</artifactId> | 77 | <artifactId>lh-jar-rocketmq</artifactId> |
| 77 | </dependency> | 78 | </dependency> |
| 79 | + | ||
| 78 | </dependencies> | 80 | </dependencies> |
| 79 | 81 | ||
| 80 | </project> | 82 | </project> |
| 1 | -package com.ruoyi.system.domain.iot; | 1 | +package com.zhonglai.luhui.device.domain; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 3 | import com.ruoyi.common.tool.BaseEntity; | 4 | import com.ruoyi.common.tool.BaseEntity; |
| 4 | import org.apache.commons.lang3.builder.ToStringBuilder; | 5 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 5 | import org.apache.commons.lang3.builder.ToStringStyle; | 6 | import org.apache.commons.lang3.builder.ToStringStyle; |
| @@ -12,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; | @@ -12,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; | ||
| 12 | */ | 13 | */ |
| 13 | public class IotAlert extends BaseEntity | 14 | public class IotAlert extends BaseEntity |
| 14 | { | 15 | { |
| 16 | + @PublicSQLConfig(isSelect=false) | ||
| 15 | private static final long serialVersionUID = 1L; | 17 | private static final long serialVersionUID = 1L; |
| 16 | 18 | ||
| 17 | /** 告警ID */ | 19 | /** 告警ID */ |
| 1 | -package com.ruoyi.system.domain.iot; | 1 | +package com.zhonglai.luhui.device.domain; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 3 | import com.ruoyi.common.tool.BaseEntity; | 4 | import com.ruoyi.common.tool.BaseEntity; |
| 4 | import org.apache.commons.lang3.builder.ToStringBuilder; | 5 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 5 | import org.apache.commons.lang3.builder.ToStringStyle; | 6 | import org.apache.commons.lang3.builder.ToStringStyle; |
| @@ -12,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; | @@ -12,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; | ||
| 12 | */ | 13 | */ |
| 13 | public class IotAlertLog extends BaseEntity | 14 | public class IotAlertLog extends BaseEntity |
| 14 | { | 15 | { |
| 16 | + @PublicSQLConfig(isSelect=false) | ||
| 15 | private static final long serialVersionUID = 1L; | 17 | private static final long serialVersionUID = 1L; |
| 16 | 18 | ||
| 17 | /** 告警ID */ | 19 | /** 告警ID */ |
| 1 | -package com.ruoyi.system.domain.iot; | 1 | +package com.zhonglai.luhui.device.domain; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.PublicSQLConfig; | 3 | import com.ruoyi.common.annotation.PublicSQLConfig; |
| 4 | import org.apache.commons.lang3.builder.ToStringBuilder; | 4 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 1 | -package com.ruoyi.system.domain.iot; | 1 | +package com.zhonglai.luhui.device.domain; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.PublicSQLConfig; | 3 | import com.ruoyi.common.annotation.PublicSQLConfig; |
| 4 | import org.apache.commons.lang3.builder.ToStringBuilder; | 4 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 1 | -package com.ruoyi.system.domain.iot; | 1 | +package com.zhonglai.luhui.device.domain; |
| 2 | 2 | ||
| 3 | import com.ruoyi.system.domain.user.UserTerminalGroupRelation; | 3 | import com.ruoyi.system.domain.user.UserTerminalGroupRelation; |
| 4 | import com.ruoyi.common.annotation.PublicSQLConfig; | 4 | import com.ruoyi.common.annotation.PublicSQLConfig; |
| 1 | -package com.ruoyi.system.domain.iot; | 1 | +package com.zhonglai.luhui.device.domain; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.PublicSQLConfig; | 3 | import com.ruoyi.common.annotation.PublicSQLConfig; |
| 4 | import org.apache.commons.lang3.builder.ToStringBuilder; | 4 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 1 | -package com.ruoyi.system.mapper; | 1 | +package com.zhonglai.luhui.device.mapper; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.system.domain.iot.IotAlertLog; | 3 | +import com.zhonglai.luhui.device.domain.IotAlertLog; |
| 4 | import org.springframework.stereotype.Repository; | 4 | import org.springframework.stereotype.Repository; |
| 5 | 5 | ||
| 6 | import java.util.List; | 6 | import java.util.List; |
| 1 | -package com.ruoyi.system.mapper; | 1 | +package com.zhonglai.luhui.device.mapper; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.system.domain.iot.IotAlert; | 3 | +import com.zhonglai.luhui.device.domain.IotAlert; |
| 4 | import org.springframework.stereotype.Repository; | 4 | import org.springframework.stereotype.Repository; |
| 5 | 5 | ||
| 6 | import java.util.List; | 6 | import java.util.List; |
| 1 | -package com.ruoyi.system.mapper; | 1 | +package com.zhonglai.luhui.device.mapper; |
| 2 | + | ||
| 3 | +import com.zhonglai.luhui.device.domain.IotProductTranslate; | ||
| 2 | 4 | ||
| 3 | import java.util.List; | 5 | import java.util.List; |
| 4 | -import com.ruoyi.system.domain.iot.IotProductTranslate; | ||
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 产品指标翻译Mapper接口 | 8 | * 产品指标翻译Mapper接口 |
| 1 | -package com.ruoyi.system.mapper; | 1 | +package com.zhonglai.luhui.device.mapper; |
| 2 | + | ||
| 3 | +import com.zhonglai.luhui.device.domain.DistributionCurrencyModel; | ||
| 4 | +import com.zhonglai.luhui.device.domain.IotThingsModel; | ||
| 2 | 5 | ||
| 3 | import java.util.List; | 6 | import java.util.List; |
| 4 | 7 | ||
| 5 | -import com.ruoyi.system.domain.DistributionCurrencyModel; | ||
| 6 | -import com.ruoyi.system.domain.iot.IotThingsModel; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * nullMapper接口 | 10 | * nullMapper接口 |
| 1 | -package com.ruoyi.system.mapper; | 1 | +package com.zhonglai.luhui.device.mapper; |
| 2 | + | ||
| 3 | +import com.zhonglai.luhui.device.domain.IotThingsModelTemplate; | ||
| 2 | 4 | ||
| 3 | import java.util.List; | 5 | import java.util.List; |
| 4 | -import com.ruoyi.system.domain.iot.IotThingsModelTemplate; | ||
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 物模型模板Mapper接口 | 8 | * 物模型模板Mapper接口 |
| 1 | -package com.ruoyi.system.service; | 1 | +package com.zhonglai.luhui.device.service; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.ruoyi.common.core.domain.Message; | 4 | import com.ruoyi.common.core.domain.Message; |
| 5 | import com.ruoyi.common.core.domain.MessageCode; | 5 | import com.ruoyi.common.core.domain.MessageCode; |
| 6 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 7 | -import com.ruoyi.system.domain.iot.IotDevice; | ||
| 8 | import com.ruoyi.common.core.domain.ApiName; | 7 | import com.ruoyi.common.core.domain.ApiName; |
| 9 | import com.ruoyi.common.core.domain.DeviceCommandApi; | 8 | import com.ruoyi.common.core.domain.DeviceCommandApi; |
| 10 | import com.ruoyi.common.core.domain.DeviceCommandApiParameter; | 9 | import com.ruoyi.common.core.domain.DeviceCommandApiParameter; |
| 11 | -import com.ruoyi.system.service.iot.IIotDeviceService; | 10 | +import com.zhonglai.luhui.device.domain.IotDevice; |
| 12 | import com.zhonglai.luhui.rocketmq.service.RocketMqService; | 11 | import com.zhonglai.luhui.rocketmq.service.RocketMqService; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| 1 | -package com.ruoyi.system.service.iot; | 1 | +package com.zhonglai.luhui.device.service; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | -import com.ruoyi.system.domain.iot.IotPermission; | 4 | +import com.zhonglai.luhui.device.domain.IotPermission; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | * nullService接口 | 7 | * nullService接口 |
| 1 | -package com.ruoyi.system.service.iot; | 1 | +package com.zhonglai.luhui.device.service; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | -import com.ruoyi.system.domain.iot.IotProductTranslate; | 4 | +import com.zhonglai.luhui.device.domain.IotProductTranslate; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | * 产品指标翻译Service接口 | 7 | * 产品指标翻译Service接口 |
| 1 | -package com.ruoyi.system.service.iot; | 1 | +package com.zhonglai.luhui.device.service; |
| 2 | + | ||
| 3 | +import com.zhonglai.luhui.device.domain.IotTerminal; | ||
| 2 | 4 | ||
| 3 | import java.util.List; | 5 | import java.util.List; |
| 4 | 6 | ||
| 5 | -import com.ruoyi.system.domain.iot.IotTerminal; | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * nullService接口 | 9 | * nullService接口 |
| 1 | -package com.ruoyi.system.service.iot; | 1 | +package com.zhonglai.luhui.device.service; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | 4 | ||
| 5 | -import com.ruoyi.system.domain.DistributionCurrencyModel; | ||
| 6 | -import com.ruoyi.system.domain.iot.IotThingsModel; | 5 | +import com.zhonglai.luhui.device.domain.DistributionCurrencyModel; |
| 6 | +import com.zhonglai.luhui.device.domain.IotThingsModel; | ||
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * nullService接口 | 9 | * nullService接口 |
| 1 | -package com.ruoyi.system.service.iot; | 1 | +package com.zhonglai.luhui.device.service; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | 4 | ||
| 5 | -import com.ruoyi.system.domain.iot.IotThingsModelTemplate; | 5 | +import com.zhonglai.luhui.device.domain.IotThingsModelTemplate; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| 8 | * 物模型模板Service接口 | 8 | * 物模型模板Service接口 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.utils.DateUtils; | 3 | import com.ruoyi.common.utils.DateUtils; |
| 4 | -import com.ruoyi.system.domain.iot.IotAlertLog; | ||
| 5 | -import com.ruoyi.system.mapper.IotAlertLogMapper; | ||
| 6 | -import com.ruoyi.system.service.iot.IIotAlertLogService; | 4 | +import com.zhonglai.luhui.device.domain.IotAlertLog; |
| 5 | +import com.zhonglai.luhui.device.mapper.IotAlertLogMapper; | ||
| 6 | +import com.zhonglai.luhui.device.service.IIotAlertLogService; | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 9 | 9 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.utils.DateUtils; | 3 | import com.ruoyi.common.utils.DateUtils; |
| 4 | -import com.ruoyi.system.domain.iot.IotAlert; | ||
| 5 | -import com.ruoyi.system.mapper.IotAlertMapper; | ||
| 6 | -import com.ruoyi.system.service.iot.IIotAlertService; | 4 | +import com.zhonglai.luhui.device.domain.IotAlert; |
| 5 | +import com.zhonglai.luhui.device.mapper.IotAlertMapper; | ||
| 6 | +import com.zhonglai.luhui.device.service.IIotAlertService; | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 9 | 9 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.HashMap; | 3 | import java.util.HashMap; |
| 4 | import java.util.List; | 4 | import java.util.List; |
| @@ -8,17 +8,17 @@ import com.alibaba.fastjson.JSONObject; | @@ -8,17 +8,17 @@ import com.alibaba.fastjson.JSONObject; | ||
| 8 | import com.ruoyi.common.core.domain.Message; | 8 | import com.ruoyi.common.core.domain.Message; |
| 9 | import com.ruoyi.common.exception.ServiceException; | 9 | import com.ruoyi.common.exception.ServiceException; |
| 10 | import com.ruoyi.common.utils.DateUtils; | 10 | import com.ruoyi.common.utils.DateUtils; |
| 11 | -import com.ruoyi.system.domain.iot.IotProduct; | 11 | +import com.zhonglai.luhui.device.domain.IotProduct; |
| 12 | import com.ruoyi.common.core.domain.ApiName; | 12 | import com.ruoyi.common.core.domain.ApiName; |
| 13 | import com.ruoyi.common.core.domain.DeviceCommandApi; | 13 | import com.ruoyi.common.core.domain.DeviceCommandApi; |
| 14 | import com.ruoyi.common.core.domain.DeviceCommandApiParameter; | 14 | import com.ruoyi.common.core.domain.DeviceCommandApiParameter; |
| 15 | -import com.ruoyi.system.service.iot.IIotProductService; | 15 | +import com.zhonglai.luhui.device.service.IIotProductService; |
| 16 | import com.zhonglai.luhui.rocketmq.service.RocketMqService; | 16 | import com.zhonglai.luhui.rocketmq.service.RocketMqService; |
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | import org.springframework.stereotype.Service; | 18 | import org.springframework.stereotype.Service; |
| 19 | -import com.ruoyi.system.mapper.IotDeviceMapper; | ||
| 20 | -import com.ruoyi.system.domain.iot.IotDevice; | ||
| 21 | -import com.ruoyi.system.service.iot.IIotDeviceService; | 19 | +import com.zhonglai.luhui.device.mapper.IotDeviceMapper; |
| 20 | +import com.zhonglai.luhui.device.domain.IotDevice; | ||
| 21 | +import com.zhonglai.luhui.device.service.IIotDeviceService; | ||
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * nullService业务层处理 | 24 | * nullService业务层处理 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 4 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 5 | import org.springframework.stereotype.Service; |
| 6 | -import com.ruoyi.system.mapper.IotPermissionMapper; | ||
| 7 | -import com.ruoyi.system.domain.iot.IotPermission; | ||
| 8 | -import com.ruoyi.system.service.iot.IIotPermissionService; | 6 | +import com.zhonglai.luhui.device.mapper.IotPermissionMapper; |
| 7 | +import com.zhonglai.luhui.device.domain.IotPermission; | ||
| 8 | +import com.zhonglai.luhui.device.service.IIotPermissionService; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * nullService业务层处理 | 11 | * nullService业务层处理 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 4 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 5 | import org.springframework.stereotype.Service; |
| 6 | -import com.ruoyi.system.mapper.IotProductMapper; | ||
| 7 | -import com.ruoyi.system.domain.iot.IotProduct; | ||
| 8 | -import com.ruoyi.system.service.iot.IIotProductService; | 6 | +import com.zhonglai.luhui.device.mapper.IotProductMapper; |
| 7 | +import com.zhonglai.luhui.device.domain.IotProduct; | ||
| 8 | +import com.zhonglai.luhui.device.service.IIotProductService; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * nullService业务层处理 | 11 | * nullService业务层处理 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | 4 | ||
| 5 | import com.zhonglai.luhui.redis.service.RedisCache; | 5 | import com.zhonglai.luhui.redis.service.RedisCache; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
| 8 | -import com.ruoyi.system.mapper.IotProductTranslateMapper; | ||
| 9 | -import com.ruoyi.system.domain.iot.IotProductTranslate; | ||
| 10 | -import com.ruoyi.system.service.iot.IIotProductTranslateService; | 8 | +import com.zhonglai.luhui.device.mapper.IotProductTranslateMapper; |
| 9 | +import com.zhonglai.luhui.device.domain.IotProductTranslate; | ||
| 10 | +import com.zhonglai.luhui.device.service.IIotProductTranslateService; | ||
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 产品指标翻译Service业务层处理 | 13 | * 产品指标翻译Service业务层处理 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 5 | +import com.zhonglai.luhui.device.domain.IotRole; | ||
| 6 | +import com.zhonglai.luhui.device.mapper.IotRoleMapper; | ||
| 7 | +import com.zhonglai.luhui.device.service.IIotRoleService; | ||
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 6 | -import com.ruoyi.system.mapper.IotRoleMapper; | ||
| 7 | -import com.ruoyi.system.domain.iot.IotRole; | ||
| 8 | -import com.ruoyi.system.service.iot.IIotRoleService; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * nullService业务层处理 | 12 | * nullService业务层处理 |
| @@ -14,7 +15,7 @@ import com.ruoyi.system.service.iot.IIotRoleService; | @@ -14,7 +15,7 @@ import com.ruoyi.system.service.iot.IIotRoleService; | ||
| 14 | * @date 2022-08-26 | 15 | * @date 2022-08-26 |
| 15 | */ | 16 | */ |
| 16 | @Service | 17 | @Service |
| 17 | -public class IotRoleServiceImpl implements IIotRoleService | 18 | +public class IotRoleServiceImpl implements IIotRoleService |
| 18 | { | 19 | { |
| 19 | @Autowired | 20 | @Autowired |
| 20 | private IotRoleMapper iotRoleMapper; | 21 | private IotRoleMapper iotRoleMapper; |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.HashMap; | 3 | import java.util.HashMap; |
| 4 | import java.util.List; | 4 | import java.util.List; |
| @@ -9,13 +9,13 @@ import com.ruoyi.common.core.domain.Message; | @@ -9,13 +9,13 @@ import com.ruoyi.common.core.domain.Message; | ||
| 9 | import com.ruoyi.common.core.domain.ApiName; | 9 | import com.ruoyi.common.core.domain.ApiName; |
| 10 | import com.ruoyi.common.core.domain.DeviceCommandApi; | 10 | import com.ruoyi.common.core.domain.DeviceCommandApi; |
| 11 | import com.ruoyi.common.core.domain.DeviceCommandApiParameter; | 11 | import com.ruoyi.common.core.domain.DeviceCommandApiParameter; |
| 12 | -import com.ruoyi.system.service.iot.IIotDeviceService; | 12 | +import com.zhonglai.luhui.device.service.IIotDeviceService; |
| 13 | import com.zhonglai.luhui.rocketmq.service.RocketMqService; | 13 | import com.zhonglai.luhui.rocketmq.service.RocketMqService; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
| 16 | -import com.ruoyi.system.mapper.IotTerminalMapper; | ||
| 17 | -import com.ruoyi.system.domain.iot.IotTerminal; | ||
| 18 | -import com.ruoyi.system.service.iot.IIotTerminalService; | 16 | +import com.zhonglai.luhui.device.mapper.IotTerminalMapper; |
| 17 | +import com.zhonglai.luhui.device.domain.IotTerminal; | ||
| 18 | +import com.zhonglai.luhui.device.service.IIotTerminalService; | ||
| 19 | 19 | ||
| 20 | /** | 20 | /** |
| 21 | * nullService业务层处理 | 21 | * nullService业务层处理 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | 4 | ||
| 5 | -import com.ruoyi.system.domain.DistributionCurrencyModel; | 5 | +import com.zhonglai.luhui.device.domain.DistributionCurrencyModel; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
| 8 | -import com.ruoyi.system.mapper.IotThingsModelMapper; | ||
| 9 | -import com.ruoyi.system.domain.iot.IotThingsModel; | ||
| 10 | -import com.ruoyi.system.service.iot.IIotThingsModelService; | 8 | +import com.zhonglai.luhui.device.mapper.IotThingsModelMapper; |
| 9 | +import com.zhonglai.luhui.device.domain.IotThingsModel; | ||
| 10 | +import com.zhonglai.luhui.device.service.IIotThingsModelService; | ||
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * nullService业务层处理 | 13 | * nullService业务层处理 |
| 1 | -package com.ruoyi.system.service.impl.iot; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 4 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 5 | import org.springframework.stereotype.Service; |
| 6 | -import com.ruoyi.system.mapper.IotThingsModelTemplateMapper; | ||
| 7 | -import com.ruoyi.system.domain.iot.IotThingsModelTemplate; | ||
| 8 | -import com.ruoyi.system.service.iot.IIotThingsModelTemplateService; | 6 | +import com.zhonglai.luhui.device.mapper.IotThingsModelTemplateMapper; |
| 7 | +import com.zhonglai.luhui.device.domain.IotThingsModelTemplate; | ||
| 8 | +import com.zhonglai.luhui.device.service.IIotThingsModelTemplateService; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 物模型模板Service业务层处理 | 11 | * 物模型模板Service业务层处理 |
| 1 | -package com.ruoyi.system.service.impl.user; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
| 4 | import java.util.List; | 4 | import java.util.List; |
| 5 | 5 | ||
| 6 | import com.ruoyi.common.utils.DateUtils; | 6 | import com.ruoyi.common.utils.DateUtils; |
| 7 | import com.ruoyi.system.domain.user.UserTerminalGroup; | 7 | import com.ruoyi.system.domain.user.UserTerminalGroup; |
| 8 | -import com.ruoyi.system.service.user.IUserTerminalGroupService; | ||
| 9 | import com.zhonglai.luhui.dao.service.PublicService; | 8 | import com.zhonglai.luhui.dao.service.PublicService; |
| 9 | +import com.zhonglai.luhui.device.mapper.UserTerminalGroupRelationMapper; | ||
| 10 | +import com.zhonglai.luhui.device.service.IUserTerminalGroupRelationService; | ||
| 11 | +import com.zhonglai.luhui.device.service.IUserTerminalGroupService; | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| 12 | -import com.ruoyi.system.mapper.UserTerminalGroupRelationMapper; | ||
| 13 | import com.ruoyi.system.domain.user.UserTerminalGroupRelation; | 14 | import com.ruoyi.system.domain.user.UserTerminalGroupRelation; |
| 14 | -import com.ruoyi.system.service.user.IUserTerminalGroupRelationService; | ||
| 15 | import org.springframework.transaction.annotation.Transactional; | 15 | import org.springframework.transaction.annotation.Transactional; |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 1 | -package com.ruoyi.system.service.impl.user; | 1 | +package com.zhonglai.luhui.device.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 5 | +import com.zhonglai.luhui.device.mapper.UserTerminalGroupMapper; | ||
| 6 | +import com.zhonglai.luhui.device.service.IUserTerminalGroupService; | ||
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 6 | -import com.ruoyi.system.mapper.UserTerminalGroupMapper; | ||
| 7 | import com.ruoyi.system.domain.user.UserTerminalGroup; | 9 | import com.ruoyi.system.domain.user.UserTerminalGroup; |
| 8 | -import com.ruoyi.system.service.user.IUserTerminalGroupService; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 终端分组Service业务层处理 | 12 | * 终端分组Service业务层处理 |
| @@ -14,7 +15,7 @@ import com.ruoyi.system.service.user.IUserTerminalGroupService; | @@ -14,7 +15,7 @@ import com.ruoyi.system.service.user.IUserTerminalGroupService; | ||
| 14 | * @date 2022-11-22 | 15 | * @date 2022-11-22 |
| 15 | */ | 16 | */ |
| 16 | @Service | 17 | @Service |
| 17 | -public class UserTerminalGroupServiceImpl implements IUserTerminalGroupService | 18 | +public class UserTerminalGroupServiceImpl implements IUserTerminalGroupService |
| 18 | { | 19 | { |
| 19 | @Autowired | 20 | @Autowired |
| 20 | private UserTerminalGroupMapper userTerminalGroupMapper; | 21 | private UserTerminalGroupMapper userTerminalGroupMapper; |
| @@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotAlertLogMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotAlertLogMapper"> |
| 6 | 6 | ||
| 7 | - <resultMap type="com.ruoyi.system.domain.iot.IotAlertLog" id="AlertLogResult"> | 7 | + <resultMap type="com.zhonglai.luhui.device.domain.IotAlertLog" id="AlertLogResult"> |
| 8 | <result property="alertLogId" column="alert_log__id" /> | 8 | <result property="alertLogId" column="alert_log__id" /> |
| 9 | <result property="alertName" column="alert_name" /> | 9 | <result property="alertName" column="alert_name" /> |
| 10 | <result property="alertLevel" column="alert_level" /> | 10 | <result property="alertLevel" column="alert_level" /> |
| @@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 28 | select alert_log__id, alert_name, alert_level, status, product_id, product_name, device_id, device_name,user_id, user_name, tenant_id, tenant_name, create_by, create_time, update_by, update_time, remark from iot_alert_log | 28 | select alert_log__id, alert_name, alert_level, status, product_id, product_name, device_id, device_name,user_id, user_name, tenant_id, tenant_name, create_by, create_time, update_by, update_time, remark from iot_alert_log |
| 29 | </sql> | 29 | </sql> |
| 30 | 30 | ||
| 31 | - <select id="selectAlertLogList" parameterType="com.ruoyi.system.domain.iot.IotAlertLog" resultMap="AlertLogResult"> | 31 | + <select id="selectAlertLogList" parameterType="com.zhonglai.luhui.device.domain.IotAlertLog" resultMap="AlertLogResult"> |
| 32 | <include refid="selectAlertLogVo"/> | 32 | <include refid="selectAlertLogVo"/> |
| 33 | <where> | 33 | <where> |
| 34 | <if test="userId != null and userId != 0"> and user_id = #{userId}</if> | 34 | <if test="userId != null and userId != 0"> and user_id = #{userId}</if> |
| @@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 48 | where alert_log__id = #{alertLogId} | 48 | where alert_log__id = #{alertLogId} |
| 49 | </select> | 49 | </select> |
| 50 | 50 | ||
| 51 | - <insert id="insertAlertLog" parameterType="com.ruoyi.system.domain.iot.IotAlertLog" useGeneratedKeys="true" keyProperty="alertLogId"> | 51 | + <insert id="insertAlertLog" parameterType="com.zhonglai.luhui.device.domain.IotAlertLog" useGeneratedKeys="true" keyProperty="alertLogId"> |
| 52 | insert into iot_alert_log | 52 | insert into iot_alert_log |
| 53 | <trim prefix="(" suffix=")" suffixOverrides=","> | 53 | <trim prefix="(" suffix=")" suffixOverrides=","> |
| 54 | <if test="alertName != null and alertName != ''">alert_name,</if> | 54 | <if test="alertName != null and alertName != ''">alert_name,</if> |
| @@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 88 | </trim> | 88 | </trim> |
| 89 | </insert> | 89 | </insert> |
| 90 | 90 | ||
| 91 | - <update id="updateAlertLog" parameterType="com.ruoyi.system.domain.iot.IotAlertLog"> | 91 | + <update id="updateAlertLog" parameterType="com.zhonglai.luhui.device.domain.IotAlertLog"> |
| 92 | update iot_alert_log | 92 | update iot_alert_log |
| 93 | <trim prefix="SET" suffixOverrides=","> | 93 | <trim prefix="SET" suffixOverrides=","> |
| 94 | <if test="alertName != null and alertName != ''">alert_name = #{alertName},</if> | 94 | <if test="alertName != null and alertName != ''">alert_name = #{alertName},</if> |
| @@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotAlertMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotAlertMapper"> |
| 6 | 6 | ||
| 7 | - <resultMap type="com.ruoyi.system.domain.iot.IotAlert" id="AlertResult"> | 7 | + <resultMap type="com.zhonglai.luhui.device.domain.IotAlert" id="AlertResult"> |
| 8 | <result property="alertId" column="alert_id" /> | 8 | <result property="alertId" column="alert_id" /> |
| 9 | <result property="alertName" column="alert_name" /> | 9 | <result property="alertName" column="alert_name" /> |
| 10 | <result property="alertLevel" column="alert_level" /> | 10 | <result property="alertLevel" column="alert_level" /> |
| @@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 24 | select alert_id, alert_name, alert_level,status, product_id, product_name, triggers, actions, create_by, create_time, update_by, update_time, remark from iot_alert | 24 | select alert_id, alert_name, alert_level,status, product_id, product_name, triggers, actions, create_by, create_time, update_by, update_time, remark from iot_alert |
| 25 | </sql> | 25 | </sql> |
| 26 | 26 | ||
| 27 | - <select id="selectAlertList" parameterType="com.ruoyi.system.domain.iot.IotAlert" resultMap="AlertResult"> | 27 | + <select id="selectAlertList" parameterType="com.zhonglai.luhui.device.domain.IotAlert" resultMap="AlertResult"> |
| 28 | <include refid="selectAlertVo"/> | 28 | <include refid="selectAlertVo"/> |
| 29 | <where> | 29 | <where> |
| 30 | <if test="alertName != null and alertName != ''"> and alert_name like concat('%', #{alertName}, '%')</if> | 30 | <if test="alertName != null and alertName != ''"> and alert_name like concat('%', #{alertName}, '%')</if> |
| @@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 40 | where alert_id = #{alertId} | 40 | where alert_id = #{alertId} |
| 41 | </select> | 41 | </select> |
| 42 | 42 | ||
| 43 | - <insert id="insertAlert" parameterType="com.ruoyi.system.domain.iot.IotAlert" useGeneratedKeys="true" keyProperty="alertId"> | 43 | + <insert id="insertAlert" parameterType="com.zhonglai.luhui.device.domain.IotAlert" useGeneratedKeys="true" keyProperty="alertId"> |
| 44 | insert into iot_alert | 44 | insert into iot_alert |
| 45 | <trim prefix="(" suffix=")" suffixOverrides=","> | 45 | <trim prefix="(" suffix=")" suffixOverrides=","> |
| 46 | <if test="alertName != null and alertName != ''">alert_name,</if> | 46 | <if test="alertName != null and alertName != ''">alert_name,</if> |
| @@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 72 | </trim> | 72 | </trim> |
| 73 | </insert> | 73 | </insert> |
| 74 | 74 | ||
| 75 | - <update id="updateAlert" parameterType="com.ruoyi.system.domain.iot.IotAlert"> | 75 | + <update id="updateAlert" parameterType="com.zhonglai.luhui.device.domain.IotAlert"> |
| 76 | update iot_alert | 76 | update iot_alert |
| 77 | <trim prefix="SET" suffixOverrides=","> | 77 | <trim prefix="SET" suffixOverrides=","> |
| 78 | <if test="alertName != null and alertName != ''">alert_name = #{alertName},</if> | 78 | <if test="alertName != null and alertName != ''">alert_name = #{alertName},</if> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotDeviceMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotDeviceMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotDevice" id="IotDeviceResult"> | 7 | <resultMap type="IotDevice" id="IotDeviceResult"> |
| 8 | <result property="active_time" column="active_time" /> | 8 | <result property="active_time" column="active_time" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotPermissionMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotPermissionMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotPermission" id="IotPermissionResult"> | 7 | <resultMap type="IotPermission" id="IotPermissionResult"> |
| 8 | <result property="activity" column="activity" /> | 8 | <result property="activity" column="activity" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotProductMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotProductMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotProduct" id="IotProductResult"> | 7 | <resultMap type="IotProduct" id="IotProductResult"> |
| 8 | <result property="create_time" column="create_time" /> | 8 | <result property="create_time" column="create_time" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotProductTranslateMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotProductTranslateMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotProductTranslate" id="IotProductTranslateResult"> | 7 | <resultMap type="IotProductTranslate" id="IotProductTranslateResult"> |
| 8 | <result property="create_time" column="create_time" /> | 8 | <result property="create_time" column="create_time" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotRoleMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotRoleMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotRole" id="IotRoleResult"> | 7 | <resultMap type="IotRole" id="IotRoleResult"> |
| 8 | <result property="create_time" column="create_time" /> | 8 | <result property="create_time" column="create_time" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotTerminalMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotTerminalMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotTerminal" id="IotTerminalResult"> | 7 | <resultMap type="IotTerminal" id="IotTerminalResult"> |
| 8 | <result property="device_id" column="device_id" /> | 8 | <result property="device_id" column="device_id" /> |
| @@ -14,6 +14,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -14,6 +14,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 14 | <result property="product_id" column="product_id" /> | 14 | <result property="product_id" column="product_id" /> |
| 15 | <result property="mqtt_username" column="mqtt_username" /> | 15 | <result property="mqtt_username" column="mqtt_username" /> |
| 16 | <result property="data_update_time" column="data_update_time" /> | 16 | <result property="data_update_time" column="data_update_time" /> |
| 17 | + <result property="online" column="online" /> | ||
| 18 | + <result property="user_info_id" column="user_info_id" /> | ||
| 19 | + <result property="create_time" column="create_time" /> | ||
| 20 | + <result property="sensor_number" column="sensor_number" /> | ||
| 17 | <association property="userTerminalGroupRelation" column="id" javaType="UserTerminalGroupRelation" resultMap="userTerminalGroupRelationResult" /> | 21 | <association property="userTerminalGroupRelation" column="id" javaType="UserTerminalGroupRelation" resultMap="userTerminalGroupRelationResult" /> |
| 18 | <association property="iotDevice" column="device_id" javaType="IotDevice" resultMap="iotDeviceResult" /> | 22 | <association property="iotDevice" column="device_id" javaType="IotDevice" resultMap="iotDeviceResult" /> |
| 19 | </resultMap> | 23 | </resultMap> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotThingsModelMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotThingsModelMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotThingsModel" id="IotThingsModelResult"> | 7 | <resultMap type="IotThingsModel" id="IotThingsModelResult"> |
| 8 | <result property="create_by" column="create_by" /> | 8 | <result property="create_by" column="create_by" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.IotThingsModelTemplateMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.IotThingsModelTemplateMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="IotThingsModelTemplate" id="IotThingsModelTemplateResult"> | 7 | <resultMap type="IotThingsModelTemplate" id="IotThingsModelTemplateResult"> |
| 8 | <result property="ascription" column="ascription" /> | 8 | <result property="ascription" column="ascription" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.UserTerminalGroupMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.UserTerminalGroupMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="UserTerminalGroup" id="UserTerminalGroupResult"> | 7 | <resultMap type="UserTerminalGroup" id="UserTerminalGroupResult"> |
| 8 | <result property="create_time" column="create_time" /> | 8 | <result property="create_time" column="create_time" /> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <!DOCTYPE mapper | 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.UserTerminalGroupRelationMapper"> | 5 | +<mapper namespace="com.zhonglai.luhui.device.mapper.UserTerminalGroupRelationMapper"> |
| 6 | 6 | ||
| 7 | <resultMap type="UserTerminalGroupRelation" id="UserTerminalGroupRelationResult"> | 7 | <resultMap type="UserTerminalGroupRelation" id="UserTerminalGroupRelationResult"> |
| 8 | <result property="create_time" column="create_time" /> | 8 | <result property="create_time" column="create_time" /> |
-
请 注册 或 登录 后发表评论