You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: user_badge.go
    path of file: ./repos/gitea/routers/api/v1/admin
    
    the code of the file until where you have to start completion: // Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package admin

import (
	"net/http"

	user_model "code.gitea.io/gitea/models/user"
	api "code.gitea.io/gitea/modules/structs"
	"code.gitea.io/gitea/modules/web"
	"code.gitea.io/gitea/services/context"
)

// ListUserBadges lists all badges belonging to a user
func ListUserBadges(ctx *context.APIContext) {
	// swagger:operation GET /admin/users/{username}/badges admin adminListUserBadges
	// ---
	// summary: List a user's badges
	// produces:
	// - application/json
	// parameters:
	// - name: username
	//   in: path
	//  
    
func ListUserBadges(ctx *context.APIContext) {
	// swagger:operation GET /admin/users/{username}/badges admin adminListUserBadges
	// ---
	// summary: List a user's badges
	// produces:
	// - application/json
	// parameters:
	// - name: username
	//   in: path
	//   description: username of user
	//   type: string
	//   required: true
	// responses:
	//   "200":
	//     "$ref": "#/responses/BadgeList"
	//   "404":
	//     "$ref": "#/responses/notFound"

	badges, maxResults, err := user_model.GetUserBadges(ctx, ctx.ContextUser)
	if err != nil {
		ctx.Error(http.StatusInternalServerError, "GetUserBadges", err)
		return
	}

	ctx.SetTotalCountHeader(maxResults)
	ctx.JSON(http.StatusOK, &badges)
}