Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
8fec6aaa
Commit
8fec6aaa
authored
5 years ago
by
dengshichuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dsc' into 'develop'
Spring Boot actuator监控 See merge request 8timerv2/8timerapiv200!31
parents
ae9745bb
b9de4438
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
32 deletions
+101
-32
pom.xml
+16
-6
src/main/java/cn/timer/api/config/interceptor/WebSecurityConfig.java
+1
-0
src/main/java/cn/timer/api/config/quartz/BaseJob.java
+7
-7
src/main/java/cn/timer/api/controller/LoginController.java
+0
-4
src/main/java/cn/timer/api/controller/dzht/DzhtController.java
+21
-14
src/main/java/cn/timer/api/controller/dzht/DzhtController2.java
+1
-1
src/main/java/cn/timer/api/utils/QueryUtil.java
+35
-0
src/main/resources/application-dev.yml
+20
-0
No files found.
pom.xml
View file @
8fec6aaa
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
</parent>
</parent>
<groupId>
cn.8timer
</groupId>
<groupId>
cn.8timer
</groupId>
<artifactId>
8timerV200
</artifactId>
<artifactId>
8timerV200
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<version>
v0.4-beta
</version>
<name>
8timerV200
</name>
<name>
8timerV200
</name>
<description>
Demo project for Spring Boot
</description>
<description>
8小时人事管家2.0
</description>
<profiles>
<profiles>
<profile>
<profile>
...
@@ -78,6 +78,16 @@
...
@@ -78,6 +78,16 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency> -->
<!-- 添加MySQL依赖 -->
<!-- 添加MySQL依赖 -->
<dependency>
<dependency>
...
@@ -309,16 +319,16 @@
...
@@ -309,16 +319,16 @@
</dependency>
</dependency>
<!--springboot-quartz -->
<!--springboot-quartz -->
<dependency>
<
!-- <
dependency>
<groupId>org.springframework.boot</groupId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
</dependency>
-->
<!--Quartz 使用的连接池 这里Quartz在持久化任务时使用该jar -->
<!--Quartz 使用的连接池 这里Quartz在持久化任务时使用该jar -->
<dependency>
<
!-- <
dependency>
<groupId>com.mchange</groupId>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
<version>0.9.5.2</version>
</dependency>
</dependency>
-->
<!-- pdf -->
<!-- pdf -->
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/config/interceptor/WebSecurityConfig.java
View file @
8fec6aaa
...
@@ -35,6 +35,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
...
@@ -35,6 +35,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
//.excludePathPatterns("/")
//.excludePathPatterns("/")
registry
.
addInterceptor
(
getSessionInterceptor
())
registry
.
addInterceptor
(
getSessionInterceptor
())
.
addPathPatterns
(
"/**"
)
.
addPathPatterns
(
"/**"
)
.
excludePathPatterns
(
"/actuator/*"
)
.
excludePathPatterns
(
"/doc*"
)
.
excludePathPatterns
(
"/doc*"
)
.
excludePathPatterns
(
"/v2/**"
)
.
excludePathPatterns
(
"/v2/**"
)
.
excludePathPatterns
(
"/**/*.js"
)
.
excludePathPatterns
(
"/**/*.js"
)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/config/quartz/BaseJob.java
View file @
8fec6aaa
package
cn
.
timer
.
api
.
config
.
quartz
;
package
cn
.
timer
.
api
.
config
.
quartz
;
import
org.quartz.Job
;
//
import org.quartz.Job;
import
org.quartz.JobExecutionContext
;
//
import org.quartz.JobExecutionContext;
import
org.quartz.JobExecutionException
;
//
import org.quartz.JobExecutionException;
//
public
interface
BaseJob
extends
Job
{
//
public interface BaseJob extends Job {
public
void
execute
(
JobExecutionContext
context
)
throws
JobExecutionException
;
//
public void execute(JobExecutionContext context) throws JobExecutionException;
}
//
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/LoginController.java
View file @
8fec6aaa
...
@@ -10,7 +10,6 @@ import javax.servlet.http.HttpSession;
...
@@ -10,7 +10,6 @@ import javax.servlet.http.HttpSession;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.env.Environment
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -53,9 +52,6 @@ import io.swagger.annotations.ApiOperation;
...
@@ -53,9 +52,6 @@ import io.swagger.annotations.ApiOperation;
@Transactional
@Transactional
@RequestMapping
(
value
=
"/login"
,
produces
=
{
"application/json"
})
@RequestMapping
(
value
=
"/login"
,
produces
=
{
"application/json"
})
public
class
LoginController
{
public
class
LoginController
{
@Autowired
private
Environment
env
;
@Value
(
"${configtest.patht}"
)
@Value
(
"${configtest.patht}"
)
public
String
port
;
public
String
port
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/dzht/DzhtController.java
View file @
8fec6aaa
...
@@ -45,6 +45,7 @@ import cn.timer.api.controller.dzht.cn.tign.hz.constant.ConfigConstant;
...
@@ -45,6 +45,7 @@ import cn.timer.api.controller.dzht.cn.tign.hz.constant.ConfigConstant;
import
cn.timer.api.controller.dzht.cn.tign.hz.enums.RequestType
;
import
cn.timer.api.controller.dzht.cn.tign.hz.enums.RequestType
;
import
cn.timer.api.controller.dzht.cn.tign.hz.exception.DefineException
;
import
cn.timer.api.controller.dzht.cn.tign.hz.exception.DefineException
;
import
cn.timer.api.dto.dzht.DzhtRzDto
;
import
cn.timer.api.dto.dzht.DzhtRzDto
;
import
cn.timer.api.utils.QueryUtil
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -233,7 +234,20 @@ public class DzhtController {
...
@@ -233,7 +234,20 @@ public class DzhtController {
return
ResultUtil
.
data
(
list
);
return
ResultUtil
.
data
(
list
);
}
}
final
static
String
savePath
=
"esignTemplate"
;
// 本地服务器文件保存路径
public
static
String
savePath
()
{
String
savePath
=
null
;
String
name
=
System
.
getProperty
(
"os.name"
);
if
(
name
.
startsWith
(
"Windows"
))
{
savePath
=
"E:\\esignTemplate"
;
// Windows本地服务器文件保存路径包
}
else
if
(
name
.
startsWith
(
"Linux"
)){
savePath
=
"esignTemplate"
;
// Linux远程服务器文件保存路径包
}
else
{
savePath
=
"esignTemplate"
;
// 其他服务器文件保存路径包
}
return
savePath
;
}
final
static
String
APP_ID
=
ConfigConstant
.
PROJECT_ID
;
// 项目id
final
static
String
APP_ID
=
ConfigConstant
.
PROJECT_ID
;
// 项目id
final
static
String
APP_SECRET
=
ConfigConstant
.
PROJECT_SECRET
;
// 项目密码
final
static
String
APP_SECRET
=
ConfigConstant
.
PROJECT_SECRET
;
// 项目密码
// final static String RE_TOKEN = "8b58973c290cc848b67ff0017cd424ff";
// final static String RE_TOKEN = "8b58973c290cc848b67ff0017cd424ff";
...
@@ -595,7 +609,7 @@ public class DzhtController {
...
@@ -595,7 +609,7 @@ public class DzhtController {
String
filePath
=
null
;
String
filePath
=
null
;
try
{
try
{
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
savePath
);
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
savePath
()
);
}
catch
(
IOException
e1
)
{
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
e1
.
printStackTrace
();
}
}
...
@@ -678,18 +692,11 @@ public class DzhtController {
...
@@ -678,18 +692,11 @@ public class DzhtController {
}
}
@GetMapping
(
"/queryName"
)
@GetMapping
(
"/queryName"
)
@ApiOperation
(
value
=
"查版本名字"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"查名字"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
getName
(
@RequestParam
String
empNum
)
{
public
Result
<
Object
>
getName
(
@RequestParam
(
required
=
false
)
Integer
empNum
)
{
String
a
=
System
.
getProperty
(
"os.name"
);
String
name
=
QueryUtil
.
queryEmpName
(
empNum
);
String
b
=
System
.
getProperty
(
"os.arch"
);
Map
<
String
,
String
>
map
=
QueryUtil
.
queryVersionName
();
String
c
=
System
.
getProperty
(
"os.version"
);
return
ResultUtil
.
datas
(
map
,
name
,
"查询成功"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"os.name"
,
a
);
map
.
put
(
"os.arch"
,
b
);
map
.
put
(
"os.version"
,
c
);
return
ResultUtil
.
data
(
map
);
// return ResultUtil.data(YgglMainEmp.builder().build()
// .selectOne(new QueryWrapper<YgglMainEmp>().eq("emp_num", empNum)).getName());
}
}
/*************************** 设置请求头 ***************************************/
/*************************** 设置请求头 ***************************************/
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/dzht/DzhtController2.java
View file @
8fec6aaa
...
@@ -724,7 +724,7 @@ public class DzhtController2 {
...
@@ -724,7 +724,7 @@ public class DzhtController2 {
String
filePath
=
null
;
String
filePath
=
null
;
try
{
try
{
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
DzhtController
.
savePath
);
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
DzhtController
.
savePath
()
);
tpyz
.
setFilePath
(
filePath
);
tpyz
.
setFilePath
(
filePath
);
}
catch
(
IOException
e1
)
{
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
e1
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/QueryUtil.java
0 → 100644
View file @
8fec6aaa
package
cn
.
timer
.
api
.
utils
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
public
class
QueryUtil
{
/**
* 查询当前系统名字与版本号
* @return
*/
public
static
Map
<
String
,
String
>
queryVersionName
()
{
String
a
=
System
.
getProperty
(
"os.name"
);
String
b
=
System
.
getProperty
(
"os.arch"
);
String
c
=
System
.
getProperty
(
"os.version"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"os.name"
,
a
);
map
.
put
(
"os.arch"
,
b
);
map
.
put
(
"os.version"
,
c
);
return
map
;
}
/**
* 查询员工姓名
* @param empNum
* @return
*/
public
static
String
queryEmpName
(
Integer
empNum
)
{
return
YgglMainEmp
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
eq
(
"emp_num"
,
empNum
)).
getName
();
}
}
This diff is collapsed.
Click to expand it.
src/main/resources/application-dev.yml
View file @
8fec6aaa
...
@@ -85,6 +85,26 @@ spring:
...
@@ -85,6 +85,26 @@ spring:
height
:
76
# Height of the banner image in chars (default based on image height).
height
:
76
# Height of the banner image in chars (default based on image height).
margin
:
2
# Left hand image margin in chars.
margin
:
2
# Left hand image margin in chars.
invert
:
false
# Whether images should be inverted for dark terminal themes.
invert
:
false
# Whether images should be inverted for dark terminal themes.
######### Spring boot应用健康监控
management
:
endpoints
:
web
:
exposure
:
include
:
"
*"
# 开启暴露所有的endpoint
endpoint
:
health
:
show-details
:
always
# 显示健康具体信息 默认不会显示详细信息
# INFO ENDPOINT CONFIGURATION
info
:
app
:
name
:
'
@project.name@'
description
:
'
@project.description@'
version
:
'
@project.version@'
encoding
:
'
@project.build.sourceEncoding@'
java
:
version
:
'
@java.version@'
##############################
# mybatis-plus
# mybatis-plus
mybatis-plus
:
mybatis-plus
:
...
...
This diff is collapsed.
Click to expand it.
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