You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2025/02/19 08:35:57 UTC

(answer) branch test updated: feat(question): add avatar field to question operator

This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git


The following commit(s) were added to refs/heads/test by this push:
     new 607f1d76 feat(question): add avatar field to question operator
607f1d76 is described below

commit 607f1d762b2245e42243d2065f15b171f5d9f68d
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Wed Feb 19 16:34:58 2025 +0800

    feat(question): add avatar field to question operator
---
 internal/schema/question_schema.go           | 1 +
 internal/service/question_common/question.go | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go
index 45de312e..94c26798 100644
--- a/internal/schema/question_schema.go
+++ b/internal/schema/question_schema.go
@@ -440,6 +440,7 @@ type QuestionPageRespOperator struct {
 	Rank        int    `json:"rank"`
 	DisplayName string `json:"display_name"`
 	Status      string `json:"status"`
+	Avatar      string `json:"avatar"`
 }
 
 type AdminQuestionPageReq struct {
diff --git a/internal/service/question_common/question.go b/internal/service/question_common/question.go
index 866f0486..0ca1e616 100644
--- a/internal/service/question_common/question.go
+++ b/internal/service/question_common/question.go
@@ -23,11 +23,12 @@ import (
 	"context"
 	"encoding/json"
 	"fmt"
-	"github.com/apache/answer/internal/service/siteinfo_common"
 	"math"
 	"strings"
 	"time"
 
+	"github.com/apache/answer/internal/service/siteinfo_common"
+
 	"github.com/apache/answer/internal/base/constant"
 	"github.com/apache/answer/internal/base/data"
 	"github.com/apache/answer/internal/base/handler"
@@ -456,6 +457,7 @@ func (qs *QuestionCommon) FormatQuestionsPage(
 				item.Operator.Username = userInfo.Username
 				item.Operator.Rank = userInfo.Rank
 				item.Operator.Status = userInfo.Status
+				item.Operator.Avatar = userInfo.Avatar
 			}
 		}
 	}