Beispiel #1
0
        public async Task <IActionResult> GetServerTime()
        {
            return(await CProxy.UsingAsync(() =>
            {
                return Ok(new
                {
                    success = true,
                    message = "",

                    result = CUnixTime.LocalNow
                });
            }));
        }
Beispiel #2
0
        public async Task <IActionResult> GetAnalysis()
        {
            return(await CProxy.UsingAsync(() =>
            {
                var _result = __db_context.tb_lion_analysis
                              .OrderByDescending(w => w.SequenceNo)
                              .ToList();

                return Ok(new
                {
                    success = true,
                    message = "",

                    result = _result
                });
            }));
        }
Beispiel #3
0
        public async Task <IActionResult> GetVersion()
        {
            return(await CProxy.UsingAsync(() =>
            {
                if (__version == null)
                {
                    __version = new ProductInfo("Lion.WebApi", "v3.1.0", "WebApi Service for Lotto-Lion", ProductType.service);
                }

                return Ok(new
                {
                    success = true,
                    message = "",

                    result = __version
                });
            }));
        }
Beispiel #4
0
        public async Task <IActionResult> GetWinnersWithPage(int pageIndex, int pageRows)
        {
            return(await CProxy.UsingAsync(() =>
            {
                var _result = __db_context.tb_lion_winner
                              .OrderByDescending(w => w.SequenceNo)
                              .Skip((pageIndex - 1) * pageRows).Take(pageRows)
                              .ToList();

                return Ok(new
                {
                    success = true,
                    message = "",

                    result = _result
                });
            }));
        }
Beispiel #5
0
        public async Task <IActionResult> GetGuestToken()
        {
            return(await CProxy.UsingAsync(async() =>
            {
                return new OkObjectResult(new
                {
                    success = true,
                    message = "",

                    result = await __usermgr.GetEncodedJwt(
                        new ApplicationUser()
                    {
                        login_id = "guest",
                        mail_address = ""
                    },
                        new Claim("UserType", "Guest")
                        )
                });
            }));
        }