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

27 lines
600 B
Go
Raw Permalink Normal View History

package robot
import (
"github.com/gin-gonic/gin"
robotParam "wechat-robot/model/param/robot"
"wechat-robot/pkg/response"
robotService "wechat-robot/service/robot"
)
// GetAll
// @description: 获取所有机器人
// @param ctx
func GetAll(ctx *gin.Context) {
var p robotParam.GetAll
if err := ctx.ShouldBind(&p); err != nil {
response.New(ctx).SetMsg("参数错误").SetError(err).Fail()
return
}
records, err := robotService.GetAll(p)
if err != nil {
response.New(ctx).SetMsg("数据获取失败").SetError(err).Fail()
return
}
response.New(ctx).SetData(records).Success()
}