guessQuestion.go 461 B

123456789101112131415161718
  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. return &v1.QuestionRes{Data: model.Question.GetProblem(model.GetScenario(req.Href), 1, g.Config().MustGet(ctx, "chat.usuallyProblem", 5).Int())}, nil
  14. }