feat: ahora puede generar numeros negativos
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user