分离缓存读取与对后端接口的真是请求逻辑

This commit is contained in:
白茶清欢 2024-10-09 18:48:33 +08:00
parent 4092863a9a
commit 8ef7aea4fe

View File

@ -151,6 +151,16 @@ func (hc *HttpClient) Request() *define.Response {
return cacheResult
}
return hc.requestBackendApi()
}
// requestBackendApi 请求后端接口
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 18:47 2024/10/9
func (hc *HttpClient) requestBackendApi() *define.Response {
hc.Client.OnBeforeRequest(hc.getRequestValidateMiddleware()) // 请求参数验证中间件必注册
hc.Client.OnAfterResponse(hc.getResponseValidateMiddleware()) // 响应验证中间件必注册
var (