新版本,代理功能上线
This commit is contained in:
@@ -68,7 +68,7 @@ func (w *WestDexService) ProcessRequests(data interface{}, requests []types.West
|
||||
mutex := sync.Mutex{}
|
||||
encryptedFields, err := w.EncryptStructFields(data)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("西部请求, 生成请求数据失败: %+v", err)
|
||||
return nil, fmt.Errorf("西部请求, 生成请求数据失败: %v", err)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background()) // 创建 context
|
||||
@@ -135,13 +135,13 @@ func (w *WestDexService) ProcessRequests(data interface{}, requests []types.West
|
||||
wg.Wait() // 等待所有 goroutine 完成
|
||||
|
||||
if errorCount >= errorLimit {
|
||||
return nil, fmt.Errorf("请求失败次数超过 %d 次: %+v", errorLimit, errorsCh)
|
||||
return nil, fmt.Errorf("请求失败次数超过 %d 次: %v", errorLimit, errorsCh)
|
||||
}
|
||||
|
||||
// 将 responseData 转换为 JSON
|
||||
combinedResponse, err := json.Marshal(responseData)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("响应数据转 JSON 失败: %+v", err)
|
||||
return nil, fmt.Errorf("响应数据转 JSON 失败: %v", err)
|
||||
}
|
||||
|
||||
return combinedResponse, nil
|
||||
|
||||
Reference in New Issue
Block a user