| 623 | } |
| 624 | |
| 625 | func (qs *QuestionCommon) SetCache(ctx context.Context, cachekey string, info any) error { |
| 626 | infoStr, err := json.Marshal(info) |
| 627 | if err != nil { |
| 628 | return errors.InternalServer(reason.UnknownError).WithError(err).WithStack() |
| 629 | } |
| 630 | |
| 631 | err = qs.data.Cache.SetString(ctx, cachekey, string(infoStr), schema.DashboardCacheTime) |
| 632 | if err != nil { |
| 633 | return errors.InternalServer(reason.UnknownError).WithError(err).WithStack() |
| 634 | } |
| 635 | return nil |
| 636 | } |
| 637 | |
| 638 | func (qs *QuestionCommon) ShowListFormat(ctx context.Context, data *entity.Question) *schema.QuestionInfoResp { |
| 639 | return qs.ShowFormat(ctx, data) |