int gradeID = 216;
auto lessons = ms::LessonManager::getInstance().getAllLessonsByGrade(gradeID);
std::string data = "LESSON ID,CATEGORY ID,LESSON NAME,SHORT DYNAMIC LINKS,DEEP LINKS,DEEP LINKS NAME";
data += "\n";
for (auto lesson : lessons) {
std::string name = lesson.name;
mj::helper::replace_string_all(name, ",", "_");
std::string shortDynamicLink = StringUtils::format("https://monkeystories.page.link/lesrc%d", lesson.lesson_id);
std::string deeplink = StringUtils::format("https://monkeystories.vn/qrrc?grade=%d&id=%d", gradeID, lesson.lesson_id);
std::string deeplinkName = StringUtils::format("Reading Comprehension - %d - %s", lesson.lesson_id, name.c_str());
data += (StringUtils::format("%d,%d,%s,%s,%s,%s\n", lesson.lesson_id, gradeID, name.c_str(), shortDynamicLink.c_str(), deeplink.c_str(), deeplinkName.c_str()));
}
FileUtils::getInstance()->writeStringToFile(data, FileUtils::getInstance()->getWritablePath() + "/hihi2.csv");
// auto popularStories = StoryDataModel::getInstance()->getAllStoriesByLanguage(LANGUAGE_MANAGER->getCurrentLangId());
// std::string data = "ID[THEO NGON NGU],STORY ID,STORY NAME,SHORT DYNAMIC LINKS,DEEP LINKS,DEEP LINKS NAME";
// data += "\n";
// for (auto story : popularStories) {
//
// std::string name = story.name;
//
// mj::helper::replace_string_all(name, ",", "_");
//
//
// std::string shortDynamicLink = StringUtils::format("https://monkeystories.page.link/story%d", story.story_id);
// std::string deeplink = StringUtils::format("https://monkeystories.vn/qrstory?id=%d", story.unique_id);
// std::string deeplinkName = StringUtils::format("Story - %s - %d", name.c_str(), story.story_id);
//
// data += (StringUtils::format("%d,%d,%s,%s,%s,%s\n", story.unique_id, story.story_id, name.c_str(), shortDynamicLink.c_str(), deeplink.c_str(), deeplinkName.c_str()));
// }
//
//FileUtils::getInstance()->writeStringToFile(data, FileUtils::getInstance()->getWritablePath() + "/hihi2.csv");