Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
java-devop-sentry
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
zhouzihao
java-devop-sentry
Commits
0f52b111
Commit
0f52b111
authored
Mar 19, 2020
by
zhouzihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev-获取消息接口
parent
26d3457a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
0 deletions
+59
-0
src/main/java/com/vandyo/sentry/core/Tmp.java
src/main/java/com/vandyo/sentry/core/Tmp.java
+2
-0
src/main/java/com/vandyo/sentry/core/cases/MsgGetDecorator.java
...in/java/com/vandyo/sentry/core/cases/MsgGetDecorator.java
+54
-0
src/main/java/com/vandyo/sentry/core/tools/Signature.java
src/main/java/com/vandyo/sentry/core/tools/Signature.java
+1
-0
src/main/resources/application.yaml
src/main/resources/application.yaml
+2
-0
No files found.
src/main/java/com/vandyo/sentry/core/Tmp.java
View file @
0f52b111
...
@@ -44,6 +44,8 @@ public class Tmp {
...
@@ -44,6 +44,8 @@ public class Tmp {
// 上线前使用这段代码
// 上线前使用这段代码
// 登录
// 登录
case1
=
new
LoginCase
(
mobile
,
pwd
);
case1
=
new
LoginCase
(
mobile
,
pwd
);
// 获取消息接口
case1
=
new
MsgGetDecorator
(
case1
);
// 查询用户信息
// 查询用户信息
case1
=
new
UserInfoDecorator
(
case1
);
case1
=
new
UserInfoDecorator
(
case1
);
case1
=
new
CarListDecorator
(
case1
);
case1
=
new
CarListDecorator
(
case1
);
...
...
src/main/java/com/vandyo/sentry/core/cases/MsgGetDecorator.java
0 → 100644
View file @
0f52b111
package
com
.
vandyo
.
sentry
.
core
.
cases
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpResponse
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.vandyo.sentry.core.collectionMachine.CollectionMachine
;
import
com.vandyo.sentry.core.dto.Res
;
import
com.vandyo.sentry.core.tools.Signature
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 获取消息接口
*/
public
class
MsgGetDecorator
extends
CaseDecorator
{
private
static
final
String
msgGetUrl
=
"/msg/msg_get"
;
public
MsgGetDecorator
(
Case
aCase
)
{
super
(
aCase
);
}
@Override
public
Res
<
Map
<
String
,
String
>>
check
()
{
Res
<
Map
<
String
,
String
>>
oldRes
=
super
.
check
();
if
(
oldRes
.
getSuccess
())
{
Map
<
String
,
String
>
data
=
new
HashMap
<>();
data
.
put
(
"uid"
,
oldRes
.
getUId
());
data
.
put
(
"size"
,
String
.
valueOf
(
1
));
HttpResponse
response
=
HttpRequest
.
get
(
Signature
.
msgHost
+
msgGetUrl
+
"?"
+
Signature
.
getUrlParamsByMap
(
Signature
.
sign
(
data
,
oldRes
.
getSId
())))
.
execute
();
Res
<
Map
<
String
,
String
>>
newRes
=
new
Res
<>();
newRes
.
setSId
(
oldRes
.
getSId
());
newRes
.
setUId
(
oldRes
.
getUId
());
if
(
response
.
isOk
())
{
JSONObject
json
=
JSONUtil
.
parseObj
(
response
.
body
());
newRes
.
setSuccess
(
true
);
}
else
{
newRes
.
setKey
(
msgGetUrl
);
newRes
.
setStatus
(
Signature
.
matchStatus
(
response
.
getStatus
()));
newRes
.
setSuccess
(
false
);
}
CollectionMachine
.
post
(
newRes
);
return
newRes
;
}
else
{
oldRes
.
setIgnore
(
true
);
return
oldRes
;
}
}
}
src/main/java/com/vandyo/sentry/core/tools/Signature.java
View file @
0f52b111
...
@@ -14,6 +14,7 @@ public class Signature {
...
@@ -14,6 +14,7 @@ public class Signature {
// need be change to product env
// need be change to product env
// public static final String host = "http://10.100.11.41:8080";
// public static final String host = "http://10.100.11.41:8080";
public
static
final
String
host
=
"http://10.100.12.42:8080"
;
public
static
final
String
host
=
"http://10.100.12.42:8080"
;
public
static
final
String
msgHost
=
"http://10.100.12.42:8088"
;
/**
/**
* 生成签名
* 生成签名
...
...
src/main/resources/application.yaml
View file @
0f52b111
...
@@ -20,6 +20,7 @@ checkmeta:
...
@@ -20,6 +20,7 @@ checkmeta:
"
[/car/api/locus/event/v111]"
:
轨迹行驶行为
"
[/car/api/locus/event/v111]"
:
轨迹行驶行为
"
[/user/mall/goods/list]"
:
商品列表接口
"
[/user/mall/goods/list]"
:
商品列表接口
"
[/user/authorize/logout]"
:
注销登录接口
"
[/user/authorize/logout]"
:
注销登录接口
"
[/msg/msg_get]"
:
获取消息接口
test
:
测试接口
test
:
测试接口
timeMap
:
timeMap
:
"
[/car/my_car/info]"
:
6
"
[/car/my_car/info]"
:
6
...
@@ -35,6 +36,7 @@ checkmeta:
...
@@ -35,6 +36,7 @@ checkmeta:
"
[/car/api/locus/event/v111]"
:
6
"
[/car/api/locus/event/v111]"
:
6
"
[/user/mall/goods/list]"
:
6
"
[/user/mall/goods/list]"
:
6
"
[/user/authorize/logout]"
:
6
"
[/user/authorize/logout]"
:
6
"
[/msg/msg_get]"
:
6
test
:
2
test
:
2
emailList[0]
:
"
1042181618@qq.com"
emailList[0]
:
"
1042181618@qq.com"
...
...
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