Commit 1fb6e183 by weiss

Merge remote-tracking branch 'origin/master' into massage_msgcard

2 parents e835ec43 1a128613
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
}
......@@ -123,12 +123,4 @@ public class FeiShuEventController {
});
return dtos;
}
private static class A {
Integer index;
String openId;
String name;
String departMentName;
String timeRange;
}
}
......@@ -27,7 +27,8 @@ public class FeiShuChatDTO {
private String userIdType;
@JsonProperty("user_id_list")
private String[] userIdList;
// 加入群聊的成员列表
@JsonProperty("id_list")
private String[] idList;
}
......@@ -393,7 +393,25 @@ public class FeiShuApiService {
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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!