26 lines
612 B
Go
26 lines
612 B
Go
|
package aiassistant
|
||
|
|
||
|
import (
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"wechat-robot/model/param/aiassistant"
|
||
|
"wechat-robot/pkg/response"
|
||
|
aiAssistantService "wechat-robot/service/aiassistant"
|
||
|
)
|
||
|
|
||
|
// Save
|
||
|
// @description: 保存AI助手
|
||
|
// @param ctx
|
||
|
func Save(ctx *gin.Context) {
|
||
|
var p aiassistant.Save
|
||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||
|
response.New(ctx).SetMsg("参数错误").SetError(err).Fail()
|
||
|
return
|
||
|
}
|
||
|
// 保存数据
|
||
|
if err := aiAssistantService.Save(p); err != nil {
|
||
|
response.New(ctx).SetMsg("保存失败").SetError(err).Fail()
|
||
|
return
|
||
|
}
|
||
|
response.New(ctx).SetMsg("保存成功").Success()
|
||
|
}
|