mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 08:46:38 +08:00
docs: export database, update readme doc, remove useless configs for alipay
This commit is contained in:
parent
321e2087ea
commit
b8ae65bb30
@ -1,8 +1,9 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
## v3.1.7
|
## v3.1.8
|
||||||
1. Bug修复:修复 MidJourney API 参数版本更新导致调用失败的 Bug
|
1. 功能新增:新增会员套餐充值,点卡充值,订单系统,集成支付宝支付通道
|
||||||
2. 功能优化:将聊天报错信息定义为统一常量,方便修改
|
2. Bug修复:修复 MidJourney API 参数版本更新导致调用失败的 Bug
|
||||||
|
3. 功能优化:将聊天报错信息定义为统一常量,方便修改
|
||||||
|
|
||||||
## v3.1.7
|
## v3.1.7
|
||||||
1. 功能新增:支持文心4.0 AI 模型
|
1. 功能新增:支持文心4.0 AI 模型
|
||||||
|
23
README.md
23
README.md
@ -219,6 +219,25 @@ WeChatBot = false # 是否启动微信机器人
|
|||||||
ApiURL = "http://172.22.11.200:7860" # stable-diffusion-webui API 地址
|
ApiURL = "http://172.22.11.200:7860" # stable-diffusion-webui API 地址
|
||||||
ApiKey = "" # 如果开启了授权,这里需要配置授权的 ApiKey
|
ApiKey = "" # 如果开启了授权,这里需要配置授权的 ApiKey
|
||||||
Txt2ImgJsonPath = "res/text2img.json" # 文生图的 API 请求报文 json 模板,允许自定义请求json报文,因为不同版本的 API 绘图的参数以及 fn_index 会不同。
|
Txt2ImgJsonPath = "res/text2img.json" # 文生图的 API 请求报文 json 模板,允许自定义请求json报文,因为不同版本的 API 绘图的参数以及 fn_index 会不同。
|
||||||
|
|
||||||
|
[XXLConfig] # xxl-job 配置,需要你部署 XXL-JOB 定时任务工具,用来定期清理未支付订单和清理过期 VIP,如果你没有启用支付服务,则该服务也无需启动
|
||||||
|
Enabled = false # 是否启用 XXL JOB 服务
|
||||||
|
ServerAddr = "http://172.22.11.47:8080/xxl-job-admin" # xxl-job-admin 管理地址
|
||||||
|
ExecutorIp = "172.22.11.47" # 执行器 IP 地址
|
||||||
|
ExecutorPort = "9999" # 执行器服务端口
|
||||||
|
AccessToken = "xxl-job-api-token" # 执行器 API 通信 token
|
||||||
|
RegistryKey = "chatgpt-plus" # 任务注册 key
|
||||||
|
|
||||||
|
[AlipayConfig]
|
||||||
|
Enabled = false # 启用支付宝支付通道
|
||||||
|
SandBox = false # 是否启用沙盒模式
|
||||||
|
UserId = "2088721020750581" # 商户ID
|
||||||
|
AppId = "9021000131658023" # App Id
|
||||||
|
PrivateKey = "certs/alipay/privateKey.txt" # 应用私钥
|
||||||
|
PublicKey = "certs/alipay/appPublicCert.crt" # 应用公钥证书
|
||||||
|
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
|
||||||
|
RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
|
||||||
|
NotifyURL = "http://r9it.com:6004/api/payment/alipay/notify" # 支付异步回调地址
|
||||||
```
|
```
|
||||||
|
|
||||||
> 1. 如果你不知道如何获取 Discord 用户 Token 和 Bot Token
|
> 1. 如果你不知道如何获取 Discord 用户 Token 和 Bot Token
|
||||||
@ -260,7 +279,7 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
# 后端 API 镜像
|
# 后端 API 镜像
|
||||||
chatgpt-plus-api:
|
chatgpt-plus-api:
|
||||||
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-api:v3.1.5 #这里改成最新的 release 版本地址
|
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-api:v3.1.8 #这里改成最新的 release 版本
|
||||||
container_name: chatgpt-plus-api
|
container_name: chatgpt-plus-api
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
@ -277,7 +296,7 @@ services:
|
|||||||
|
|
||||||
# 前端应用镜像
|
# 前端应用镜像
|
||||||
chatgpt-plus-web:
|
chatgpt-plus-web:
|
||||||
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-web:v3.1.5 #这里改成最新的 release 版本地址
|
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-web:v3.1.8 #这里改成最新的 release 版本
|
||||||
container_name: chatgpt-plus-web
|
container_name: chatgpt-plus-web
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
@ -72,19 +72,18 @@ WeChatBot = false
|
|||||||
[XXLConfig] # xxl-job 配置,需要你部署 XXL-JOB 定时任务工具,用来定期清理未支付订单和清理过期 VIP,如果你没有启用支付服务,则该服务也无需启动
|
[XXLConfig] # xxl-job 配置,需要你部署 XXL-JOB 定时任务工具,用来定期清理未支付订单和清理过期 VIP,如果你没有启用支付服务,则该服务也无需启动
|
||||||
Enabled = false # 是否启用 XXL JOB 服务
|
Enabled = false # 是否启用 XXL JOB 服务
|
||||||
ServerAddr = "http://172.22.11.47:8080/xxl-job-admin" # xxl-job-admin 管理地址
|
ServerAddr = "http://172.22.11.47:8080/xxl-job-admin" # xxl-job-admin 管理地址
|
||||||
ExecutorIp = "" # 执行器 IP 地址
|
ExecutorIp = "172.22.11.47" # 执行器 IP 地址
|
||||||
ExecutorPort = "" # 执行器服务端口
|
ExecutorPort = "9999" # 执行器服务端口
|
||||||
AccessToken = "" # 执行器 API 通信 token
|
AccessToken = "xxl-job-api-token" # 执行器 API 通信 token
|
||||||
RegistryKey = "chatgpt-plus" # 任务注册 key
|
RegistryKey = "chatgpt-plus" # 任务注册 key
|
||||||
|
|
||||||
[AlipayConfig]
|
[AlipayConfig]
|
||||||
Enabled = false
|
Enabled = false # 启用支付宝支付通道
|
||||||
SandBox = false
|
SandBox = false # 是否启用沙盒模式
|
||||||
Company = "sandbox 默认应用:2088721020750581"
|
UserId = "2088721020750581" # 商户ID
|
||||||
UserId = "2088721020750581"
|
AppId = "9021000131658023" # App Id
|
||||||
AppId = "9021000131658023"
|
PrivateKey = "certs/alipay/privateKey.txt" # 应用私钥
|
||||||
PrivateKey = "certs/alipay/privateKey.txt"
|
PublicKey = "certs/alipay/appPublicCert.crt" # 应用公钥证书
|
||||||
PublicKey = "certs/alipay/appPublicCert.crt"
|
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
|
||||||
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt"
|
RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
|
||||||
RootCert = "certs/alipay/alipayRootCert.crt"
|
NotifyURL = "http://r9it.com:6004/api/payment/alipay/notify" # 支付异步回调地址
|
||||||
NotifyURL = "http://r9it.com:6004/api/payment/alipay/notify"
|
|
@ -63,9 +63,8 @@ type AliYunSmsConfig struct {
|
|||||||
type AlipayConfig struct {
|
type AlipayConfig struct {
|
||||||
Enabled bool // 是否启用该服务
|
Enabled bool // 是否启用该服务
|
||||||
SandBox bool // 是否沙盒环境
|
SandBox bool // 是否沙盒环境
|
||||||
Company string // 公司名称
|
AppId string // 应用 ID
|
||||||
UserId string // 支付宝用户 ID
|
UserId string // 支付宝用户 ID
|
||||||
AppId string // 支付宝 AppID
|
|
||||||
PrivateKey string // 用户私钥文件路径
|
PrivateKey string // 用户私钥文件路径
|
||||||
PublicKey string // 用户公钥文件路径
|
PublicKey string // 用户公钥文件路径
|
||||||
AlipayPublicKey string // 支付宝公钥文件路径
|
AlipayPublicKey string // 支付宝公钥文件路径
|
||||||
|
@ -113,7 +113,7 @@ func (h *PaymentHandler) OrderQuery(c *gin.Context) {
|
|||||||
|
|
||||||
// AlipayQrcode 生成支付宝支付 URL 二维码
|
// AlipayQrcode 生成支付宝支付 URL 二维码
|
||||||
func (h *PaymentHandler) AlipayQrcode(c *gin.Context) {
|
func (h *PaymentHandler) AlipayQrcode(c *gin.Context) {
|
||||||
if !h.App.SysConfig.EnabledAlipay {
|
if !h.App.SysConfig.EnabledAlipay || h.alipayService == nil {
|
||||||
resp.ERROR(c, "当前支付通道已经关闭,请联系管理员开通!")
|
resp.ERROR(c, "当前支付通道已经关闭,请联系管理员开通!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
10
api/main.go
10
api/main.go
@ -195,10 +195,12 @@ func main() {
|
|||||||
fx.Provide(payment.NewAlipayService),
|
fx.Provide(payment.NewAlipayService),
|
||||||
fx.Provide(service.NewSnowflake),
|
fx.Provide(service.NewSnowflake),
|
||||||
fx.Provide(service.NewXXLJobExecutor),
|
fx.Provide(service.NewXXLJobExecutor),
|
||||||
fx.Invoke(func(exec *service.XXLJobExecutor) {
|
fx.Invoke(func(exec *service.XXLJobExecutor, config *types.AppConfig) {
|
||||||
go func() {
|
if config.XXLConfig.Enabled {
|
||||||
log.Fatal(exec.Run())
|
go func() {
|
||||||
}()
|
log.Fatal(exec.Run())
|
||||||
|
}()
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// 注册路由
|
// 注册路由
|
||||||
|
@ -17,7 +17,6 @@ var logger = logger2.GetLogger()
|
|||||||
type XXLJobExecutor struct {
|
type XXLJobExecutor struct {
|
||||||
executor xxl.Executor
|
executor xxl.Executor
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
config *types.XXLConfig
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewXXLJobExecutor(config *types.AppConfig, db *gorm.DB) *XXLJobExecutor {
|
func NewXXLJobExecutor(config *types.AppConfig, db *gorm.DB) *XXLJobExecutor {
|
||||||
@ -35,14 +34,10 @@ func NewXXLJobExecutor(config *types.AppConfig, db *gorm.DB) *XXLJobExecutor {
|
|||||||
xxl.SetLogger(&customLogger{}), //自定义日志
|
xxl.SetLogger(&customLogger{}), //自定义日志
|
||||||
)
|
)
|
||||||
exec.Init()
|
exec.Init()
|
||||||
return &XXLJobExecutor{executor: exec, db: db, config: &config.XXLConfig}
|
return &XXLJobExecutor{executor: exec, db: db}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *XXLJobExecutor) Run() error {
|
func (e *XXLJobExecutor) Run() error {
|
||||||
if !e.config.Enabled {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
e.executor.RegTask("ClearOrder", e.ClearOrder)
|
e.executor.RegTask("ClearOrder", e.ClearOrder)
|
||||||
e.executor.RegTask("ResetVipCalls", e.ResetVipCalls)
|
e.executor.RegTask("ResetVipCalls", e.ResetVipCalls)
|
||||||
return e.executor.Run()
|
return e.executor.Run()
|
||||||
|
1548
database/chatgpt_plus-v3.1.8.sql
Normal file
1548
database/chatgpt_plus-v3.1.8.sql
Normal file
File diff suppressed because it is too large
Load Diff
@ -67,4 +67,23 @@ WeChatBot = false
|
|||||||
Enabled = false
|
Enabled = false
|
||||||
ApiURL = "http://172.22.11.200:7860"
|
ApiURL = "http://172.22.11.200:7860"
|
||||||
ApiKey = ""
|
ApiKey = ""
|
||||||
Txt2ImgJsonPath = "res/text2img.json"
|
Txt2ImgJsonPath = "res/text2img.json"
|
||||||
|
|
||||||
|
[XXLConfig] # xxl-job 配置,需要你部署 XXL-JOB 定时任务工具,用来定期清理未支付订单和清理过期 VIP,如果你没有启用支付服务,则该服务也无需启动
|
||||||
|
Enabled = false # 是否启用 XXL JOB 服务
|
||||||
|
ServerAddr = "http://172.22.11.47:8080/xxl-job-admin" # xxl-job-admin 管理地址
|
||||||
|
ExecutorIp = "172.22.11.47" # 执行器 IP 地址
|
||||||
|
ExecutorPort = "9999" # 执行器服务端口
|
||||||
|
AccessToken = "xxl-job-api-token" # 执行器 API 通信 token
|
||||||
|
RegistryKey = "chatgpt-plus" # 任务注册 key
|
||||||
|
|
||||||
|
[AlipayConfig]
|
||||||
|
Enabled = false # 启用支付宝支付通道
|
||||||
|
SandBox = false # 是否启用沙盒模式
|
||||||
|
UserId = "2088721020750581" # 商户ID
|
||||||
|
AppId = "9021000131658023" # App Id
|
||||||
|
PrivateKey = "certs/alipay/privateKey.txt" # 应用私钥
|
||||||
|
PublicKey = "certs/alipay/appPublicCert.crt" # 应用公钥证书
|
||||||
|
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
|
||||||
|
RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
|
||||||
|
NotifyURL = "http://r9it.com:6004/api/payment/alipay/notify" # 支付异步回调地址
|
Loading…
Reference in New Issue
Block a user