File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package utils
22
33import (
44 "fmt"
5- "math/rand"
65 "testing"
76)
87
@@ -66,7 +65,6 @@ func TestIsUrl(t *testing.T) {
6665
6766func TestGetRandomIntInRange (t * testing.T ) {
6867 min , max := 10 , 20
69- rand .Seed (1 )
7068 for i := 0 ; i < 100 ; i ++ {
7169 got := GetRandomIntInRange (min , max )
7270 if got < min || got > max {
Original file line number Diff line number Diff line change 11package model
22
3- import "time"
3+ import (
4+ "time"
5+
6+ "go.mongodb.org/mongo-driver/bson/primitive"
7+ )
48
59type ShortURL struct {
10+ Name string `bson:"name"`
611 Short string `bson:"short"`
712 URL string `bson:"url"`
813 Count int `bson:"count"`
@@ -11,6 +16,14 @@ type ShortURL struct {
1116 UpdatedAt time.Time `bson:"updatedAt"`
1217}
1318
19+ type QrCode struct {
20+ ID primitive.ObjectID `bson:"_id,omitempty"` // MongoDB primary key
21+ Short string `bson:"short"` // Reference to short code or object
22+ Owner string `bson:"owner"`
23+ CreatedAt time.Time `bson:"createdAt"`
24+ UpdatedAt time.Time `bson:"updatedAt"`
25+ }
26+
1427type ShortClick struct {
1528 Short string
1629 Timestamp time.Time
You can’t perform that action at this time.
0 commit comments