-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Infrastructure] Splitted the genshin_service.dart into multiple smal…
…l chunks x2
- Loading branch information
Showing
14 changed files
with
254 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class ArtifactFileService implements BaseFileService { | ||
List<ArtifactCardModel> getArtifactsForCard({ArtifactType? type}); | ||
|
||
ArtifactCardModel getArtifactForCard(String key); | ||
|
||
ArtifactFileModel getArtifact(String key); | ||
|
||
List<ArtifactCardBonusModel> getArtifactBonus(TranslationArtifactFile translation); | ||
|
||
List<String> getArtifactRelatedParts(String fullImagePath, String image, int bonus); | ||
|
||
String getArtifactRelatedPart(String fullImagePath, String image, int bonus, ArtifactType type); | ||
|
||
List<StatType> generateSubStatSummary(List<CustomBuildArtifactModel> artifacts); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class BannerHistoryFileService implements BaseFileService { | ||
List<double> getBannerHistoryVersions(SortDirectionType type); | ||
|
||
List<BannerHistoryItemModel> getBannerHistory(BannerHistoryItemType type); | ||
|
||
List<BannerHistoryPeriodModel> getBanners(double version); | ||
|
||
List<ItemReleaseHistoryModel> getItemReleaseHistory(String itemKey); | ||
|
||
List<ChartElementItemModel> getElementsForCharts(double fromVersion, double untilVersion); | ||
|
||
List<ChartTopItemModel> getTopCharts(bool mostReruns, ChartType type, BannerHistoryItemType bannerType, List<ItemCommonWithName> items); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
abstract class BaseFileService { | ||
Future<void> init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class CharacterFileService extends BaseFileService { | ||
List<CharacterCardModel> getCharactersForCard(); | ||
|
||
CharacterCardModel getCharacterForCard(String key); | ||
|
||
CharacterFileModel getCharacter(String key); | ||
|
||
List<TierListRowModel> getDefaultCharacterTierList(List<int> colors); | ||
|
||
List<ItemCommon> getCharacterForItemsUsingWeapon(String key); | ||
|
||
List<ItemCommon> getCharacterForItemsUsingArtifact(String key); | ||
|
||
List<ItemCommon> getCharacterForItemsUsingMaterial(String key); | ||
|
||
List<String> getUpcomingCharactersKeys(); | ||
|
||
List<CharacterSkillStatModel> getCharacterSkillStats(List<CharacterFileSkillStatModel> skillStats, List<String> statsTranslations); | ||
|
||
List<ChartBirthdayMonthModel> getCharacterBirthdaysForCharts(); | ||
|
||
List<ChartCharacterRegionModel> getCharacterRegionsForCharts(); | ||
|
||
List<ChartGenderModel> getCharacterGendersForCharts(); | ||
|
||
ChartGenderModel getCharacterGendersByRegionForCharts(RegionType regionType); | ||
|
||
List<ItemCommonWithName> getCharactersForItemsByRegion(RegionType regionType); | ||
|
||
List<ItemCommonWithName> getCharactersForItemsByRegionAndGender(RegionType regionType, bool onlyFemales); | ||
|
||
List<CharacterBirthdayModel> getCharacterBirthdays({int? month, int? day}); | ||
|
||
List<TodayCharAscensionMaterialsModel> getCharacterAscensionMaterials(int day); | ||
|
||
int countByStatType(StatType statType); | ||
|
||
List<ItemCommonWithName> getItemCommonWithNameByRarity(int rarity); | ||
|
||
List<ItemCommonWithName> getItemCommonWithNameByStatType(StatType statType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class ElementFileService implements BaseFileService { | ||
List<ElementCardModel> getElementDebuffs(); | ||
|
||
List<ElementReactionCardModel> getElementReactions(); | ||
|
||
List<ElementReactionCardModel> getElementResonances(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export 'artifact_file_service.dart'; | ||
export 'banner_history_file_service.dart'; | ||
export 'character_file_service.dart'; | ||
export 'element_file_service.dart'; | ||
export 'furniture_file_service.dart'; | ||
export 'gadget_file_service.dart'; | ||
export 'material_file_service.dart'; | ||
export 'monster_file_service.dart'; | ||
export 'translation_file_service.dart'; | ||
export 'weapon_file_service.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class FurnitureFileService implements BaseFileService { | ||
FurnitureFileModel getDefaultFurnitureForNotifications(); | ||
|
||
FurnitureFileModel getFurniture(String key); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class GadgetFileService implements BaseFileService { | ||
List<GadgetFileModel> getAllGadgetsForNotifications(); | ||
|
||
GadgetFileModel getGadget(String key); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class MaterialFileService implements BaseFileService { | ||
List<MaterialCardModel> getAllMaterialsForCard(); | ||
|
||
MaterialCardModel getMaterialForCard(String key); | ||
|
||
MaterialFileModel getMaterial(String key); | ||
|
||
MaterialFileModel getMaterialByImage(String image); | ||
|
||
List<MaterialFileModel> getMaterials(MaterialType type, {bool onlyReadyToBeUsed = true}); | ||
|
||
MaterialFileModel getMoraMaterial(); | ||
|
||
String getMaterialImg(String key); | ||
|
||
List<MaterialFileModel> getAllMaterialsThatCanBeObtainedFromAnExpedition(); | ||
|
||
List<MaterialFileModel> getAllMaterialsThatHaveAFarmingRespawnDuration(); | ||
|
||
List<MaterialFileModel> getMaterialsFromAscensionMaterials( | ||
List<ItemAscensionMaterialFileModel> materials, { | ||
List<MaterialType> ignore = const [MaterialType.currency], | ||
}); | ||
|
||
List<MaterialFileModel> getCharacterAscensionMaterials(int day); | ||
|
||
List<MaterialFileModel> getWeaponAscensionMaterials(int day); | ||
|
||
MaterialFileModel getRealmCurrencyMaterial(); | ||
|
||
MaterialFileModel getPrimogemMaterial(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class MonsterFileService implements BaseFileService { | ||
MonsterFileModel getMonster(String key); | ||
|
||
List<MonsterCardModel> getAllMonstersForCard(); | ||
|
||
MonsterCardModel getMonsterForCard(String key); | ||
|
||
List<MonsterFileModel> getMonsters(MonsterType type); | ||
|
||
List<ItemCommon> getRelatedMonsterToMaterialForItems(String key); | ||
|
||
List<ItemCommon> getRelatedMonsterToArtifactForItems(String key); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
|
||
abstract class TranslationFileService { | ||
Future<void> init(AppLanguageType languageType); | ||
|
||
TranslationCharacterFile getCharacterTranslation(String key); | ||
|
||
TranslationWeaponFile getWeaponTranslation(String key); | ||
|
||
TranslationArtifactFile getArtifactTranslation(String key); | ||
|
||
TranslationMaterialFile getMaterialTranslation(String key); | ||
|
||
TranslationMonsterFile getMonsterTranslation(String key); | ||
|
||
TranslationElementFile getDebuffTranslation(String key); | ||
|
||
TranslationElementFile getReactionTranslation(String key); | ||
|
||
TranslationElementFile getResonanceTranslation(String key); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/base_file_service.dart'; | ||
|
||
abstract class WeaponFileService implements BaseFileService { | ||
List<WeaponCardModel> getWeaponsForCard(); | ||
|
||
WeaponCardModel getWeaponForCard(String key); | ||
|
||
WeaponFileModel getWeapon(String key); | ||
|
||
List<String> getUpcomingWeaponsKeys(); | ||
|
||
List<ItemCommon> getWeaponForItemsUsingMaterial(String key); | ||
|
||
List<TodayWeaponAscensionMaterialModel> getWeaponAscensionMaterials(int day); | ||
|
||
int countByStatType(StatType statType); | ||
|
||
List<ItemCommonWithName> getItemCommonWithNameByRarity(int rarity); | ||
|
||
List<ItemCommonWithName> getItemCommonWithNameByStatType(StatType statType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,47 @@ | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
import 'package:shiori/domain/models/models.dart'; | ||
import 'package:shiori/domain/services/file/file_infrastructure.dart'; | ||
|
||
abstract class GenshinService { | ||
ArtifactFileService get artifacts; | ||
|
||
BannerHistoryFileService get bannerHistory; | ||
|
||
CharacterFileService get characters; | ||
|
||
ElementFileService get elements; | ||
|
||
FurnitureFileService get furniture; | ||
|
||
GadgetFileService get gadgets; | ||
|
||
MaterialFileService get materials; | ||
|
||
MonsterFileService get monsters; | ||
|
||
WeaponFileService get weapons; | ||
|
||
TranslationFileService get translations; | ||
|
||
Future<void> init(AppLanguageType languageType); | ||
Future<void> initCharacters(); | ||
Future<void> initWeapons(); | ||
Future<void> initArtifacts(); | ||
Future<void> initMaterials(); | ||
Future<void> initElements(); | ||
Future<void> initMonsters(); | ||
Future<void> initGadgets(); | ||
Future<void> initFurniture(); | ||
Future<void> initBannerHistory(); | ||
Future<void> initTranslations(AppLanguageType languageType); | ||
|
||
List<CharacterCardModel> getCharactersForCard(); | ||
CharacterCardModel getCharacterForCard(String key); | ||
CharacterFileModel getCharacter(String key); | ||
List<TierListRowModel> getDefaultCharacterTierList(List<int> colors); | ||
List<String> getUpcomingCharactersKeys(); | ||
List<CharacterSkillStatModel> getCharacterSkillStats(List<CharacterFileSkillStatModel> skillStats, List<String> statsTranslations); | ||
|
||
List<WeaponCardModel> getWeaponsForCard(); | ||
WeaponCardModel getWeaponForCard(String key); | ||
WeaponFileModel getWeapon(String key); | ||
List<String> getUpcomingWeaponsKeys(); | ||
|
||
List<ArtifactCardModel> getArtifactsForCard({ArtifactType? type}); | ||
ArtifactCardModel getArtifactForCard(String key); | ||
ArtifactFileModel getArtifact(String key); | ||
|
||
List<ItemCommon> getCharacterForItemsUsingWeapon(String key); | ||
List<ItemCommon> getCharacterForItemsUsingArtifact(String key); | ||
List<ItemCommon> getCharacterForItemsUsingMaterial(String key); | ||
List<ItemCommon> getWeaponForItemsUsingMaterial(String key); | ||
List<ItemCommon> getRelatedMonsterToMaterialForItems(String key); | ||
List<ItemCommon> getRelatedMonsterToArtifactForItems(String key); | ||
|
||
TranslationArtifactFile getArtifactTranslation(String key); | ||
TranslationCharacterFile getCharacterTranslation(String key); | ||
TranslationWeaponFile getWeaponTranslation(String key); | ||
TranslationMaterialFile getMaterialTranslation(String key); | ||
TranslationMonsterFile getMonsterTranslation(String key); | ||
List<MaterialFileModel> getAllMaterialsThatCanBeObtainedFromAnExpedition(); | ||
List<MaterialFileModel> getAllMaterialsThatHaveAFarmingRespawnDuration(); | ||
|
||
List<TodayCharAscensionMaterialsModel> getCharacterAscensionMaterials(int day); | ||
List<TodayWeaponAscensionMaterialModel> getWeaponAscensionMaterials(int day); | ||
|
||
List<ElementCardModel> getElementDebuffs(); | ||
List<ElementReactionCardModel> getElementReactions(); | ||
List<ElementReactionCardModel> getElementResonances(); | ||
|
||
List<MaterialCardModel> getAllMaterialsForCard(); | ||
MaterialCardModel getMaterialForCard(String key); | ||
MaterialFileModel getMaterial(String key); | ||
MaterialFileModel getMaterialByImage(String image); | ||
List<MaterialFileModel> getMaterials(MaterialType type, {bool onlyReadyToBeUsed = true}); | ||
MaterialFileModel getMoraMaterial(); | ||
String getMaterialImg(String key); | ||
|
||
int getServerDay(AppServerResetTimeType type); | ||
|
||
DateTime getServerDate(AppServerResetTimeType type); | ||
|
||
Duration getDurationUntilServerResetDate(AppServerResetTimeType type); | ||
|
||
List<String> getUpcomingKeys(); | ||
|
||
MonsterFileModel getMonster(String key); | ||
List<MonsterCardModel> getAllMonstersForCard(); | ||
MonsterCardModel getMonsterForCard(String key); | ||
List<MonsterFileModel> getMonsters(MonsterType type); | ||
|
||
String getItemImageFromNotificationType(String itemKey, AppNotificationType notificationType, {AppNotificationItemType? notificationItemType}); | ||
String getItemImageFromNotificationItemType(String itemKey, AppNotificationItemType notificationItemType); | ||
|
||
List<GadgetFileModel> getAllGadgetsForNotifications(); | ||
GadgetFileModel getGadget(String key); | ||
|
||
FurnitureFileModel getDefaultFurnitureForNotifications(); | ||
FurnitureFileModel getFurniture(String key); | ||
String getItemImageFromNotificationItemType(String itemKey, AppNotificationItemType notificationItemType); | ||
|
||
DateTime getNextDateForWeeklyBoss(AppServerResetTimeType type); | ||
|
||
List<ArtifactCardBonusModel> getArtifactBonus(TranslationArtifactFile translation); | ||
List<String> getArtifactRelatedParts(String fullImagePath, String image, int bonus); | ||
String getArtifactRelatedPart(String fullImagePath, String image, int bonus, ArtifactType type); | ||
List<StatType> generateSubStatSummary(List<CustomBuildArtifactModel> artifacts); | ||
|
||
List<double> getBannerHistoryVersions(SortDirectionType type); | ||
List<BannerHistoryItemModel> getBannerHistory(BannerHistoryItemType type); | ||
List<BannerHistoryPeriodModel> getBanners(double version); | ||
List<ItemReleaseHistoryModel> getItemReleaseHistory(String itemKey); | ||
|
||
List<ChartTopItemModel> getTopCharts(ChartType type); | ||
List<ChartBirthdayMonthModel> getCharacterBirthdaysForCharts(); | ||
List<ChartElementItemModel> getElementsForCharts(double fromVersion, double untilVersion); | ||
List<ChartAscensionStatModel> getItemAscensionStatsForCharts(ItemType itemType); | ||
List<ChartCharacterRegionModel> getCharacterRegionsForCharts(); | ||
List<ChartGenderModel> getCharacterGendersForCharts(); | ||
ChartGenderModel getCharacterGendersByRegionForCharts(RegionType regionType); | ||
List<ItemCommonWithName> getCharactersForItemsByRegion(RegionType regionType); | ||
List<ItemCommonWithName> getCharactersForItemsByRegionAndGender(RegionType regionType, bool onlyFemales); | ||
|
||
List<CharacterBirthdayModel> getCharacterBirthdays({int? month, int? day}); | ||
List<ChartAscensionStatModel> getItemAscensionStatsForCharts(ItemType itemType); | ||
|
||
List<ItemCommonWithName> getItemsAscensionStats(StatType statType, ItemType itemType); | ||
} |