Globally renamed Snowflake
to ID
This commit is contained in:
@ -27,7 +27,7 @@ func NewExpandUrlLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExpandU
|
||||
|
||||
func (l *ExpandUrlLogic) ExpandUrl(req *types.ExpandReq) (resp *types.ExpandResp, err error) {
|
||||
queryUrl := db.UrlTable.SelectBuilder("redirect_url").Query(l.svcCtx.DB)
|
||||
queryUrl.BindStruct(db.UrlModel{Id: req.Snowflake})
|
||||
queryUrl.BindStruct(db.UrlModel{ID: req.ID})
|
||||
|
||||
var urls []db.UrlModel
|
||||
if err := queryUrl.Select(&urls); err != nil {
|
||||
|
@ -30,7 +30,7 @@ func (l *ShortenUrlLogic) ShortenUrl(req *types.ShortenReq) (resp *types.Shorten
|
||||
|
||||
insertUrl := db.UrlTable.InsertBuilder().TTL(30 * time.Second).Query(l.svcCtx.DB)
|
||||
insertUrl.BindStruct(db.UrlModel{
|
||||
Id: id,
|
||||
ID: id,
|
||||
RedirectUrl: req.RedirectUrl,
|
||||
})
|
||||
|
||||
@ -39,7 +39,7 @@ func (l *ShortenUrlLogic) ShortenUrl(req *types.ShortenReq) (resp *types.Shorten
|
||||
}
|
||||
|
||||
resp = &types.ShortenResp{
|
||||
Id: id,
|
||||
ID: id,
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user