go-wxhelper/api/admin/aiassistant/select.go

27 lines
613 B
Go
Raw Permalink Normal View History

2024-02-02 17:30:11 +08:00
package aiassistant
import (
"github.com/gin-gonic/gin"
"wechat-robot/model/param/aiassistant"
"wechat-robot/pkg/response"
aiAssistantService "wechat-robot/service/aiassistant"
)
// GetAll
// @description: 获取所有AI助手
// @param ctx
func GetAll(ctx *gin.Context) {
var p aiassistant.GetAll
if err := ctx.ShouldBind(&p); err != nil {
response.New(ctx).SetMsg("参数错误").SetError(err).Fail()
return
}
records, err := aiAssistantService.GetAll(p)
if err != nil {
response.New(ctx).SetMsg("获取失败").SetError(err).Fail()
return
}
response.New(ctx).SetData(records).Success()
}