From ef4ff60e37e0e2c8c6ddd8ee8bafd1bbf2cda324 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 13 May 2021 20:08:51 +0200 Subject: [PATCH] changed date format and add numbers to user hashtag generator --- routers/api/v1/user/user.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index 308c6fb..a5df394 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -104,7 +104,7 @@ func NewUser(c *fiber.Ctx) error { } user_id := strings.Replace(uuid.New().String(), "-", "", -1) - created := time.Now().Format("2006-02-01 15:04:05") + created := time.Now().Format("2006-01-02 15:04:05") // YYYY-MM-DD hh:mm:ss stmt, err := db.Prepare("INSERT INTO users (user_id, user_hashtag, username, email, password, created) VALUES (?, ?, ?, ?, ?, ?);") stmt.Exec(user_id, input.Hashtag, input.Username, input.Email, hashedPassword, created) @@ -117,12 +117,13 @@ func NewUser(c *fiber.Ctx) error { } func RandomHashtag(db *sql.DB, n int) string { + fmt.Println("gen Randomhashtag") c := make(chan bool) var s string for { su := shortuuid.NewShortUUID() - su.SetAlphabet("ABCDEFGHJKLMNPQRSTUVWXYZ") + su.SetAlphabet("ABCDEFGHJKLMNPQRSTUVWXYZ0123456789") s = su.Random(n) go func() {