27 lines
613 B
Go
27 lines
613 B
Go
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()
|
|
}
|