feat: ahora puede generar numeros negativos

This commit is contained in:
2026-03-21 17:21:59 -03:00
parent 018e361f4e
commit fa72a03782

View File

@@ -40,7 +40,7 @@ func CrearUrl(longURL string, db *gorm.DB) (string, error) {
var url models.Url
for {
url.Shorturl = rand.Int64()
url.Shorturl = int64(rand.Uint64())
result = db.Model(&models.Url{}).Where("shorturl = ?", url.Shorturl).Count(&counturl)
if result.Error != nil {
return "", result.Error