mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 02:03:42 +08:00
add prompt translating function for mobile midjourney page
This commit is contained in:
@@ -124,10 +124,9 @@ func (h *ChatHandler) Clear(c *gin.Context) {
|
||||
// History 获取聊天历史记录
|
||||
func (h *ChatHandler) History(c *gin.Context) {
|
||||
chatId := c.Query("chat_id") // 会话 ID
|
||||
userId := h.GetLoginUserId(c)
|
||||
var items []model.ChatMessage
|
||||
var messages = make([]vo.HistoryMessage, 0)
|
||||
res := h.db.Where("user_id = ? AND chat_id = ?", userId, chatId).Find(&items)
|
||||
res := h.db.Debug().Where("chat_id = ?", chatId).Find(&items)
|
||||
if res.Error != nil {
|
||||
resp.ERROR(c, "No history message")
|
||||
return
|
||||
|
||||
@@ -276,6 +276,7 @@ func (h *ChatHandler) sendOpenAiMessage(
|
||||
var res types.ApiError
|
||||
err = json.Unmarshal(body, &res)
|
||||
if err != nil {
|
||||
logger.Debug(string(body))
|
||||
return fmt.Errorf("error with decode response: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user