remove print log and uuid generate
This commit is contained in:
parent
8a0cc68a22
commit
cff64975d7
@ -10,9 +10,7 @@ const (
|
|||||||
ContextUser ctxKey = "context_user"
|
ContextUser ctxKey = "context_user"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var secureCookie *securecookie.SecureCookie
|
||||||
secureCookie *securecookie.SecureCookie
|
|
||||||
)
|
|
||||||
|
|
||||||
type ctxKey string
|
type ctxKey string
|
||||||
|
|
||||||
@ -22,8 +20,7 @@ type Authorize struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func genId() string {
|
func genId() string {
|
||||||
id, _ := uuid.NewRandom()
|
return uuid.Must(uuid.NewRandom()).String()
|
||||||
return id.String()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetSecureCookie(sc *securecookie.SecureCookie) {
|
func SetSecureCookie(sc *securecookie.SecureCookie) {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package handler
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"log"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -36,8 +35,6 @@ func CreateShortUrl(templates fs.FS, store db.Store) http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println(shortUrl)
|
|
||||||
|
|
||||||
_, err = store.CreateUserUrl(ctx, &db.CreateUserUrlParams{
|
_, err = store.CreateUserUrl(ctx, &db.CreateUserUrlParams{
|
||||||
UserID: user.ID,
|
UserID: user.ID,
|
||||||
ShortUrl: shortUrl,
|
ShortUrl: shortUrl,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user