Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
zhangshaowu
/
pipi-helper
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3287999c
authored
Oct 16, 2022
by
zhaolianjie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
卡片流程 - 删除群组
1 parent
b9ab75f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
src/main/java/com/pipihelper/project/feishu/service/FeiShuApiService.java
src/main/java/com/pipihelper/project/feishu/service/FeiShuApiService.java
View file @
3287999
...
...
@@ -25,7 +25,6 @@ import okhttp3.Request;
import
okhttp3.RequestBody
;
import
okhttp3.Response
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
...
...
@@ -454,6 +453,26 @@ public class FeiShuApiService {
}
}
public
String
deleteChatList
(
String
chatId
)
{
String
api
=
"/im/v1/chats/:{chat_id}"
;
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
set
(
"Authorization"
,
"Bearer "
+
getTenantToken
());
headers
.
set
(
"Content-Type"
,
"application/json; charset=utf-8"
);
String
url
=
feiShuConfig
.
getFeiShuOpenApiHost
()
+
api
;
try
{
HttpEntity
<
String
>
requestEntity
=
new
HttpEntity
<>(
headers
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
exchange
(
url
,
HttpMethod
.
DELETE
,
requestEntity
,
String
.
class
,
chatId
);
System
.
out
.
println
(
responseEntity
.
getBody
());
Type
type
=
new
TypeReference
<
FeiShuResultDTO
>()
{
}.
getType
();
FeiShuResultDTO
feiShuResultDTO
=
JSONObject
.
parseObject
(
responseEntity
.
getBody
(),
type
);
return
feiShuResultDTO
.
getData
().
getChatId
();
}
catch
(
Exception
e
)
{
throw
new
ServiceException
(
"飞书:"
+
api
+
"接口调用失败"
+
"\n"
+
e
);
}
}
/**
* 群发消息
* https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment