go-wxhelper/app/assistant.go

37 lines
773 B
Go
Raw Permalink Normal View History

2024-06-18 17:02:37 +08:00
package app
import (
"github.com/gin-gonic/gin"
2024-07-04 14:10:46 +08:00
"go-wechat/common/response"
"go-wechat/config"
"go-wechat/service"
2024-06-18 17:02:37 +08:00
)
// SaveAssistant
// @description: 保存AI助手
// @param ctx
func SaveAssistant(ctx *gin.Context) {
//ctx.String(http.StatusOK, "操作成功")
ctx.Redirect(302, "/assistant.html")
}
2024-07-04 14:10:46 +08:00
// 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()
}