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 1fb6e183
authored
Oct 15, 2022
by
weiss
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into massage_msgcard
2 parents
e835ec43
1a128613
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
11 deletions
src/main/java/com/pipihelper/project/feishu/bo/PushPainBO.java
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
src/main/java/com/pipihelper/project/feishu/dto/chat/FeiShuChatDTO.java
src/main/java/com/pipihelper/project/feishu/service/FeiShuApiService.java
src/main/java/com/pipihelper/project/feishu/bo/PushPainBO.java
0 → 100644
View file @
1fb6e18
package
com
.
pipihelper
.
project
.
feishu
.
bo
;
import
lombok.Data
;
@Data
public
class
PushPainBO
{
Integer
index
;
String
openId
;
String
name
;
String
departMentName
;
//部门名
String
timeRange
;
//时间区间 15:00 - 16:00
}
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
View file @
1fb6e18
...
@@ -123,12 +123,4 @@ public class FeiShuEventController {
...
@@ -123,12 +123,4 @@ public class FeiShuEventController {
});
});
return
dtos
;
return
dtos
;
}
}
private
static
class
A
{
Integer
index
;
String
openId
;
String
name
;
String
departMentName
;
String
timeRange
;
}
}
}
src/main/java/com/pipihelper/project/feishu/dto/chat/FeiShuChatDTO.java
View file @
1fb6e18
...
@@ -27,7 +27,8 @@ public class FeiShuChatDTO {
...
@@ -27,7 +27,8 @@ public class FeiShuChatDTO {
private
String
userIdType
;
private
String
userIdType
;
@JsonProperty
(
"user_id_list"
)
@JsonProperty
(
"user_id_list"
)
private
String
[]
userIdList
;
private
String
[]
userIdList
;
// 加入群聊的成员列表
@JsonProperty
(
"id_list"
)
private
String
[]
idList
;
}
}
src/main/java/com/pipihelper/project/feishu/service/FeiShuApiService.java
View file @
1fb6e18
...
@@ -393,7 +393,25 @@ public class FeiShuApiService {
...
@@ -393,7 +393,25 @@ public class FeiShuApiService {
throw
new
ServiceException
(
"飞书:"
+
api
+
"接口调用失败"
+
"\n"
+
e
);
throw
new
ServiceException
(
"飞书:"
+
api
+
"接口调用失败"
+
"\n"
+
e
);
}
}
}
}
public
String
joinChatList
(
FeiShuChatDTO
feiShuChatDTO
)
{
String
api
=
"/im/v1/chats/{chat_id}/members"
;
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
<>(
objectMapper
.
writeValueAsString
(
feiShuChatDTO
),
headers
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
exchange
(
url
,
HttpMethod
.
POST
,
requestEntity
,
String
.
class
,
feiShuChatDTO
.
getChatId
());
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
* 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