// Code scaffolded by goctl. Safe to edit.
// goctl 1.10.1

package ai

import (
	"net/http"

	"sundynix-micro-go/app/plant/api/internal/logic/ai"
	"sundynix-micro-go/app/plant/api/internal/svc"
	"sundynix-micro-go/common/response"
)

// 聊天历史
func GetAiChatHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := ai.NewGetAiChatHistoryLogic(r.Context(), svcCtx)
		resp, err := l.GetAiChatHistory()
		if err != nil {
			response.Fail(w, err.Error())
		} else {
			response.OkWithData(w, resp)
		}
	}
}
