Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wlzwh
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
mengmeng
wlzwh
Commits
dd34250a
Commit
dd34250a
authored
Jul 17, 2020
by
mengmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0717 add peopleInfoMange
parent
95c7cbd5
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
88 additions
and
17 deletions
+88
-17
hmit-admin.iml
hmit-admin/hmit-admin.iml
+8
-1
application-dev.yml
hmit-admin/src/main/resources/application-dev.yml
+9
-5
hmit-api.iml
hmit-api/hmit-api.iml
+5
-0
LogOperation.java
hmit-api/src/main/java/io/hmit/annotation/LogOperation.java
+16
-0
WebMvcConfig.java
hmit-api/src/main/java/io/hmit/config/WebMvcConfig.java
+10
-1
WlUploadInfoController.java
.../main/java/io/hmit/controller/WlUploadInfoController.java
+3
-3
CorsInterceptor.java
...pi/src/main/java/io/hmit/interceptor/CorsInterceptor.java
+30
-0
application-dev.yml
hmit-api/src/main/resources/application-dev.yml
+5
-5
application.yml
hmit-api/src/main/resources/application.yml
+2
-2
No files found.
hmit-admin/hmit-admin.iml
View file @
dd34250a
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"CheckStyle-IDEA-Module"
>
<option
name=
"configuration"
>
<map
/>
</option>
</component>
<component
name=
"FacetManager"
>
<facet
type=
"jpa"
name=
"JPA"
>
<configuration>
<setting
name=
"validation-enabled"
value=
"true"
/>
<datasource-mapping
/>
<datasource-mapping>
<factory-entry
name=
"hmit-admin"
/>
</datasource-mapping>
<naming-strategy-map
/>
</configuration>
</facet>
...
...
hmit-admin/src/main/resources/application-dev.yml
View file @
dd34250a
...
...
@@ -5,10 +5,14 @@ spring:
# driver-class-name: com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
# url: jdbc:mysql://112.51.130.215:3306/security_enterprise?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://122.51.130.215/security_enterprise?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
root
password
:
123456
# #Oracle
# url: jdbc:mysql://122.51.130.215/security_enterprise?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
# username: root
# password: 123456
url
:
jdbc:mysql://119.3.143.77:3306/wlzwh?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
hmit_user
password
:
HmitUser@1234
# #Oracle
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@localhost:1521:xe
# username: hmit_security
...
...
hmit-api/hmit-api.iml
View file @
dd34250a
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"CheckStyle-IDEA-Module"
>
<option
name=
"configuration"
>
<map
/>
</option>
</component>
<component
name=
"FacetManager"
>
<facet
type=
"Spring"
name=
"Spring"
>
<configuration
/>
...
...
hmit-api/src/main/java/io/hmit/annotation/LogOperation.java
0 → 100644
View file @
dd34250a
package
io
.
hmit
.
annotation
;
import
java.lang.annotation.*
;
/**
* 操作日志注解
*
* @author zsh 408538940@qq.com
*/
@Target
(
ElementType
.
METHOD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
LogOperation
{
String
value
()
default
""
;
}
hmit-api/src/main/java/io/hmit/config/WebMvcConfig.java
View file @
dd34250a
...
...
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.interceptor.AuthorizationInterceptor
;
import
io.hmit.interceptor.CorsInterceptor
;
import
io.hmit.resolver.LoginUserHandlerMethodArgumentResolver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -37,8 +38,16 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Autowired
private
LoginUserHandlerMethodArgumentResolver
loginUserHandlerMethodArgumentResolver
;
@Autowired
private
CorsInterceptor
corsInterceptor
;
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
// 跨域拦截器需放在最上面
registry
.
addInterceptor
(
corsInterceptor
).
addPathPatterns
(
"/**"
);
registry
.
addInterceptor
(
authorizationInterceptor
).
addPathPatterns
(
"/api/**"
);
}
...
...
hmit-api/src/main/java/io/hmit/controller/WlUploadInfoController.java
View file @
dd34250a
...
...
@@ -3,7 +3,7 @@ package io.hmit.controller;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.annotation.LogOperation
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.common.validator.ValidatorUtils
;
...
...
@@ -66,7 +66,7 @@ public class WlUploadInfoController {
@PostMapping
@ApiOperation
(
"保存"
)
@LogOperation
(
"保存"
)
public
Result
save
(
@RequestBody
WlUploadInfoDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
...
...
hmit-api/src/main/java/io/hmit/interceptor/CorsInterceptor.java
0 → 100644
View file @
dd34250a
package
io
.
hmit
.
interceptor
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
@Component
public
class
CorsInterceptor
implements
HandlerInterceptor
{
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
{
response
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
);
response
.
setHeader
(
"Access-Control-Allow-Credentials"
,
"true"
);
response
.
setHeader
(
"Access-Control-Allow-Methods"
,
"GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS"
);
response
.
setHeader
(
"Access-Control-Max-Age"
,
"86400"
);
response
.
setHeader
(
"Access-Control-Allow-Headers"
,
"*"
);
// 如果是OPTIONS则结束请求
if
(
HttpMethod
.
OPTIONS
.
toString
().
equals
(
request
.
getMethod
()))
{
response
.
setStatus
(
HttpStatus
.
NO_CONTENT
.
value
());
return
false
;
}
return
true
;
}
}
hmit-api/src/main/resources/application-dev.yml
View file @
dd34250a
spring
:
datasource
:
druid
:
#
driver-class-name: com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
#
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://112.51.130.215:3306/security_enterprise?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://1
22.51.130.215:3306/security_enterprise
?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
root
password
:
123456
url
:
jdbc:mysql://1
19.3.143.77:3306/wlzwh
?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
hmit_user
password
:
HmitUser@1234
initial-size
:
10
max-active
:
100
min-idle
:
10
...
...
hmit-api/src/main/resources/application.yml
View file @
dd34250a
...
...
@@ -4,7 +4,7 @@ server:
uri-encoding
:
UTF-8
max-threads
:
1000
min-spare-threads
:
30
port
:
808
1
port
:
808
7
connection-timeout
:
5000ms
servlet
:
context-path
:
/hmit-api
...
...
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