guessQuestion.go 477 B

1234567891011121314151617181920
  1. package controller
  2. import (
  3. v1 "aiChat/api/v1"
  4. "aiChat/internal/model"
  5. "context"
  6. "github.com/gogf/gf/v2/frame/g"
  7. )
  8. var (
  9. GuessQuestion = cGuessQuestion{}
  10. )
  11. type cGuessQuestion struct{}
  12. func (c *cGuessQuestion) Method(ctx context.Context, req *v1.GuessQuestionReq) (res *v1.QuestionRes, err error) {
  13. var list []string
  14. list, err = model.Question.GetGuessQuestion(ctx, g.Config().MustGet(ctx, "chat.usuallyProblem", 5).Int())
  15. return &v1.QuestionRes{Data: list}, nil
  16. }