Skip to content

Commit

Permalink
Refactor (more)
Browse files Browse the repository at this point in the history
  • Loading branch information
SapiensAnatis committed Aug 7, 2023
1 parent bc09f4b commit 41e827a
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DbDetailedPartyUnit

public DbWeaponBody? WeaponBodyData { get; set; }

public IEnumerable<DbAbilityCrest> CrestSlotType1CrestList { get; set; } =
public IEnumerable<DbAbilityCrest?> CrestSlotType1CrestList { get; set; } =
Enumerable.Empty<DbAbilityCrest>();

public IEnumerable<DbAbilityCrest?> CrestSlotType2CrestList { get; set; } =
Expand Down
330 changes: 0 additions & 330 deletions DragaliaAPI/Features/Dungeon/DungeonRecordController.cs

This file was deleted.

21 changes: 16 additions & 5 deletions DragaliaAPI/Features/Dungeon/Record/DungeonRecordController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace DragaliaAPI.Features.Dungeon.Record;
public class DungeonRecordController(
IDungeonRecordService dungeonRecordService,
IDungeonRecordDamageService dungeonRecordDamageService,
IDungeonRecordHelperService dungeonRecordHelperService,
IDungeonService dungeonService,
ITutorialService tutorialService,
IUpdateDataService updateDataService
) : DragaliaControllerBase
{
Expand All @@ -23,14 +23,20 @@ public async Task<DragaliaResult> Record(DungeonRecordRecordRequest request)
{
DungeonSession session = await dungeonService.FinishDungeon(request.dungeon_key);

await tutorialService.AddTutorialFlag(1022);

IngameResultData ingameResultData = await dungeonRecordService.GenerateIngameResultData(
request.dungeon_key,
request.play_record,
session
);

(
IEnumerable<UserSupportList> helperList,
IEnumerable<AtgenHelperDetailList> helperDetailList
) = await dungeonRecordHelperService.ProcessHelperDataSolo(session.SupportViewerId);

ingameResultData.helper_list = helperList;
ingameResultData.helper_detail_list = helperDetailList;

UpdateDataList updateDataList = await updateDataService.SaveChangesAsync();

DungeonRecordRecordData response =
Expand All @@ -53,14 +59,19 @@ public async Task<DragaliaResult> RecordMulti(DungeonRecordRecordMultiRequest re
{
DungeonSession session = await dungeonService.FinishDungeon(request.dungeon_key);

await tutorialService.AddTutorialFlag(1022);

IngameResultData ingameResultData = await dungeonRecordService.GenerateIngameResultData(
request.dungeon_key,
request.play_record,
session
);

(
IEnumerable<UserSupportList> helperList,
IEnumerable<AtgenHelperDetailList> helperDetailList
) = await dungeonRecordHelperService.ProcessHelperDataMulti();

ingameResultData.helper_list = helperList;
ingameResultData.helper_detail_list = helperDetailList;
ingameResultData.play_type = QuestPlayType.Multi;

UpdateDataList updateDataList = await updateDataService.SaveChangesAsync();
Expand Down
Loading

0 comments on commit 41e827a

Please sign in to comment.