diff --git a/5feet11.api b/5feet11.api index 73c486e..fadb37b 100644 --- a/5feet11.api +++ b/5feet11.api @@ -19,7 +19,6 @@ type ( type ( ShortenReq { RedirectUrl string `json:"redirectUrl"` - Secret string `json:"secret,optional"` ExpiresIn int64 `json:"expiresIn,optional"` } diff --git a/internal/db/models.go b/internal/db/models.go index 3948e55..1d805e8 100644 --- a/internal/db/models.go +++ b/internal/db/models.go @@ -4,7 +4,7 @@ import "github.com/scylladb/gocqlx/v2/table" var UrlTable = table.New(table.Metadata{ Name: "fivefeeteleven.urls", - Columns: []string{"id", "redirect_url", "secret"}, + Columns: []string{"id", "redirect_url"}, PartKey: []string{"id"}, SortKey: []string{}, }) @@ -12,5 +12,4 @@ var UrlTable = table.New(table.Metadata{ type UrlModel struct { Id string RedirectUrl string - Secret *string } diff --git a/internal/db/seed.go b/internal/db/seed.go index 19a149a..33ae8d8 100644 --- a/internal/db/seed.go +++ b/internal/db/seed.go @@ -15,8 +15,7 @@ func Seed(session gocqlx.Session) error { err = session.ExecStmt(` CREATE TABLE IF NOT EXISTS fivefeeteleven.urls ( id text PRIMARY KEY, - redirect_url text, - secret text + redirect_url text )`) if err != nil { diff --git a/internal/logic/shortenurllogic.go b/internal/logic/shortenurllogic.go index 44d791c..cb39408 100644 --- a/internal/logic/shortenurllogic.go +++ b/internal/logic/shortenurllogic.go @@ -32,7 +32,6 @@ func (l *ShortenUrlLogic) ShortenUrl(req *types.ShortenReq) (resp *types.Shorten insertUrl.BindStruct(db.UrlModel{ Id: id, RedirectUrl: req.RedirectUrl, - Secret: &req.Secret, }) if err := insertUrl.ExecRelease(); err != nil { diff --git a/internal/types/types.go b/internal/types/types.go index 8160603..dd20cbb 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -11,7 +11,6 @@ type ExpandResp struct { type ShortenReq struct { RedirectUrl string `json:"redirectUrl"` - Secret string `json:"secret,optional"` ExpiresIn int64 `json:"expiresIn,optional"` }