新增微信公众平台对接,增加缓存。默认10天
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package Scheme
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"hospital-open-api/extend/weChat"
|
||||
"hospital-open-api/global"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// GetSchemeJumpWxaRequest 跳转到的目标小程序信息
|
||||
@@ -74,5 +77,9 @@ func (r *GetSchemeRequest) GetScheme(userType int) (string, error) {
|
||||
return "", errors.New("失败")
|
||||
}
|
||||
|
||||
// 加入缓存
|
||||
redisKey := "c:official_account.scheme." + r.JumpWxa.Path + "." + r.JumpWxa.Query
|
||||
global.Redis.Set(context.Background(), redisKey, GetSchemeResponse.OpenLink, 60*60*24*10*time.Second)
|
||||
|
||||
return GetSchemeResponse.OpenLink, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user