Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
signal
traffic-signal-platform
Commits
a9d2f8a1
Commit
a9d2f8a1
authored
Jan 14, 2025
by
zhoushiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://106.120.201.126:14725/signal/traffic-signal-platform
parents
ca0a46e3
cd277937
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
2 deletions
+102
-2
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+1
-1
bootstrap.yaml
signal-optimize-service/src/main/resources/bootstrap.yaml
+1
-1
pom.xml
signal-utc-service/pom.xml
+5
-0
Knife4jConfiguration.java
.../main/java/net/wanji/utc/config/Knife4jConfiguration.java
+95
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
a9d2f8a1
...
...
@@ -408,7 +408,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
if
(
StringUtils
.
equals
(
"24:00"
,
entHour
))
{
entHour
=
"23:59"
;
}
String
format
=
DateUtil
.
format
(
current
,
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_MINUTE
);
String
format
=
DateUtil
.
format
(
current
,
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_
HOUR_
MINUTE
);
Date
currentTime
=
DateUtil
.
parse
(
format
,
"HH:mm"
);
Date
startHourDate
=
DateUtil
.
parse
(
startHour
,
"HH:mm"
);
Date
endHourDate
=
DateUtil
.
parse
(
entHour
,
"HH:mm"
);
...
...
signal-optimize-service/src/main/resources/bootstrap.yaml
View file @
a9d2f8a1
spring
:
profiles
:
active
:
test
\ No newline at end of file
active
:
docker
\ No newline at end of file
signal-utc-service/pom.xml
View file @
a9d2f8a1
...
...
@@ -26,6 +26,11 @@
</properties>
<dependencies>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
2.0.4
</version>
</dependency>
<!-- ElasticSearch依赖 -->
<dependency>
<groupId>
org.elasticsearch.client
</groupId>
...
...
signal-utc-service/src/main/java/net/wanji/utc/config/Knife4jConfiguration.java
0 → 100644
View file @
a9d2f8a1
/*
* Copyright (C) 2018 Zhejiang xiaominfo Technology CO.,LTD.
* All rights reserved.
* Official Web Site: http://www.xiaominfo.com.
* Developer Web Site: http://open.xiaominfo.com.
*/
package
net
.
wanji
.
utc
.
config
;
import
com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j
;
import
com.google.common.collect.Lists
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
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.util.List
;
//import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
/**
* @author <a href="mailto:xiaoymin@foxmail.com">xiaoymin@foxmail.com</a>
* 2020/11/07 9:26
* @since:knife4j-spring-boot-fast-demo 1.0
*/
@Configuration
//@EnableSwagger2WebMvc
@EnableSwagger2
@EnableKnife4j
public
class
Knife4jConfiguration
{
/**
* 设置头,因为平台携带token进行验证,所以需要在Swagger添加头设置的功能
* @return
*/
private
List
<
SecurityScheme
>
securitySchemes
(){
return
Lists
.
newArrayList
(
new
ApiKey
(
"Authorization"
,
"token"
,
"header"
));
}
private
List
<
SecurityContext
>
securityContexts
(){
return
Lists
.
newArrayList
(
SecurityContext
.
builder
()
.
securityReferences
(
defaultAuth
())
.
forPaths
(
PathSelectors
.
regex
(
"^(?!login).*$"
))
.
build
()
);
}
private
List
<
SecurityReference
>
defaultAuth
()
{
AuthorizationScope
authorizationScope
=
new
AuthorizationScope
(
"global"
,
"accessEverything"
);
AuthorizationScope
[]
authorizationScopes
=
new
AuthorizationScope
[
1
];
authorizationScopes
[
0
]
=
authorizationScope
;
return
Lists
.
newArrayList
(
new
SecurityReference
(
"Authorization"
,
authorizationScopes
)
);
}
@Bean
(
value
=
"defaultApi2"
)
public
Docket
defaultApi2
()
{
String
groupName
=
"v0.1版本"
;
Docket
docket
=
new
Docket
(
DocumentationType
.
SWAGGER_2
)
//.host(swaggerDocUrl)
.
apiInfo
(
apiInfo
())
.
groupName
(
groupName
)
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.wanji.holo.restful"
))
.
paths
(
PathSelectors
.
any
())
.
build
()
.
securitySchemes
(
securitySchemes
())
.
securityContexts
(
securityContexts
())
;
//.extensions(openApiExtensionResolver.buildSettingExtensions());
return
docket
;
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"信控系统接口文档"
)
.
description
(
"信控系统 RESTful APIs"
)
//.termsOfServiceUrl(swaggerDocUrl)
.
contact
(
"wj@qq.com"
)
.
version
(
"0.1"
)
.
build
();
}
}
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