OSS-167 更新自述文件中的内容

This commit is contained in:
YuCheng Hu 2023-03-29 16:08:59 -04:00
parent 698f95ad5b
commit 31478acd98
1 changed files with 14 additions and 47 deletions

View File

@ -1,4 +1,4 @@
# WeChat-Official-Account-Spring
# OpenAI-Spring
<p align="center">
<a href="https://github.com/honeymoose">
@ -9,11 +9,11 @@
* [社区和讨论 (community)](https://www.ossez.com/tag/wechat)
Spring Boot API Project for WeChat-J library.
Spring Boot API Project for OpenAI-J library.
这是一个基于 WeChat-J 和 Spring Boot 的 API 微信公众号测试程序。
这是一个基于 OpenAI-J 和 Spring Boot 的 API 测试 Demo 程序。
我们旨在提供一个初始化的开发框架,能够让应用在使用 Spring Boot 框架的基础上让你的微信公众号快速接入微信平台
我们旨在提供一个初始化的开发框架,能够让应用在使用 Spring Boot 框架的基础上后端能够快速测试 OpenAI-J API 的功能
# 项目配置
@ -21,60 +21,21 @@ Spring Boot API Project for WeChat-J library.
在这个基础上,需要有一些先决条件。
## 先决条件
需要对微信公众号进行测试,你首先需要有一个微信公众号,如果没有的话,你可以使用微信提供的测试公众号来获得需要的 appID 和
appsecret。
* [微信测试平台获得测试账号](https://www.ossez.com/t/topic/14281)
## 依赖
项目使用的是 Maven如果你只希望使用 WeChat-J你只需要往你的项目中添加依赖即可。
项目使用的是 Maven如果你只希望使用 OpenAI-J你只需要往你的项目中添加依赖即可。
因为我们目前还在对项目进行整理,所以还是使用的 SNAPSHOT 版本。
```xml
<dependency>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j-oa</artifactId>
<groupId>com.ossez.openai</groupId>
<artifactId>openai-j</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
## 修改配置文件
```properties
# WeChat Official Cccount Conf
wechat.official-account.app-id=appId
wechat.official-account.secret=secret
wechat.official-account.token=token
wechat.official-account.aes-key=aesKey
# 存储配置redis(可选)
wx.mp.config-storage.type=Jedis # 配置类型: Memory(默认), Jedis, RedisTemplate
wx.mp.config-storage.key-prefix=wx # 相关redis前缀配置: wx(默认)
wx.mp.config-storage.redis.host=127.0.0.1
wx.mp.config-storage.redis.port=6379
#单机和sentinel同时存在时优先使用sentinel配置
#wx.mp.config-storage.redis.sentinel-ips=127.0.0.1:16379,127.0.0.1:26379
#wx.mp.config-storage.redis.sentinel-name=mymaster
# http客户端配置
wx.mp.config-storage.http-client-type=httpclient # http客户端类型: HttpClient(默认), OkHttp, JoddHttp
wx.mp.config-storage.http-proxy-host=
wx.mp.config-storage.http-proxy-port=
wx.mp.config-storage.http-proxy-username=
wx.mp.config-storage.http-proxy-password=
# 公众号地址host配置
#wx.mp.hosts.api-host=http://proxy.com/
#wx.mp.hosts.open-host=http://proxy.com/
#wx.mp.hosts.mp-host=http://proxy.com/
```
## 自动注入的类型
- `WxMpService`
- `WxMpConfigStorage`
# 联系方式
@ -95,7 +56,13 @@ wx.mp.config-storage.http-proxy-password=
## 微信公众号
![](https://cdn.ossez.com/img/cwikius/cwikius-qr-wechat-search-w400.png)
![](https://cdn.ossez.com/img/sharkfly/sharkfly-qr-wechat-search-w400.png)
关注公众号以后,可以通过向这个公众号发送消息来测试 ChatGPT 的微信消息集成功能。
<img src="https://cdn.ossez.com/discourse-uploads/original/2X/5/5f1cf67c4349029be682a30268df06d77202d510.png" width="600">
有关更多 ChatGPT 的讨论,请访问我们的 [ChatGPT 社区](https://www.ossez.com/tag/chat-gpt)。
## 头条号