Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
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
quanku
qk_backend
Commits
26f6a7db
Commit
26f6a7db
authored
Aug 09, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getMenu3
parent
cf07edea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
ch-core/src/main/java/com/wwdz/ch/core/api/OfficialAccountApi.java
...rc/main/java/com/wwdz/ch/core/api/OfficialAccountApi.java
+27
-2
No files found.
ch-core/src/main/java/com/wwdz/ch/core/api/OfficialAccountApi.java
View file @
26f6a7db
...
@@ -8,6 +8,10 @@ import com.wwdz.ch.db.dao.distribution.ImageCatelogDao;
...
@@ -8,6 +8,10 @@ import com.wwdz.ch.db.dao.distribution.ImageCatelogDao;
import
com.wwdz.ch.db.domain.distribution.ImageCatelog
;
import
com.wwdz.ch.db.domain.distribution.ImageCatelog
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.StringUtils
;
import
com.xxdxxs.utils.StringUtils
;
import
okhttp3.MediaType
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.RequestBody
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -264,14 +268,35 @@ public class OfficialAccountApi {
...
@@ -264,14 +268,35 @@ public class OfficialAccountApi {
logger
.
info
(
"删除接口返回原文 :{}"
,
responseStr2
);
logger
.
info
(
"删除接口返回原文 :{}"
,
responseStr2
);
map
.
put
(
"responseStr2"
,
responseStr2
);
map
.
put
(
"responseStr2"
,
responseStr2
);
String
json
=
"{\"button\":[{\"type\":\"miniprogram\",\"name\":\"换藏\",\"url\":\"\",\"appid\":\"wx5b4409448bf2c72b\",\"pagepath\":\"pages/home/index\"}]}"
;
String
json
=
"{\"button\":[{\"type\":\"miniprogram\",\"name\":\"换藏\",\"url\":\"\",\"appid\":\"wx5b4409448bf2c72b\",\"pagepath\":\"pages/home/index\"}]}"
;
Map
paramMap
=
JsonUtils
.
toMap
(
json
);
/*
Map paramMap = JsonUtils.toMap(json);
String createUrl = "https://api.weixin.qq.com/cgi-bin/menu/create" + "?access_token=" + token;
String createUrl = "https://api.weixin.qq.com/cgi-bin/menu/create" + "?access_token=" + token;
okHttpUtil = OkHttpUtil.builder().url(createUrl);
okHttpUtil = OkHttpUtil.builder().url(createUrl);
okHttpUtil.post(true);
okHttpUtil.post(true);
okHttpUtil.addParams(paramMap);
okHttpUtil.addParams(paramMap);
String responseStr3 = okHttpUtil.async();
String responseStr3 = okHttpUtil.async();
logger.info("创建接口返回原文 :{}", responseStr3);
logger.info("创建接口返回原文 :{}", responseStr3);
map
.
put
(
"responseStr3"
,
responseStr3
);
map.put("responseStr3", responseStr3);*/
MediaType
JSON
=
MediaType
.
parse
(
"application/json; charset=utf-8"
);
OkHttpClient
client
=
new
OkHttpClient
();
RequestBody
requestBody
=
RequestBody
.
create
(
JSON
,
json
);
Request
request
=
new
Request
.
Builder
()
.
url
(
deleteUrl
)
.
post
(
requestBody
)
.
build
();
try
{
okhttp3
.
Response
response
=
client
.
newCall
(
request
).
execute
();
if
(
response
.
isSuccessful
())
{
String
responseBody
=
response
.
body
().
string
();
logger
.
info
(
"创建接口返回原文 :{}"
,
responseBody
);
map
.
put
(
"responseStr3"
,
responseBody
);
}
else
{
System
.
out
.
println
(
"Unexpected code "
+
response
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
Result
.
success
(
map
);
return
Result
.
success
(
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
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