1
0
forked from lxh/go-wxhelper
go-wxhelper/app/assistant.go
2024-07-04 14:10:46 +08:00

37 lines
773 B
Go

package app
import (
"github.com/gin-gonic/gin"
"go-wechat/common/response"
"go-wechat/config"
"go-wechat/service"
)
// SaveAssistant
// @description: 保存AI助手
// @param ctx
func SaveAssistant(ctx *gin.Context) {
//ctx.String(http.StatusOK, "操作成功")
ctx.Redirect(302, "/assistant.html")
}
// GetAssistants
// @description: 获取AI助手列表
// @param ctx
func GetAssistants(ctx *gin.Context) {
records, err := service.GetAllAiAssistant()
if err != nil {
response.New(ctx).SetMsg("系统错误").SetError(err).Fail()
return
}
response.New(ctx).SetData(records).Success()
}
// GetAiModels
// @description: 获取AI模型列表
// @param ctx
func GetAiModels(ctx *gin.Context) {
response.New(ctx).SetData(config.Conf.Ai.Models).Success()
}