Removed secret field from types.ShortenReq
				
					
				
			This commit is contained in:
		@@ -19,7 +19,6 @@ type (
 | 
				
			|||||||
type (
 | 
					type (
 | 
				
			||||||
	ShortenReq {
 | 
						ShortenReq {
 | 
				
			||||||
		RedirectUrl string `json:"redirectUrl"`
 | 
							RedirectUrl string `json:"redirectUrl"`
 | 
				
			||||||
		Secret      string `json:"secret,optional"`
 | 
					 | 
				
			||||||
		ExpiresIn   int64  `json:"expiresIn,optional"`
 | 
							ExpiresIn   int64  `json:"expiresIn,optional"`
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@ import "github.com/scylladb/gocqlx/v2/table"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
var UrlTable = table.New(table.Metadata{
 | 
					var UrlTable = table.New(table.Metadata{
 | 
				
			||||||
	Name:    "fivefeeteleven.urls",
 | 
						Name:    "fivefeeteleven.urls",
 | 
				
			||||||
	Columns: []string{"id", "redirect_url", "secret"},
 | 
						Columns: []string{"id", "redirect_url"},
 | 
				
			||||||
	PartKey: []string{"id"},
 | 
						PartKey: []string{"id"},
 | 
				
			||||||
	SortKey: []string{},
 | 
						SortKey: []string{},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -12,5 +12,4 @@ var UrlTable = table.New(table.Metadata{
 | 
				
			|||||||
type UrlModel struct {
 | 
					type UrlModel struct {
 | 
				
			||||||
	Id          string
 | 
						Id          string
 | 
				
			||||||
	RedirectUrl string
 | 
						RedirectUrl string
 | 
				
			||||||
	Secret      *string
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,8 +15,7 @@ func Seed(session gocqlx.Session) error {
 | 
				
			|||||||
	err = session.ExecStmt(`
 | 
						err = session.ExecStmt(`
 | 
				
			||||||
		CREATE TABLE IF NOT EXISTS fivefeeteleven.urls (
 | 
							CREATE TABLE IF NOT EXISTS fivefeeteleven.urls (
 | 
				
			||||||
			id text PRIMARY KEY,
 | 
								id text PRIMARY KEY,
 | 
				
			||||||
			redirect_url text,
 | 
								redirect_url text
 | 
				
			||||||
			secret text
 | 
					 | 
				
			||||||
		)`)
 | 
							)`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,6 @@ func (l *ShortenUrlLogic) ShortenUrl(req *types.ShortenReq) (resp *types.Shorten
 | 
				
			|||||||
	insertUrl.BindStruct(db.UrlModel{
 | 
						insertUrl.BindStruct(db.UrlModel{
 | 
				
			||||||
		Id:          id,
 | 
							Id:          id,
 | 
				
			||||||
		RedirectUrl: req.RedirectUrl,
 | 
							RedirectUrl: req.RedirectUrl,
 | 
				
			||||||
		Secret:      &req.Secret,
 | 
					 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := insertUrl.ExecRelease(); err != nil {
 | 
						if err := insertUrl.ExecRelease(); err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,6 @@ type ExpandResp struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
type ShortenReq struct {
 | 
					type ShortenReq struct {
 | 
				
			||||||
	RedirectUrl string `json:"redirectUrl"`
 | 
						RedirectUrl string `json:"redirectUrl"`
 | 
				
			||||||
	Secret      string `json:"secret,optional"`
 | 
					 | 
				
			||||||
	ExpiresIn   int64  `json:"expiresIn,optional"`
 | 
						ExpiresIn   int64  `json:"expiresIn,optional"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user