修正部分API授权

This commit is contained in:
GeekMaster
2025-08-31 10:52:25 +08:00
parent 9254b8fafe
commit 52313fc7f6
16 changed files with 90 additions and 90 deletions

View File

@@ -55,7 +55,7 @@ type ChatInput struct {
Stream bool `json:"stream"`
Files []vo.File `json:"files"`
ChatModel model.ChatModel `json:"chat_model,omitempty"`
ChatRole model.ChatRole `json:"chat_role,omitempty"`
ChatRole model.ChatApp `json:"chat_role,omitempty"`
LastMsgId uint `json:"last_msg_id,omitempty"` // 最后的消息ID用于重新生成答案的时候过滤上下文
}
@@ -136,7 +136,7 @@ func (h *ChatHandler) Chat(c *gin.Context) {
}
// 验证聊天角色
var chatRole model.ChatRole
var chatRole model.ChatApp
err := h.DB.First(&chatRole, input.RoleId).Error
if err != nil || !chatRole.Enable {
pushMessage(c, ChatEventError, "当前聊天角色不存在或者未启用,请更换角色之后再发起对话!")