缓存实例挂载到reqConfig上, 无需单独传入

This commit is contained in:
2025-05-07 11:17:15 +08:00
parent 1ca3c2d094
commit f1a65c1ed8
2 changed files with 19 additions and 21 deletions

View File

@ -9,6 +9,7 @@ package define
import (
"context"
"git.zhangdeman.cn/zhangdeman/network/httpclient/cache"
"github.com/go-resty/resty/v2"
"go.uber.org/zap"
)
@ -40,6 +41,7 @@ type Request struct {
RetryRule *RequestRetryRule `json:"retry_rule"` // 重试规则
Logger *zap.Logger `json:"-"` // 日志记录器
RateLimiter resty.RateLimiter `json:"-"` // 流控实例
CacheInstance cache.ICache `json:"-"` // 数据结果缓存实例
}
// RequestRetryRule 重试规则