woj-server/internal/api/debug/random.go

22 lines
574 B
Go

package debug
import (
"git.0x7f.app/WOJ/woj-server/internal/e"
"git.0x7f.app/WOJ/woj-server/pkg/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// RandomString
// @Summary generate random string
// @Description Generate random string with length = 32.
// @Tags debug
// @Produce json
// @Response 200 {object} e.Response[string] "random string"
// @Router /debug/random [get]
func (h *handler) RandomString(c *gin.Context) {
str := utils.RandomString(32)
h.log.Info("random string", zap.String("str", str))
e.Pong(c, e.Success, str)
}