diff --git a/calendarmanager/common/calendar_define.h b/calendarmanager/common/calendar_define.h index 7ed2abec2c405fa3f8cbc8e7412b560430ad6956..6eefeb13c389a949a3b867c7ce34e7ab39b84670 100644 --- a/calendarmanager/common/calendar_define.h +++ b/calendarmanager/common/calendar_define.h @@ -81,12 +81,12 @@ struct Event { EventType type; optional location; optional title; - int64_t start; - int64_t end; + int64_t startTime; + int64_t endTime; optional isAllDay; vector attendees; optional timeZone; - optional> remind; + optional> reminderTime; optional recurrenceRule; optional description; optional service; diff --git a/calendarmanager/native/src/native_util.cpp b/calendarmanager/native/src/native_util.cpp index a7860bac3fea2d0225336ea1058b8e0dbeb6b79e..cc935424db587458f825b0380c44f92ddcd75fe4 100644 --- a/calendarmanager/native/src/native_util.cpp +++ b/calendarmanager/native/src/native_util.cpp @@ -38,8 +38,8 @@ void DumpEvent(const Event &event) LOG_DEBUG("location [null]"); } LOG_DEBUG("title :%{public}s", event.title.value_or("").c_str()); - LOG_DEBUG("start :%{public}lu", event.start); - LOG_DEBUG("end :%{public}lu", event.end); + LOG_DEBUG("startTime :%{public}lu", event.startTime); + LOG_DEBUG("endTime :%{public}lu", event.endTime); LOG_DEBUG("isAllDay :%{public}d", event.isAllDay.value_or(0)); for (const auto &attendee : event.attendees) { @@ -58,8 +58,8 @@ DataShare::DataShareValuesBucket BuildValueEvent(const Event &event, int calenda LOG_DEBUG("title %{public}s", event.title.value_or("").c_str()); valuesBucket.Put("title", event.title.value_or("")); - valuesBucket.Put("dtstart", event.start); - valuesBucket.Put("dtend", event.end); + valuesBucket.Put("dtstart", event.startTime); + valuesBucket.Put("dtend", event.endTime); LOG_DEBUG("description %{public}s", event.description.value_or("").c_str()); valuesBucket.Put("description", event.description.value_or("")); diff --git a/calendarmanager/test/unittest/src/event_filter_test.cpp b/calendarmanager/test/unittest/src/event_filter_test.cpp index 561219f209cdfec6176900e1513038eaba363afb..e796985bbbf2cc89fea9991bf788e82ff144cdd0 100644 --- a/calendarmanager/test/unittest/src/event_filter_test.cpp +++ b/calendarmanager/test/unittest/src/event_filter_test.cpp @@ -152,11 +152,11 @@ HWTEST_F(EventFilterTest, FilterByTime_test_001, testing::ext::TestSize.Level1) Event event; event.title = title; auto timeNow = Now(); - event.start = timeNow; - event.end = timeNow + 100000; + event.startTime = timeNow; + event.endTime = timeNow + 100000; auto eventId = calendar->AddEvent(event); ASSERT_TRUE(eventId > 0); - auto events = calendar->GetEvents(FilterByTime(event.start, event.end), {}); + auto events = calendar->GetEvents(FilterByTime(event.startTime, event.endTime), {}); ASSERT_EQ(1, events.size()); EXPECT_EQ(events.at(0).title.value(), title); } @@ -166,14 +166,14 @@ HWTEST_F(EventFilterTest, FilterByTime_test_002, testing::ext::TestSize.Level1) Event event; event.title = "FilterByTime_test_002"; auto timeNow = Now(); - event.start = timeNow; + event.startTime = timeNow; const int64_t interval = 100; - event.end = timeNow + interval; + event.endTime = timeNow + interval; auto eventId = calendar->AddEvent(event); ASSERT_TRUE(eventId > 0); - auto events = calendar->GetEvents(FilterByTime(event.start - interval * 2, event.start - interval), {}); + auto events = calendar->GetEvents(FilterByTime(event.startTime - interval * 2, event.startTime - interval), {}); EXPECT_TRUE(events.empty()); - events = calendar->GetEvents(FilterByTime(event.end + interval, event.end + interval * 2), {}); + events = calendar->GetEvents(FilterByTime(event.endTime + interval, event.endTime + interval * 2), {}); ASSERT_TRUE(events.empty()); } @@ -183,18 +183,18 @@ HWTEST_F(EventFilterTest, FilterByTime_test_003, testing::ext::TestSize.Level1) auto timeNow = Now(); Event event1; event1.title = title1; - event1.start = timeNow; + event1.startTime = timeNow; const int64_t interval = 100; - event1.end = timeNow + interval; + event1.endTime = timeNow + interval; const string title2 = "FilterByTime_test_003_2"; Event event2; event2.title = title2; - event2.start = timeNow; - event2.end = timeNow + interval * 2; + event2.startTime = timeNow; + event2.endTime = timeNow + interval * 2; auto count = calendar->AddEvents({event1, event2}); ASSERT_TRUE(count == 2); - auto events = calendar->GetEvents(FilterByTime(timeNow, event2.end), {}); + auto events = calendar->GetEvents(FilterByTime(timeNow, event2.endTime), {}); ASSERT_EQ(2, events.size()); EXPECT_EQ(events.at(0).title.value(), title1); EXPECT_EQ(events.at(1).title.value(), title2);