Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SmartBox
Project
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
苗权威
SmartBox
Commits
3d3ba9d2
Commit
3d3ba9d2
authored
Jan 15, 2021
by
李进峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
请求参数uid添加及转码
parent
87733188
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
OkHttp3Utils.java
...main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java
+1
-1
RequestTerminal.java
...ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java
+8
-1
No files found.
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java
View file @
3d3ba9d2
...
@@ -124,7 +124,7 @@ public class OkHttp3Utils {
...
@@ -124,7 +124,7 @@ public class OkHttp3Utils {
urlBuild
.
addQueryParameter
(
"uid"
,
uid
);
urlBuild
.
addQueryParameter
(
"uid"
,
uid
);
builder
.
headers
(
headBuilder
.
build
()).
post
(
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
requestJsonStr
));
builder
.
url
(
urlBuild
.
build
()).
headers
(
headBuilder
.
build
()).
post
(
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
requestJsonStr
));
Response
response
=
client
.
newCall
(
builder
.
build
()).
execute
();
Response
response
=
client
.
newCall
(
builder
.
build
()).
execute
();
try
(
ResponseBody
body
=
response
.
body
()){
try
(
ResponseBody
body
=
response
.
body
()){
return
body
.
string
();
return
body
.
string
();
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java
View file @
3d3ba9d2
...
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.util.HashMap
;
import
java.util.HashMap
;
/**
/**
...
@@ -98,7 +99,13 @@ public class RequestTerminal {
...
@@ -98,7 +99,13 @@ public class RequestTerminal {
requestPojo
.
setUid
(
userId
);
requestPojo
.
setUid
(
userId
);
requestPojo
.
setMsg
(
XiaoAiConstants
.
TTS
.
END_WORD
);
requestPojo
.
setMsg
(
XiaoAiConstants
.
TTS
.
END_WORD
);
String
requestJsonStr
=
JSON
.
toJSONString
(
requestPojo
);
String
requestJsonStr
=
JSON
.
toJSONString
(
requestPojo
);
OkHttp3Utils
.
xiaoaiBackPostAsync
(
ScheduleServiceNew
.
BASE_HOST_URL
+
"?uid="
+
userId
,
requestJsonStr
,
type
);
String
uid
=
userId
;
try
{
uid
=
URLEncoder
.
encode
(
userId
,
"UTF-8"
);
}
catch
(
Exception
e
)
{
uid
=
userId
;
}
OkHttp3Utils
.
xiaoaiBackPostAsync
(
ScheduleServiceNew
.
BASE_HOST_URL
+
"?uid="
+
uid
,
requestJsonStr
,
type
);
// if (userId.equals(XiaoAiService.deviceId)) {
// if (userId.equals(XiaoAiService.deviceId)) {
// OkHttp3Utils.backPostAsync(XiaoAiConstants.QI_WU_TERMINATE_DIDI, requestJsonStr, type);
// OkHttp3Utils.backPostAsync(XiaoAiConstants.QI_WU_TERMINATE_DIDI, requestJsonStr, type);
// }else {
// }else {
...
...
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