package aiSearch import ( "aiChat/api/aiSearch/v1" "app.yhyue.com/moapp/jybase/encrypt" "context" "fmt" "github.com/gogf/gf/v2/frame/g" ) func (c *ControllerV1) LikeAnswer(ctx context.Context, req *v1.LikeAnswerReq) (res *v1.LikeAnswerRes, err error) { id := encrypt.SE.Decode4HexByCheck(fmt.Sprint(req.Cid)) r, err := g.Model("ai_search_chat").Data("like", req.Val).Where("id", id).Update() if err != nil { g.Log().Error(ctx, "点赞失败:%s", err) return nil, err } affected, _ := r.RowsAffected() res = &v1.LikeAnswerRes{ ErrorCode: 0, ErrorMsg: "", Data: affected, } return res, nil }