MergeTag merge tag @Summary merge tag @Description merge tag @Security ApiKeyAuth @Tags Tag @Accept json @Produce json @Param data body schema.AddTagReq true "tag" @Success 200 {object} handler.RespBody @Router /answer/api/v1/tag/merge [post]
(ctx *gin.Context)
| 368 | // @Success 200 {object} handler.RespBody |
| 369 | // @Router /answer/api/v1/tag/merge [post] |
| 370 | func (tc *TagController) MergeTag(ctx *gin.Context) { |
| 371 | req := &schema.MergeTagReq{} |
| 372 | if handler.BindAndCheck(ctx, req) { |
| 373 | return |
| 374 | } |
| 375 | |
| 376 | isAdminModerator := middleware.GetUserIsAdminModerator(ctx) |
| 377 | if !isAdminModerator { |
| 378 | handler.HandleResponse(ctx, errors.Forbidden(reason.RankFailToMeetTheCondition), nil) |
| 379 | return |
| 380 | } |
| 381 | |
| 382 | req.UserID = middleware.GetLoginUserIDFromContext(ctx) |
| 383 | err := tc.tagService.MergeTag(ctx, req) |
| 384 | |
| 385 | handler.HandleResponse(ctx, err, nil) |
| 386 | } |
nothing calls this directly
no test coverage detected