Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(rename): rename function and request

LinkinStard138c372a516
diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.go
index 58ff3730..5747fa9c 100644
--- a/internal/controller/template_controller.go
+++ b/internal/controller/template_controller.go
@@ -133,12 +133,12 @@ func (tc *TemplateController) QuestionInfo(ctx *gin.Context) {
}
// answers
- answerReq := &schema.AnswerList{
- QuestionID: id,
- Order: "",
- Page: 1,
- PageSize: 999,
- LoginUserID: "",
+ answerReq := &schema.AnswerListReq{
+ QuestionID: id,
+ Order: "",
+ Page: 1,
+ PageSize: 999,
+ UserID: "",
}
answers, answerCount, err := tc.templateRenderController.AnswerList(ctx, answerReq)
if err != nil {
diff --git a/internal/controller/template_render/answer.go b/internal/controller/template_render/answer.go
index 1e87144e..7893c108 100644
--- a/internal/controller/template_render/answer.go
+++ b/internal/controller/template_render/answer.go
@@ -2,9 +2,10 @@ package templaterender
import (
"context"
+
"github.com/answerdev/answer/internal/schema"
)
-func (t *TemplateRenderController) AnswerList(ctx context.Context, req *schema.AnswerList) ([]*schema.AnswerInfo, int64, error) {
+func (t *TemplateRenderController) AnswerList(ctx context.Context, req *schema.AnswerListReq) ([]*schema.AnswerInfo, int64, error) {
return t.answerService.SearchList(ctx, req)
}
diff --git a/internal/controller/template_render/question.go b/internal/controller/template_render/question.go
index d4fd30e9..e3fd66ba 100644
--- a/internal/controller/template_render/question.go
+++ b/internal/controller/template_render/question.go
@@ -10,5 +10,5 @@ func (t *TemplateRenderController) Index(ctx *gin.Context, req *schema.QuestionS
}
func (t *TemplateRenderController) QuestionDetail(ctx *gin.Context, id string) (resp *schema.QuestionInfo, err error) {
- return t.questionService.GetQuestion(ctx, id, "", true)
+ return t.questionService.GetQuestion(ctx, id, "", schema.QuestionPermission{})
}
diff --git a/internal/service/rank/rank_service.go b/internal/service/rank/rank_service.go
index 871c62a7..99a7024b 100644
--- a/internal/service/rank/rank_service.go
+++ b/internal/service/rank/rank_service.go
@@ -150,10 +150,10 @@ func (rs *RankService) CheckVotePermission(ctx context.Context, userID, objectID
if !exist {
return can, nil
}
- // administrator have all permissions
- if userInfo.IsAdmin {
- return true, nil
- }
+ // TODO administrator have all permissions
+ //if userInfo.IsAdmin {
+ // return true, nil
+ //}
objectInfo, err := rs.objectInfoService.GetInfo(ctx, objectID)
if err != nil {