From 9689cc7cce47cc3ece99a903b9a978cdf29c70e0 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 8 Apr 2024 18:47:14 +0800 Subject: [PATCH] =?utf8?q?=E6=B7=BB=E5=8A=A0=E5=A4=A9=E6=B0=94Model?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/fd230app/CMakeLists.txt | 1 + .../nativeui/weather/include/WeatherModel.h | 28 +++++++++++++++++++ .../nativeui/weather/src/WeatherModel.cpp | 28 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index 7da84c61a..fca48d5ea 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -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 index 000000000..c0cdf226a --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h @@ -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 index 000000000..f09e621a5 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp @@ -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 -- 2.17.1