package app

import (
	v1 "git.echol.cn/loser/st/server/api/v1"
	"git.echol.cn/loser/st/server/middleware"
	"github.com/gin-gonic/gin"
)

type ConversationRouter struct{}

// InitConversationRouter 初始化对话路由
func (r *ConversationRouter) InitConversationRouter(Router *gin.RouterGroup) {
	conversationRouter := Router.Group("conversation").Use(middleware.AppJWTAuth())
	conversationApi := v1.ApiGroupApp.AppApiGroup.ConversationApi

	{
		conversationRouter.POST("", conversationApi.CreateConversation)                    // 创建对话
		conversationRouter.GET("", conversationApi.GetConversationList)                    // 获取对话列表
		conversationRouter.GET(":id", conversationApi.GetConversationByID)                 // 获取对话详情
		conversationRouter.PUT(":id/settings", conversationApi.UpdateConversationSettings) // 更新对话设置
		conversationRouter.DELETE(":id", conversationApi.DeleteConversation)               // 删除对话
		conversationRouter.GET(":id/messages", conversationApi.GetMessageList)             // 获取消息列表
		conversationRouter.POST(":id/message", conversationApi.SendMessage)                // 发送消息
		conversationRouter.POST(":id/regenerate", conversationApi.RegenerateMessage)       // 重新生成消息
	}
}
