2022-09-07 23:34:37 +08:00
|
|
|
package debug
|
|
|
|
|
|
|
|
import (
|
2023-07-14 21:47:11 +08:00
|
|
|
"git.0x7f.app/WOJ/woj-server/internal/e"
|
|
|
|
"git.0x7f.app/WOJ/woj-server/pkg/utils"
|
2022-09-07 23:34:37 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
2023-12-22 15:19:13 +08:00
|
|
|
// RandomString
|
|
|
|
// @Summary generate random string
|
|
|
|
// @Description Generate random string with length = 32.
|
2022-09-07 23:34:37 +08:00
|
|
|
// @Tags debug
|
|
|
|
// @Produce json
|
2023-12-22 15:19:13 +08:00
|
|
|
// @Response 200 {object} e.Response[string] "random string"
|
2022-09-07 23:34:37 +08:00
|
|
|
// @Router /debug/random [get]
|
2023-12-22 15:19:13 +08:00
|
|
|
func (h *handler) RandomString(c *gin.Context) {
|
2022-09-07 23:34:37 +08:00
|
|
|
str := utils.RandomString(32)
|
|
|
|
h.log.Info("random string", zap.String("str", str))
|
|
|
|
e.Pong(c, e.Success, str)
|
|
|
|
}
|