添加天气Model
authorluozheng <1732036298@qq.com>
Mon, 8 Apr 2024 10:47:14 +0000 (18:47 +0800)
committerluozheng <1732036298@qq.com>
Mon, 8 Apr 2024 10:47:14 +0000 (18:47 +0800)
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp [new file with mode: 0644]

index 7da84c6..fca48d5 100644 (file)
@@ -322,6 +322,7 @@ set(SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/GetWeatherDataErrorView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/WeatherControlView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/WeatherView.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/WeatherModel.cpp
 
     #系统
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemPresenter.cpp                       
diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h
new file mode 100644 (file)
index 0000000..c0cdf22
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-04-08 18:40:20
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-04-08 18:43:28
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h
+ */
+#ifndef WEATHER_MODEL_H
+#define WEATHER_MODEL_H
+
+#include "wearable_log.h"
+namespace OHOS
+{
+    class WeatherModel
+    {
+    public:
+        static WeatherModel &GetInstance(void);
+
+    private:
+        WeatherModel();
+        WeatherModel(const WeatherModel &) = delete;
+        WeatherModel &operator=(const WeatherModel &) = delete;
+        virtual ~WeatherModel();
+    };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
new file mode 100644 (file)
index 0000000..f09e621
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-04-08 18:40:09
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-04-08 18:44:06
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
+ */
+#include "weather/include/WeatherModel.h"
+
+namespace OHOS
+{
+    WeatherModel::WeatherModel()
+    {
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherModel::WeatherModel");
+    }
+
+    WeatherModel::~WeatherModel()
+    {
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherModel::~WeatherModel");
+    }
+
+    WeatherModel &WeatherModel::GetInstance()
+    {
+        static WeatherModel instance;
+        return instance;
+    }
+
+}
\ No newline at end of file