Files
tyapi-server/internal/domains/api/services/processors/response.go
2026-05-29 20:13:12 +08:00

16 lines
351 B
Go

package processors
import (
"encoding/json"
"errors"
)
// MarshalRawResponse 将上游原始响应数据序列化后返回(格式不符合预期时使用)。
func MarshalRawResponse(data interface{}) ([]byte, error) {
respBytes, err := json.Marshal(data)
if err != nil {
return nil, errors.Join(ErrSystem, err)
}
return respBytes, nil
}