Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
data-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
data-server
Commits
3d115e18
Commit
3d115e18
authored
Mar 09, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
b62744e1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
455 deletions
+11
-455
wisenergy-common.iml
wisenergy-common/wisenergy-common.iml
+0
-195
wisenergy-mapper.iml
wisenergy-mapper/wisenergy-mapper.iml
+0
-196
wisenergy-parent.iml
wisenergy-parent.iml
+1
-55
Application.java
...rgy-web-admin/src/main/java/cn/wisenergy/Application.java
+2
-1
Swagger2.java
...c/main/java/cn/wisenergy/web/config/swagger/Swagger2.java
+8
-8
No files found.
wisenergy-common/wisenergy-common.iml
View file @
3d115e18
This diff is collapsed.
Click to expand it.
wisenergy-mapper/wisenergy-mapper.iml
View file @
3d115e18
This diff is collapsed.
Click to expand it.
wisenergy-parent.iml
View file @
3d115e18
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_8"
>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.commons:commons-lang3:3.8.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-lang:commons-lang:2.6"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-pool:commons-pool:1.6"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-io:commons-io:2.6"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-codec:commons-codec:1.11"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-fileupload:commons-fileupload:1.4"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.httpcomponents:httpcore:4.4.11"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: log4j:log4j:1.2.17"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.httpcomponents:httpclient:4.5.8"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"PROVIDED"
name=
"Maven: org.projectlombok:lombok:1.18.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.guava:guava:22.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.code.findbugs:jsr305:1.3.9"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.errorprone:error_prone_annotations:2.0.18"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.j2objc:j2objc-annotations:1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.codehaus.mojo:animal-sniffer-annotations:1.14"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alibaba:fastjson:1.2.68"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alibaba:easyexcel:2.2.6"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.poi:poi:3.17"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.commons:commons-collections4:4.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.poi:poi-ooxml:3.17"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.virtuald:curvesapi:1.04"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.poi:poi-ooxml-schemas:3.17"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.xmlbeans:xmlbeans:2.6.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: stax:stax-api:1.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: cglib:cglib:3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.ow2.asm:asm:4.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.slf4j:slf4j-api:1.7.26"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.ehcache:ehcache:3.6.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco:javacv:0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco:javacpp:0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:opencv:2.4.9-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:ffmpeg:2.2.1-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:flycapture:1.7.17-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:libdc1394:2.2.2-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:libfreenect:0.4-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:videoinput:0.200-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:artoolkitplus:2.3.0-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:opencv:windows-x86_64:2.4.9-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:ffmpeg:windows-x86_64:2.2.1-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:flycapture:windows-x86_64:1.7.17-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:libdc1394:windows-x86_64:2.2.2-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:libfreenect:windows-x86_64:0.4-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:videoinput:windows-x86_64:0.200-0.8"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bytedeco.javacpp-presets:artoolkitplus:windows-x86_64:2.3.0-0.8"
level=
"project"
/>
</component>
</module>
\ No newline at end of file
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
/>
\ No newline at end of file
wisenergy-web-admin/src/main/java/cn/wisenergy/Application.java
View file @
3d115e18
...
...
@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
springfox.documentation.oas.annotations.EnableOpenApi
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
...
...
@@ -13,7 +14,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
*/
@EnableCaching
@SpringBootApplication
(
exclude
=
{
MultipartAutoConfiguration
.
class
})
@Enable
Swagger2
@Enable
OpenApi
@EnableScheduling
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/config/swagger/Swagger2.java
View file @
3d115e18
package
cn
.
wisenergy
.
web
.
config
.
swagger
;
import
io.swagger.v3.oas.models.security.SecurityScheme
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -11,15 +12,14 @@ import springfox.documentation.service.*;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.contexts.SecurityContext
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
java.time.LocalDate
;
import
java.util.Arrays
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
static
com
.
google
.
common
.
collect
.
Lists
.
newArrayList
;
//注解开启 swagger2 功能
@EnableSwagger2
//注解标示,这是一个配置类,@Configuation注解包含了@Component注解
//可以不用在使用@Component注解标记这是个bean了,
@Configuration
...
...
@@ -31,7 +31,8 @@ public class Swagger2 {
*/
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
OAS_30
)
.
apiInfo
(
apiInfo
())
.
select
()
//控制暴露出去的路径下的实例
//如果某个接口不想暴露,可以使用以下注解
...
...
@@ -39,7 +40,7 @@ public class Swagger2 {
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.wisenergy.web.admin.controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
()
.
apiInfo
(
apiInfo
(
))
.
protocols
(
new
LinkedHashSet
<>(
Arrays
.
asList
(
"HTTPS"
,
"HTTP"
)
))
.
pathMapping
(
"/"
)
.
directModelSubstitute
(
LocalDate
.
class
,
String
.
class
)
.
genericModelSubstitutes
(
ResponseEntity
.
class
)
...
...
@@ -62,18 +63,17 @@ public class Swagger2 {
}
private
ApiKey
apiKey
()
{
return
new
ApiKey
(
"BearerToken"
,
"Authorization"
,
"header"
);
return
new
ApiKey
(
"BearerToken"
,
"Authorization"
,
SecurityScheme
.
In
.
HEADER
.
name
()
);
}
private
SecurityContext
securityContext
()
{
return
SecurityContext
.
builder
()
.
securityReferences
(
defaultAuth
())
.
forPaths
(
PathSelectors
.
regex
(
"/.*"
))
.
build
();
}
List
<
SecurityReference
>
defaultAuth
()
{
AuthorizationScope
authorizationScope
=
new
AuthorizationScope
(
"global"
,
"
accessEverything
"
);
AuthorizationScope
authorizationScope
=
new
AuthorizationScope
(
"global"
,
""
);
AuthorizationScope
[]
authorizationScopes
=
new
AuthorizationScope
[
1
];
authorizationScopes
[
0
]
=
authorizationScope
;
return
newArrayList
(
new
SecurityReference
(
"BearerToken"
,
authorizationScopes
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment