Files
sundynix-micro-be/app/plant/api/internal/handler/ai/clearaichathistoryhandler.go
T
2026-05-23 13:55:05 +08:00

26 lines
569 B
Go

// 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 ClearAiChatHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := ai.NewClearAiChatHistoryLogic(r.Context(), svcCtx)
err := l.ClearAiChatHistory()
if err != nil {
response.Fail(w, err.Error())
} else {
response.Ok(w)
}
}
}