Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
8f4b54f4
Commit
8f4b54f4
authored
Jul 20, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改鉴权
parent
33f20e7b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
17 deletions
+40
-17
common-lib/src/main/java/com/mortals/xhx/feign/area/IAreaFeign.java
.../src/main/java/com/mortals/xhx/feign/area/IAreaFeign.java
+5
-4
device-manager/pom.xml
device-manager/pom.xml
+1
-1
device-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
.../xhx/base/framework/interceptor/AuthTokenServiceImpl.java
+6
-5
device-manager/src/main/resources/bootstrap.yml
device-manager/src/main/resources/bootstrap.yml
+1
-5
device-manager/src/test/java/com/mortals/httpclient/device/DeviceController.http
.../java/com/mortals/httpclient/device/DeviceController.http
+12
-1
pom.xml
pom.xml
+15
-1
No files found.
common-lib/src/main/java/com/mortals/xhx/feign/area/IAreaFeign.java
View file @
8f4b54f4
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
/**
/**
* 区域 Feign接口
* 区域 Feign接口
*
* @author zxfei
* @author zxfei
* @date 2022-06-28
* @date 2022-06-28
*/
*/
...
@@ -45,7 +46,7 @@ public interface IAreaFeign extends IFeign {
...
@@ -45,7 +46,7 @@ public interface IAreaFeign extends IFeign {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/area/delete"
)
@GetMapping
(
value
=
"/area/delete"
)
String
delete
(
Long
[]
ids
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
String
delete
(
Long
[]
ids
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
/**
/**
...
@@ -55,7 +56,7 @@ public interface IAreaFeign extends IFeign {
...
@@ -55,7 +56,7 @@ public interface IAreaFeign extends IFeign {
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/area/save"
)
@PostMapping
(
value
=
"/area/save"
)
String
save
(
@RequestBody
AreaPdu
areaPdu
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
String
save
(
@RequestBody
AreaPdu
areaPdu
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
}
}
...
...
device-manager/pom.xml
View file @
8f4b54f4
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<profiles.rabbitmq.virtualhost>
/test
</profiles.rabbitmq.virtualhost>
<profiles.rabbitmq.virtualhost>
/test
</profiles.rabbitmq.virtualhost>
<profiles.rabbitmq.exchange></profiles.rabbitmq.exchange>
<profiles.rabbitmq.exchange></profiles.rabbitmq.exchange>
<profiles.filepath>
/mortals/data
</profiles.filepath>
<profiles.filepath>
/mortals/data
</profiles.filepath>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.level>
DEBUG
</profiles.log.level>
<profiles.log.path>
/logs
</profiles.log.path>
<profiles.log.path>
/logs
</profiles.log.path>
<profiles.data.path>
/data
</profiles.data.path>
<profiles.data.path>
/data
</profiles.data.path>
...
...
device-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
View file @
8f4b54f4
...
@@ -90,11 +90,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
...
@@ -90,11 +90,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
Claims
claims
=
parseToken
(
token
);
Claims
claims
=
parseToken
(
token
);
String
uuid
=
(
String
)
claims
.
get
(
SysConstains
.
LOGIN_USER_KEY
);
String
uuid
=
(
String
)
claims
.
get
(
SysConstains
.
LOGIN_USER_KEY
);
String
userKey
=
getTokenKey
(
uuid
);
String
userKey
=
getTokenKey
(
uuid
);
//cacheService.select(portalDb);
// Rest<String> rest = userFeign.getToken(userKey);
// String userStr = cacheService.get(userKey);
// String userStr = rest.getData();
Rest
<
String
>
rest
=
userFeign
.
getToken
(
userKey
);
cacheService
.
select
(
portalDb
);
String
userStr
=
rest
.
getData
();
String
userStr
=
cacheService
.
get
(
userKey
);
//cacheService.select(db);
cacheService
.
select
(
db
);
if
(
StringUtils
.
isNotEmpty
(
userStr
))
{
if
(
StringUtils
.
isNotEmpty
(
userStr
))
{
UserEntity
userEntity
=
JSONObject
.
parseObject
(
userStr
,
UserEntity
.
class
);
UserEntity
userEntity
=
JSONObject
.
parseObject
(
userStr
,
UserEntity
.
class
);
userEntity
.
setToken
(
token
);
userEntity
.
setToken
(
token
);
...
...
device-manager/src/main/resources/bootstrap.yml
View file @
8f4b54f4
...
@@ -70,11 +70,7 @@ application:
...
@@ -70,11 +70,7 @@ application:
registerApiPath
:
/api/register
registerApiPath
:
/api/register
deviceInitApiPath
:
/api/deviceInit
deviceInitApiPath
:
/api/deviceInit
deviceUpdateApiPath
:
/api/deviceUpdate
deviceUpdateApiPath
:
/api/deviceUpdate
cookie
:
ssoServerUrl
:
http://sso.testnew.com
key
:
026db82420614469897fcc2dc1b4ce38
domain
:
192.168.0.98
port
:
11010
upload
:
upload
:
path
:
@
profiles.filepath@
path
:
@
profiles.filepath@
feign
:
feign
:
...
...
device-manager/src/test/java/com/mortals/httpclient/device/DeviceController.http
View file @
8f4b54f4
...
@@ -10,6 +10,17 @@ Content-Type: application/json
...
@@ -10,6 +10,17 @@ Content-Type: application/json
}
}
###设备更新与保存
POST {{baseUrl}}/device/stopOrStartComsumeQueue
Authorization: {{authToken}}
Content-Type: application/json
{
"id": 60,
"enabled": 0
}
###设备更新与保存
###设备更新与保存
POST {{baseUrl}}/device/save
POST {{baseUrl}}/device/save
Authorization: {{authToken}}
Authorization: {{authToken}}
...
@@ -137,7 +148,7 @@ Content-Type: application/json
...
@@ -137,7 +148,7 @@ Content-Type: application/json
Authorization: {{authToken}}
Authorization: {{authToken}}
{
{
"deviceCode": "
B0
3",
"deviceCode": "
94-DE-80-D5-3D-6
3",
"action": "upload"
"action": "upload"
}
}
...
...
pom.xml
View file @
8f4b54f4
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<parent>
<parent>
<groupId>
com.mortals
</groupId>
<groupId>
com.mortals
</groupId>
<artifactId>
mortals-common
</artifactId>
<artifactId>
mortals-common
</artifactId>
<version>
1.1.
5
-SNAPSHOT
</version>
<version>
1.1.
7
-SNAPSHOT
</version>
</parent>
</parent>
<groupId>
com.mortals.xhx
</groupId>
<groupId>
com.mortals.xhx
</groupId>
<artifactId>
device-new-platform
</artifactId>
<artifactId>
device-new-platform
</artifactId>
...
@@ -54,8 +54,22 @@
...
@@ -54,8 +54,22 @@
<dependency>
<dependency>
<groupId>
com.alibaba.cloud
</groupId>
<groupId>
com.alibaba.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-nacos-discovery
</artifactId>
<artifactId>
spring-cloud-starter-alibaba-nacos-discovery
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-loadbalancer
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-ribbon
</artifactId>
</dependency>
</dependencies>
</dependencies>
<build>
<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