feat:增加视频压缩文档

This commit is contained in:
2026-01-29 15:01:35 +08:00
parent b39d345da9
commit cbe8821376
5 changed files with 686 additions and 7 deletions

View File

@@ -3,8 +3,6 @@
date: 2026-01-23
---
  接口文档地址:[接口](https://developer.work.weixin.qq.com/document/path/90664)
# 一、建立工作台
1. 进入企业微信后台管理系统,选择应用管理->应用管理。
2. 选择自建->创建应用。
@@ -19,12 +17,12 @@
# 二、JS-SDK开发
## 2.1 接口鉴权
  [官方文档](https://developer.work.weixin.qq.com/document/path/90514)
  参考第三节企业微信接口开发
  参考第三节企业微信鉴权接口开发
## 2.2 打开默认浏览器
  使用系统浏览器打开指定 URL支持传入 oauth2 链接,从而实现在系统浏览器内免登录的效果。
# 三、接口开发
# 三、鉴权接口开发
  本教程以node.js为例。
## 3.1 通用企业微信服务端API
```js
@@ -448,4 +446,64 @@ module.exports = {
  将该应用主页的URL放在工作台的应用主页中。
::: tip
需要在前端工程中配置路由参数访问即通过ip:port/#/login?username=''&password=''的形式访问。
:::
:::
::: tip
如果需要在发送应用消息时可以点击消息访问应用绑定的URL链接也是该应用主页的链接。
:::
# 五、使用
  本教程以SpringBoot为例。
## 5.1 配置RestClient
```java
@Configuration
public class RestClientConfig {
final String weiComBaseUrl = "";
@Bean
public RestClient weiComClient() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(Duration.ofSeconds(5));
factory.setReadTimeout(Duration.ofSeconds(10));
return RestClient.builder()
.requestFactory(factory)
.baseUrl(weiComBaseUrl)
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.defaultHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE)
.build();
}
}
```
## 5.2 调用发送消息接口
```java
@Service
@Slf4j
public class NoticeService {
@Resource
private RestClient weiComClient;
@Async
public void sendRepairMessage(String touser, String content) {
String link = "";
WeComNoticeRequest request = new WeComNoticeRequest();
request.setTouser(touser);
request.setContent(content + "\n点击打开工作台应用" + "<a href=\"" + link + "\">打开应用</a>");
WeComResponse response = weiComClient.post()
.uri("/message/repair")
.contentType(MediaType.APPLICATION_JSON)
.body(request)
.retrieve()
.body(WeComResponse.class);
if (response == null || response.getErrcode() != 0) {
throw new CustomException("企业微信发送消息失败 请联系管理员");
}
}
}
```
# 附录
企业微信官方文档:[接口](https://developer.work.weixin.qq.com/document/path/90664)