feat: Implement batch team owner processing with dedicated upload, configuration, and monitoring pages and backend services.
This commit is contained in:
@@ -52,3 +52,17 @@ func CORS(next http.HandlerFunc) http.HandlerFunc {
|
||||
next(w, r)
|
||||
}
|
||||
}
|
||||
|
||||
// decodeJSON 解析 JSON 响应体
|
||||
func decodeJSON(body interface{}, v interface{}) error {
|
||||
switch b := body.(type) {
|
||||
case []byte:
|
||||
return json.Unmarshal(b, v)
|
||||
default:
|
||||
// 假设是 io.Reader
|
||||
if reader, ok := body.(interface{ Read([]byte) (int, error) }); ok {
|
||||
return json.NewDecoder(reader).Decode(v)
|
||||
}
|
||||
return json.Unmarshal(body.([]byte), v)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user