Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records authored and LinkinStars committed Nov 29, 2023
1 parent 9dc0d56 commit 7aa16f2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/service/question_common/question.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,11 @@ func (qs *QuestionCommon) ShowListFormat(ctx context.Context, data *entity.Quest
}

func (qs *QuestionCommon) ShowFormat(ctx context.Context, data *entity.Question) *schema.QuestionInfo {
var ID = data.ID
info := schema.QuestionInfo{}
info.ID = data.ID
if handler.GetEnableShortID(ctx) {
ID = uid.EnShortID(data.ID)
info.ID = uid.EnShortID(data.ID)
}

info := schema.QuestionInfo{}
info.ID = ID
info.Title = data.Title
info.UrlTitle = htmltext.UrlTitle(data.Title)
info.Content = data.OriginalText
Expand Down

0 comments on commit 7aa16f2

Please sign in to comment.