示例#1
0
        public async Task <IActionResult> GetGameServerLatestMatch([FromRoute] Guid gameServerPublicKey)
        {
            try
            {
                var latestMatch = await service.GetGameServerLatestMatch(gameServerPublicKey);

                if (latestMatch == null)
                {
                    return(Error(new ErrorResult
                    {
                        Classification = ErrorClassification.EntityNotFound,
                        Message = "Game server latest match not found"
                    }, HttpStatusCode.NotFound));
                }

                return(Ok(latestMatch));
            }
            catch (Exception)
            {
                return(Error(new ErrorResult
                {
                    Classification = ErrorClassification.InternalError,
                    Message = "Failed getting game server latest match"
                }));
            }
        }