File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import (
3333 "github.com/apache/answer/internal/service/comment"
3434 "github.com/apache/answer/internal/service/permission"
3535 "github.com/apache/answer/internal/service/rank"
36+ "github.com/apache/answer/pkg/uid"
3637 "github.com/gin-gonic/gin"
3738 "github.com/segmentfault/pacman/errors"
3839)
@@ -85,6 +86,7 @@ func (cc *CommentController) AddComment(ctx *gin.Context) {
8586 cc .rateLimitMiddleware .DuplicateRequestClear (ctx , rejectKey )
8687 }
8788 }()
89+ req .ObjectID = uid .DeShortID (req .ObjectID )
8890 req .UserID = middleware .GetLoginUserIDFromContext (ctx )
8991
9092 canList , err := cc .rankService .CheckOperationPermissions (ctx , req .UserID , []string {
@@ -243,6 +245,8 @@ func (cc *CommentController) GetCommentWithPage(ctx *gin.Context) {
243245 if handler .BindAndCheck (ctx , req ) {
244246 return
245247 }
248+ req .ObjectID = uid .DeShortID (req .ObjectID )
249+ req .CommentID = uid .DeShortID (req .CommentID )
246250 req .UserID = middleware .GetLoginUserIDFromContext (ctx )
247251 canList , err := cc .rankService .CheckOperationPermissions (ctx , req .UserID , []string {
248252 permission .CommentEdit ,
You can’t perform that action at this time.
0 commit comments