コード例 #1
0
        public async Task <IActionResult> UpdateQuest(string id, [FromBody] AikaQuest quest)
        {
            AikaQuest updatedQuest = await _questDbAccess.GetQuestById(id);

            CopyValidQuestProperties(updatedQuest, quest);

            await this.SetModifiedData(_userManager, updatedQuest);

            if (updatedQuest.IsImplemented)
            {
                CompareResult result = await _implementationStatusComparer.CompareQuest(updatedQuest.Id, updatedQuest);

                if (result.CompareDifference != null && result.CompareDifference.Count > 0)
                {
                    updatedQuest.IsImplemented = false;
                }
            }

            await _questDbAccess.UpdateQuest(updatedQuest);

            // Timeline Entry
            await _timelineService.AddTimelineEntry(TimelineEvent.AikaQuestUpdated, updatedQuest.Id, updatedQuest.Name);

            return(Ok(updatedQuest));
        }
コード例 #2
0
        public async Task <IActionResult> CompareQuest(string questId)
        {
            CompareResult result = await _implementationStatusComparer.CompareQuest(questId);

            FormattedCompareResponse response = await BuildFormattedResponse(result);

            return(Ok(response));
        }