作者 yangfu

Merge branch 'dev' into test

... ... @@ -32,7 +32,7 @@ func NewMiniQrcodeInviteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
func (l *MiniQrcodeInviteLogic) MiniQrcodeInvite(req *types.MiniQrCodeRequest) (resp interface{}, err error) {
var (
q = l.svcCtx.MiniProgram.GetQRCode()
q = l.svcCtx.GetMiniProgram().GetQRCode()
cacheData = fmt.Sprintf("%s?%s", req.Page, req.Scene)
cacheKey = fmt.Sprintf("%s:qrcode:%s", l.svcCtx.Config.Name, tool.Md5ByString(cacheData))
ok bool
... ...
... ... @@ -109,3 +109,13 @@ func NewServiceContext(c config.Config) *ServiceContext {
func (svc *ServiceContext) DefaultDBConn() transaction.Conn {
return transaction.NewTransactionContext(svc.DB)
}
func (svc *ServiceContext) GetMiniProgram() *miniprogram.MiniProgram {
c := svc.Config
miniProgram := wechat.NewWechat().GetMiniProgram(&miniConfig.Config{
AppID: c.Wechat.AppID,
AppSecret: c.Wechat.AppSecret,
Cache: minicache.NewMemory(),
})
return miniProgram
}
... ...