From 1e85f74fd87f2ad0d0af11e246a622bcb4c968c7 Mon Sep 17 00:00:00 2001 From: Leonard Wang <43537346+WangLeonard@users.noreply.github.com> Date: Thu, 3 Sep 2020 08:34:11 +0800 Subject: [PATCH] fix shorturl example code (#35) --- example/shorturl/api/internal/logic/expandlogic.go | 4 +++- example/shorturl/api/internal/logic/shortenlogic.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/example/shorturl/api/internal/logic/expandlogic.go b/example/shorturl/api/internal/logic/expandlogic.go index 071f1cd7..83dd0069 100644 --- a/example/shorturl/api/internal/logic/expandlogic.go +++ b/example/shorturl/api/internal/logic/expandlogic.go @@ -10,12 +10,14 @@ import ( ) type ExpandLogic struct { - ctx context.Context + svcCtx *svc.ServiceContext + ctx context.Context logx.Logger } func NewExpandLogic(ctx context.Context, svcCtx *svc.ServiceContext) ExpandLogic { return ExpandLogic{ + svcCtx: svcCtx, ctx: ctx, Logger: logx.WithContext(ctx), } diff --git a/example/shorturl/api/internal/logic/shortenlogic.go b/example/shorturl/api/internal/logic/shortenlogic.go index e386b373..daf42c40 100644 --- a/example/shorturl/api/internal/logic/shortenlogic.go +++ b/example/shorturl/api/internal/logic/shortenlogic.go @@ -10,12 +10,14 @@ import ( ) type ShortenLogic struct { - ctx context.Context + svcCtx *svc.ServiceContext + ctx context.Context logx.Logger } func NewShortenLogic(ctx context.Context, svcCtx *svc.ServiceContext) ShortenLogic { return ShortenLogic{ + svcCtx: svcCtx, ctx: ctx, Logger: logx.WithContext(ctx), }