Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
T
topology
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
姜立玮
topology
Commits
a7db4af2
提交
a7db4af2
authored
7月 09, 2021
作者:
jianglw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改部分功能
上级
e33b846a
变更
12
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
134 行增加
和
11 行删除
+134
-11
pom.xml
pom.xml
+1
-0
SysLoginController.java
...a/com/ruoyi/web/controller/system/SysLoginController.java
+9
-0
IndexController.java
...va/com/ruoyi/web/controller/topology/IndexController.java
+20
-6
application-druid.yml
ruoyi-admin/src/main/resources/application-druid.yml
+7
-1
pom.xml
ruoyi-common/pom.xml
+6
-1
SecurityConfig.java
.../main/java/com/ruoyi/framework/config/SecurityConfig.java
+10
-3
ITopologyService.java
...ain/java/com/ruoyi/topology/service/ITopologyService.java
+1
-0
TopologyService.java
...java/com/ruoyi/topology/service/impl/TopologyService.java
+6
-0
pom.xml
topology/pom.xml
+47
-0
TopologyApplication.java
...src/main/java/com/ruoyi/topology/TopologyApplication.java
+13
-0
application.yml
topology/src/main/resources/application.yml
+1
-0
TopologyApplicationTests.java
...est/java/com/ruoyi/topology/TopologyApplicationTests.java
+13
-0
没有找到文件。
pom.xml
浏览文件 @
a7db4af2
...
...
@@ -215,6 +215,7 @@
<module>
ruoyi-generator
</module>
<module>
ruoyi-common
</module>
<module>
ruoyi-mqtt
</module>
<module>
topology
</module>
</modules>
<packaging>
pom
</packaging>
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
浏览文件 @
a7db4af2
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system;
import
java.util.List
;
import
java.util.Set
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.client.support.BasicAuthenticationInterceptor
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -18,6 +19,7 @@ import com.ruoyi.framework.web.service.SysLoginService;
import
com.ruoyi.framework.web.service.SysPermissionService
;
import
com.ruoyi.framework.web.service.TokenService
;
import
com.ruoyi.system.service.ISysMenuService
;
import
org.springframework.web.client.RestTemplate
;
/**
* 登录验证
...
...
@@ -49,6 +51,13 @@ public class SysLoginController
public
AjaxResult
login
(
@RequestBody
LoginBody
loginBody
)
{
AjaxResult
ajax
=
AjaxResult
.
success
();
RestTemplate
restTemplate
=
new
RestTemplate
();
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
append
(
"http://192.168.2.223:3000/oauth/token"
+
"?username=admin&password=123456&scope=server&grant_type=password"
);
restTemplate
.
getInterceptors
().
add
(
new
BasicAuthenticationInterceptor
(
"pig"
,
"pig"
)
);
String
o
=
restTemplate
.
getForObject
(
stringBuilder
.
toString
(),
String
.
class
);
System
.
out
.
println
(
o
);
// 生成令牌
String
token
=
loginService
.
login
(
loginBody
.
getUsername
(),
loginBody
.
getPassword
(),
loginBody
.
getCode
(),
loginBody
.
getUuid
());
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/topology/IndexController.java
浏览文件 @
a7db4af2
...
...
@@ -65,7 +65,8 @@ public class IndexController extends BaseController {
iTopologyService
.
updateTopologyById
(
topologyData
);
return
AjaxResult
.
success
();
}
@PreAuthorize
(
"@ss.hasAnyPermi('topology:index:list')"
)
@PreAuthorize
(
"@ss.hasPermi('topology:index:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
()
{
startPage
();
...
...
@@ -106,16 +107,29 @@ public class IndexController extends BaseController {
stringRedisTemplate
.
opsForValue
().
set
(
Constants
.
TOPOLOGY_DATA
+
id
,
jsonObject
.
toJSONString
()
);
return
AjaxResult
.
success
();
}
@PostMapping
(
"/test"
)
public
void
test
(
@RequestBody
String
data
)
throws
IOException
{
System
.
out
.
println
(
data
);
@GetMapping
(
"/test"
)
public
void
test
(
@RequestParam
(
value
=
"id"
)
String
id
)
throws
IOException
{
// System.out.println(data);
// JSONObject jsonObject= JSON.parseObject( "{\n" +
// " tag: 'numA', //tag节点\n" +
// " fontColor: 'red', //数据颜色\n" +
// " text: 'test', //文本内容\n" +
// " }" );
// webSocketServer.sendInfo(jsonObject.toJSONString() ,"1" );
iTopologyService
.
ces
();
System
.
out
.
println
(
"他请求成功了"
);
// iTopologyService.ces();
System
.
out
.
println
(
"他请求成功了"
+
id
);
}
//-------------------公共接口可匿名访问------------------
@GetMapping
(
"/listAll"
)
public
TableDataInfo
listAll
()
{
startPage
();
TopologyData
topologyData
=
new
TopologyData
();
List
<
TopologyData
>
list
=
iTopologyService
.
getTopologyToSwitchIt
(
topologyData
);
for
(
TopologyData
t:
list
){
t
.
setData
(
stringRedisTemplate
.
opsForValue
().
get
(
Constants
.
TOPOLOGY_DATA
+
t
.
getId
()
)
);
}
return
getDataTable
(
list
);
}
}
ruoyi-admin/src/main/resources/application-druid.yml
浏览文件 @
a7db4af2
...
...
@@ -70,4 +70,10 @@ spring:
merge-sql
:
true
wall
:
config
:
multi-statement-allow
:
true
\ No newline at end of file
multi-statement-allow
:
true
security
:
oauth2
:
client
:
client-id
:
pig
client-secret
:
pig
scope
:
server
\ No newline at end of file
ruoyi-common/pom.xml
浏览文件 @
a7db4af2
...
...
@@ -34,7 +34,12 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
<!--安全模块-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.security.oauth.boot</groupId>-->
<!-- <artifactId>spring-security-oauth2-autoconfigure</artifactId>-->
<!-- <version>2.1.2.RELEASE</version>-->
<!-- </dependency>-->
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
浏览文件 @
a7db4af2
package
com
.
ruoyi
.
framework
.
config
;
import
com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter
;
import
com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl
;
import
com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.http.HttpMethod
;
...
...
@@ -14,15 +17,13 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
;
import
org.springframework.security.web.authentication.logout.LogoutFilter
;
import
org.springframework.web.filter.CorsFilter
;
import
com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter
;
import
com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl
;
import
com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl
;
/**
* spring security配置
*
* @author ruoyi
*/
//@EnableOAuth2Sso
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
,
securedEnabled
=
true
)
public
class
SecurityConfig
extends
WebSecurityConfigurerAdapter
{
...
...
@@ -98,6 +99,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.
authorizeRequests
()
// 对于登录login 验证码captchaImage 允许匿名访问
.
antMatchers
(
"/login"
,
"/captchaImage"
).
anonymous
()
.
antMatchers
(
"/topology/listAll"
).
anonymous
()
.
antMatchers
(
"/topology/listAll"
).
permitAll
()
.
antMatchers
(
"/topology/getTopology/**"
).
anonymous
()
.
antMatchers
(
"/topology/getTopology/**"
).
permitAll
()
.
antMatchers
(
"/params/**"
).
anonymous
()
.
antMatchers
(
"/params/**"
).
permitAll
()
.
antMatchers
(
HttpMethod
.
GET
,
"/*.html"
,
...
...
ruoyi-system/src/main/java/com/ruoyi/topology/service/ITopologyService.java
浏览文件 @
a7db4af2
...
...
@@ -14,6 +14,7 @@ public interface ITopologyService {
void
saveTopologyToId
(
TopologyData
topologyData
);
List
<
TopologyData
>
getTopology
(
TopologyData
topologyData
);
List
<
TopologyData
>
getTopologyToSwitchIt
(
TopologyData
topologyData
);
TopologyData
getTopologyById
(
Integer
id
);
...
...
ruoyi-system/src/main/java/com/ruoyi/topology/service/impl/TopologyService.java
浏览文件 @
a7db4af2
...
...
@@ -33,6 +33,12 @@ public class TopologyService implements ITopologyService {
return
topologyMapper
.
getTopology
(
topologyData
);
}
@Override
public
List
<
TopologyData
>
getTopologyToSwitchIt
(
TopologyData
topologyData
)
{
topologyData
.
setSwitchIt
(
"1"
);
return
topologyMapper
.
getTopology
(
topologyData
);
}
@Override
public
TopologyData
getTopologyById
(
Integer
id
)
{
return
topologyMapper
.
getTopologyById
(
id
);
...
...
topology/pom.xml
0 → 100644
浏览文件 @
a7db4af2
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
ruoyi
</artifactId>
<groupId>
com.ruoyi
</groupId>
<version>
3.3.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<artifactId>
topology
</artifactId>
<description>
topologyWeb服务入口
</description>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.ruoyi
</groupId>
<artifactId>
ruoyi-common
</artifactId>
</dependency>
<dependency>
<groupId>
com.ruoyi
</groupId>
<artifactId>
ruoyi-quartz
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.1.1.RELEASE
</version>
</plugin>
</plugins>
</build>
</project>
topology/src/main/java/com/ruoyi/topology/TopologyApplication.java
0 → 100644
浏览文件 @
a7db4af2
package
com
.
ruoyi
.
topology
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
TopologyApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
TopologyApplication
.
class
,
args
);
}
}
topology/src/main/resources/application.yml
0 → 100644
浏览文件 @
a7db4af2
topology/src/test/java/com/ruoyi/topology/TopologyApplicationTests.java
0 → 100644
浏览文件 @
a7db4af2
package
com
.
ruoyi
.
topology
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
TopologyApplicationTests
{
@Test
void
contextLoads
()
{
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论