- 新增 Release 方法,用于释放 GLM 客户端连接 - 优化 GlmClientHub 结构,改用 Idle 和 Active 字段 - 更新相关路由和验证器注册 - 调整初始化逻辑,确保正确设置 Idle 和 Active 数量
28 lines
690 B
Go
28 lines
690 B
Go
package rag
|
|
|
|
import (
|
|
"catface/app/global/consts"
|
|
"catface/app/http/controller/web"
|
|
"catface/app/http/validator/core/data_transfer"
|
|
"catface/app/utils/response"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Release struct {
|
|
Token string `form:"token" json:"token"`
|
|
}
|
|
|
|
func (r Release) CheckParams(context *gin.Context) {
|
|
if err := context.ShouldBind(&r); err != nil {
|
|
response.ValidatorError(context, err)
|
|
return
|
|
}
|
|
extraAddBindDataContext := data_transfer.DataAddContext(r, consts.ValidatorPrefix, context)
|
|
if extraAddBindDataContext == nil {
|
|
response.ErrorSystem(context, "RAG RELEASE 表单验证器json化失败", "")
|
|
} else {
|
|
(&web.Rag{}).Release(extraAddBindDataContext)
|
|
}
|
|
}
|