Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cneeds-server
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangzr
cneeds-server
Commits
cb977d7d
Commit
cb977d7d
authored
Mar 06, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.服务发现的Ip
2.配置文件
parent
f1fdc4b3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
113 additions
and
78 deletions
+113
-78
workspace.xml
.idea/workspace.xml
+0
-0
pom.xml
cneeds-common-data/pom.xml
+1
-0
pom.xml
cneeds-common-pojo/pom.xml
+1
-1
pom.xml
cneeds-common-utils/pom.xml
+1
-1
Dockerfile
cneeds-server-authorization/Dockerfile
+2
-2
cneeds-server-authorization.iml
cneeds-server-authorization/cneeds-server-authorization.iml
+0
-3
pom.xml
cneeds-server-authorization/pom.xml
+1
-1
application-dev.yml
...rver-authorization/src/main/resources/application-dev.yml
+8
-0
application.properties
...r-authorization/src/main/resources/application.properties
+0
-9
application.yml
...s-server-authorization/src/main/resources/application.yml
+12
-0
Dockerfile
cneeds-server-datashow/Dockerfile
+2
-1
pom.xml
cneeds-server-datashow/pom.xml
+1
-0
FeignInterceptor.java
...om/mx/cneeds/server/datashow/config/FeignInterceptor.java
+0
-1
OAuth2ResourceServer.java
...x/cneeds/server/datashow/config/OAuth2ResourceServer.java
+1
-0
WebConfig.java
.../java/com/mx/cneeds/server/datashow/config/WebConfig.java
+1
-1
UserController.java
...om/mx/cneeds/server/datashow/web/user/UserController.java
+2
-3
application-dev.yml
...ds-server-datashow/src/main/resources/application-dev.yml
+2
-0
Dockerfile
cneeds-server-eureka/Dockerfile
+2
-2
pom.xml
cneeds-server-eureka/pom.xml
+1
-1
application-dev.yml
cneeds-server-eureka/src/main/resources/application-dev.yml
+14
-0
application.yml
cneeds-server-eureka/src/main/resources/application.yml
+2
-0
Dockerfile
cneeds-server-user/Dockerfile
+3
-2
applicaiton-dev.yml
cneeds-server-user/src/main/resources/applicaiton-dev.yml
+54
-0
application.yml
cneeds-server-user/src/main/resources/application.yml
+2
-50
No files found.
.idea/workspace.xml
View file @
cb977d7d
This diff is collapsed.
Click to expand it.
cneeds-common-data/pom.xml
View file @
cb977d7d
...
...
@@ -9,6 +9,7 @@
</parent>
<modelVersion>
4.0.0
</modelVersion>
<version>
1.0-SNAPSHOT
</version>
<artifactId>
cneeds-common-data
</artifactId>
<packaging>
jar
</packaging>
<properties>
...
...
cneeds-common-pojo/pom.xml
View file @
cb977d7d
...
...
@@ -11,7 +11,7 @@
<packaging>
jar
</packaging>
<version>
1.0-SNAPSHOT
</version>
<artifactId>
cneeds-common-pojo
</artifactId>
...
...
cneeds-common-utils/pom.xml
View file @
cb977d7d
...
...
@@ -8,7 +8,7 @@
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<version>
1.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<artifactId>
cneeds-common-utils
</artifactId>
...
...
cneeds-server-authorization/Dockerfile
View file @
cb977d7d
FROM
hub.c.163.com/library/java:8-alpine
#
FROM hub.c.163.com/library/java:8-alpine
FROM
openjdk:8
MAINTAINER
XXX XXX@imooc.com
ADD
target/*.jar app.jar
...
...
cneeds-server-authorization/cneeds-server-authorization.iml
deleted
100644 → 0
View file @
f1fdc4b3
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
/>
\ No newline at end of file
cneeds-server-authorization/pom.xml
View file @
cb977d7d
...
...
@@ -10,7 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cneeds-server-authorization
</artifactId>
<packaging>
jar
</packaging>
<version>
1.0-SNAPSHOT
</version>
<dependencies>
<!-- eureka-client -->
...
...
cneeds-server-authorization/src/main/resources/application-dev.yml
0 → 100644
View file @
cb977d7d
eureka
:
client
:
service-url
:
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
prefer-ip-address
:
true
ip-address
:
192.168.2.244
\ No newline at end of file
cneeds-server-authorization/src/main/resources/application.properties
deleted
100644 → 0
View file @
f1fdc4b3
server.port
=
8861
server.servlet.context-path
=
/
spring.application.name
=
cneeds-server-authorization
eureka.client.service-url.defaultZone
=
http://192.168.2.244:8761/eureka/
eureka.instance.prefer-ip-address
=
true
\ No newline at end of file
cneeds-server-authorization/src/main/resources/application.yml
0 → 100644
View file @
cb977d7d
spring
:
profiles
:
active
:
dev
application
:
name
:
cneeds-server-authorization
server
:
port
:
8861
servlet
:
context-path
:
/
cneeds-server-datashow/Dockerfile
View file @
cb977d7d
FROM
hub.c.163.com/library/java:8-alpine
#FROM hub.c.163.com/library/java:8-alpine
FROM
openjdk:8
MAINTAINER
XXX XXX@imooc.com
...
...
cneeds-server-datashow/pom.xml
View file @
cb977d7d
...
...
@@ -11,6 +11,7 @@
<artifactId>
cneeds-server-datashow
</artifactId>
<packaging>
jar
</packaging>
<version>
1.0-SNAPSHOT
</version>
<dependencies>
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/FeignInterceptor.java
View file @
cb977d7d
...
...
@@ -34,7 +34,6 @@ public class FeignInterceptor implements RequestInterceptor {
if
(
request
.
getRequestURL
().
toString
().
contains
(
"/user/login"
)){
String
authString
=
RequestParamterConverter
.
authorizationConverter
(
"clientapp"
,
"112233"
);
requestTemplate
.
header
(
"Authorization"
,
authString
);
System
.
out
.
println
(
authString
);
}
}
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/OAuth2ResourceServer.java
View file @
cb977d7d
...
...
@@ -20,6 +20,7 @@ public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter {
http
.
authorizeRequests
()
.
antMatchers
(
"/user/login"
,
"/device/getChannel_nums"
,
// "/user/info",
"/statics/**"
)
.
permitAll
()
// 开启认证
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/WebConfig.java
View file @
cb977d7d
...
...
@@ -30,7 +30,7 @@ public class WebConfig implements WebMvcConfigurer {
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
.
allowedOrigins
(
"*"
)
.
allowedMethods
(
"GET"
,
"HEAD"
,
"POST"
,
"PUT"
,
"DELETE"
,
"OPTIONS"
)
.
allowedMethods
(
"GET"
,
"HEAD"
,
"POST"
,
"PUT"
,
"DELETE"
,
"OPTIONS"
,
"AUTHORIZATION"
)
.
allowCredentials
(
true
)
.
maxAge
(
3600
)
.
allowedHeaders
(
"*"
);
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/user/UserController.java
View file @
cb977d7d
...
...
@@ -42,15 +42,14 @@ public class UserController {
}
@RequestMapping
(
"/info"
)
public
UserInfoVo
getInfo
(){
public
R
getInfo
(){
UserInfoVo
userInfoVo
=
new
UserInfoVo
();
log
.
info
(
"getInfo"
);
userInfoVo
.
setName
(
"admin"
);
userInfoVo
.
setIntroduction
(
"manager"
);
userInfoVo
.
setRoles
(
"admin"
);
userInfoVo
.
setAvatar
(
"avatar"
);
return
userInfoVo
;
return
new
R
().
put
(
"data"
,
userInfoVo
)
;
}
}
cneeds-server-datashow/src/main/resources/application-dev.yml
View file @
cb977d7d
...
...
@@ -4,3 +4,5 @@ eureka:
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
prefer-ip-address
:
true
# ip-address: 192.168.2.244
cneeds-server-eureka/Dockerfile
View file @
cb977d7d
FROM
hub.c.163.com/library/java:8-alpine
#
FROM hub.c.163.com/library/java:8-alpine
FROM
openjdk:8
MAINTAINER
XXX XXX@imooc.com
ADD
target/*.jar app.jar
...
...
cneeds-server-eureka/pom.xml
View file @
cb977d7d
...
...
@@ -11,7 +11,7 @@
<artifactId>
cneeds-server-eureka
</artifactId>
<packaging>
jar
</packaging>
<version>
1.0-SNAPSHOT
</version>
<dependencies>
...
...
cneeds-server-eureka/src/main/resources/application-dev.yml
0 → 100644
View file @
cb977d7d
eureka
:
client
:
service-url
:
#defaultZone: http://eureka2:8762/eureka/
defaultZone
:
http://localhost:8761/eureka/
## 单机的时候开启
register-with-eureka
:
false
fetch-registry
:
'
false'
# server:
# enable-self-preservation: false
instance
:
prefer-ip-address
:
true
ip-address
:
192.168.2.244
\ No newline at end of file
cneeds-server-eureka/src/main/resources/application.yml
View file @
cb977d7d
...
...
@@ -12,6 +12,8 @@ eureka:
prefer-ip-address
:
true
spring
:
profiles
:
active
:
dev
application
:
name
:
cneeds-server-eureka
server
:
...
...
cneeds-server-user/Dockerfile
View file @
cb977d7d
FROM
hub.c.163.com/library/java:8-alpine
#FROM hub.c.163.com/library/java:8-alpine
#FROM hub.c.163.com/library/java:8-jre
FROM
openjdk:8
MAINTAINER
XXX XXX@imooc.com
ADD
target/*.jar app.jar
...
...
cneeds-server-user/src/main/resources/applicaiton-dev.yml
0 → 100644
View file @
cb977d7d
spring
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
password
:
cneeds!QAZ1qaz
username
:
root
# hikari:
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
# username: root
# password: cneeds!QAZ1qaz
# datasource:
# type: com.alibaba.druid.pool.DruidDataSource
# druid:
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
# username: root
# password: cneeds!QAZ1qaz
# initial-size: 10
# max-active: 100
# min-idle: 10
# max-wait: 60000
# pool-prepared-statements: true
# max-pool-prepared-statement-per-connection-size: 20
# time-between-eviction-runs-millis: 60000
# min-evictable-idle-time-millis: 300000
# #Oracle需要打开注释
# #validation-query: SELECT 1 FROM DUAL
# test-while-idle: true
# test-on-borrow: false
# test-on-return: false
# stat-view-servlet:
# enabled: true
# url-pattern: /druid/*
# #login-username: admin
# #login-password: admin
# filter:
# stat:
# log-slow-sql: true
# slow-sql-millis: 1000
# merge-sql: false
# wall:
# config:
# multi-statement-allow: true
eureka
:
client
:
service-url
:
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
prefer-ip-address
:
true
ip-address
:
192.168.2.244
\ No newline at end of file
cneeds-server-user/src/main/resources/application.yml
View file @
cb977d7d
spring
:
profiles
:
active
:
dev
application
:
name
:
cneeds-server-user
datasource
:
driver-class-name
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
password
:
cneeds!QAZ1qaz
username
:
root
# hikari:
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
# username: root
# password: cneeds!QAZ1qaz
# datasource:
# type: com.alibaba.druid.pool.DruidDataSource
# druid:
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
# username: root
# password: cneeds!QAZ1qaz
# initial-size: 10
# max-active: 100
# min-idle: 10
# max-wait: 60000
# pool-prepared-statements: true
# max-pool-prepared-statement-per-connection-size: 20
# time-between-eviction-runs-millis: 60000
# min-evictable-idle-time-millis: 300000
# #Oracle需要打开注释
# #validation-query: SELECT 1 FROM DUAL
# test-while-idle: true
# test-on-borrow: false
# test-on-return: false
# stat-view-servlet:
# enabled: true
# url-pattern: /druid/*
# #login-username: admin
# #login-password: admin
# filter:
# stat:
# log-slow-sql: true
# slow-sql-millis: 1000
# merge-sql: false
# wall:
# config:
# multi-statement-allow: true
eureka
:
client
:
service-url
:
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
prefer-ip-address
:
true
server
:
port
:
9001
servlet
:
...
...
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