Use AsyncResp in retrieveUriToDbusMap

Initially, when the change to use AsyncResp everywhere was made, the
retrieveUriToDbusMap was skipped. This commit address that issue, by
adding AsyncResp to retrieveUriToDbusMap.

Tested:
curl -k -H "X-Auth-Token: $token" -X POST
https://${bmc}/redfish/v1/TelemetryService/MetricReportDefinitions/
 -d '{"Id": "lxw1", "Metrics": [{"MetricId": "123",
"MetricProperties": ["/redfish/v1/Chassis/chassis/Power#/Voltages/0
/ReadingVolts"]}], "MetricReportDefinitionType": "OnRequest",
"ReportActions": ["LogToMetricReportsCollection"], "Schedule":
{"RecurrenceInterval": "100"}}'

{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The resource has been created successfully",
      "MessageArgs": [],
      "MessageId": "Base.1.8.1.Created",
      "MessageSeverity": "OK",
      "Resolution": "None"
    }
  ],
  "@odata.id": "/redfish/v1/Chassis/chassis/Power",
  "@odata.type": "#Power.v1_5_2.Power",
  "Id": "Power",
  "Name": "Power",
  "Redundancy": [],
  "Voltages": [
    {
      "@odata.id": "/redfish/v1/Chassis/chassis/Power#/Voltages/0",
      "@odata.type": "#Power.v1_0_0.Voltage",
      "LowerThresholdCritical": 10.8,
      "LowerThresholdNonCritical": 11.16,
      "MaxReadingRange": 12600.0,
      "MemberId": "P12V",
      "MinReadingRange": 11400.0,
      "Name": "P12V",
      "ReadingVolts": 22.930140000000005,
      "Status": {
        "Health": "Critical",
        "State": "Enabled"
      },
      "UpperThresholdCritical": 13.200000000000001,
      "UpperThresholdNonCritical": 12.84
    },
...
The response is too long, so I omitted the following content.

Signed-off-by: zhanghaicheng <zhanghch05@inspur.com>
Change-Id: I6f82bdb234ddade67f689d79d004d672593fba4f
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index a0c4f1d..e0bbd9b 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -391,7 +391,7 @@
                 for (const auto& [chassis, sensorType] : chassisSensors)
                 {
                     retrieveUriToDbusMap(
-                        chassis, sensorType,
+                        asyncResp, chassis, sensorType,
                         [asyncResp, addReportReq](
                             const boost::beast::http::status status,
                             const boost::container::flat_map<
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index f9d806b..d371378 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -2960,9 +2960,10 @@
  * @param node  Node (group) of sensors. See sensors::node for supported values
  * @param mapComplete   Callback to be called with retrieval result
  */
-inline void retrieveUriToDbusMap(const std::string& chassis,
-                                 const std::string& node,
-                                 SensorsAsyncResp::DataCompleteCb&& mapComplete)
+inline void
+    retrieveUriToDbusMap(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                         const std::string& chassis, const std::string& node,
+                         SensorsAsyncResp::DataCompleteCb&& mapComplete)
 {
     auto pathIt = sensors::dbus::paths.find(node);
     if (pathIt == sensors::dbus::paths.end())
@@ -2972,10 +2973,8 @@
         return;
     }
 
-    auto res = std::make_shared<crow::Response>();
-    auto asyncResp = std::make_shared<bmcweb::AsyncResp>(*res);
     auto callback =
-        [res, asyncResp, mapCompleteCb{std::move(mapComplete)}](
+        [asyncResp, mapCompleteCb{std::move(mapComplete)}](
             const boost::beast::http::status status,
             const boost::container::flat_map<std::string, std::string>&
                 uriToDbus) { mapCompleteCb(status, uriToDbus); };