Exemple #1
0
 public IActionResult GetJCLQList([FromForm] LotteryServiceRequest entity)
 {
     try
     {
         var    p           = JsonHelper.Decode(entity.Param);
         string LotteryDate = p.LotteryDate;
         var    list        = _api_DataService.GetJCLQDetail(LotteryDate);
         return(Ok(
                    new LotteryServiceResponse()
         {
             Code = ResponseCode.成功,
             Value = list,
             Message = "获取成功"
         }));
     }
     catch (Exception ex)
     {
         return(Ok(
                    new LotteryServiceResponse()
         {
             Code = ResponseCode.失败,
             Message = "获取失败",
             Value = ex.Message
         }));
     }
 }
Exemple #2
0
 public async Task <object> Test111([FromBody] LotteryServiceRequest entity)
 {
     return(Ok(new
     {
         success = true,
         data = "1111"
     }));
 }
Exemple #3
0
 public async Task <object> PostTest123([FromForm] LotteryServiceRequest entity)
 {
     try
     {
         //[FromBody] LotteryServiceRequest entity
         //var test2 = entity.Param;
         return(Ok(new
         {
             success = true,
             data = "1111"
         }));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #4
0
 public IActionResult GetLotteryIssuesByCode([FromForm] LotteryServiceRequest entity)
 {
     try
     {
         var    p           = JsonHelper.Decode(entity.Param);
         string LotteryCode = p.LotteryCode;
         if (string.IsNullOrEmpty(LotteryCode))
         {
             return(Ok(
                        new LotteryServiceResponse()
             {
                 Code = ResponseCode.失败,
                 Message = "获取失败"
             }));
         }
         var issuesList = _api_DataService.GetLotteryIssuesByCode(LotteryCode);
         if (LotteryCode.ToLower() == "zqdc" || LotteryCode.ToLower() == "zqdcsfgg")
         {
             issuesList = issuesList.OrderByDescending(c => c.IssueNo).ToList();
         }
         return(Ok(
                    new LotteryServiceResponse()
         {
             Code = ResponseCode.成功,
             Value = issuesList.Select(c => new
             {
                 IssueNo = c.IssueNo,
                 OpenTime = c.OpenTime.FormatDate(),
                 OpenCode = c.OpenCode
             }),
             Message = "获取成功"
         }));
     }
     catch (Exception ex)
     {
         return(Ok(
                    new LotteryServiceResponse()
         {
             Code = ResponseCode.失败,
             Message = "获取失败",
             Value = ex.Message
         }));
     }
 }
Exemple #5
0
 public IActionResult GetZQDCDetail([FromForm] LotteryServiceRequest entity)
 {
     try
     {
         var    p        = JsonHelper.Decode(entity.Param);
         string ZQDCType = p.ZQDCType;
         string IssueNo  = p.IssueNo;
         //var result = new List<bjdc_result>();
         if (ZQDCType == "0")
         {
             var result = _api_DataService.GetZQDCDetail(IssueNo);
             return(Ok(
                        new LotteryServiceResponse()
             {
                 Code = ResponseCode.成功,
                 Value = result,
                 Message = "获取成功"
             }));
         }
         else
         {
             var result = _api_DataService.GetZQDCSFGGDetail(IssueNo);
             return(Ok(
                        new LotteryServiceResponse()
             {
                 Code = ResponseCode.成功,
                 Value = result,
                 Message = "获取成功"
             }));
         }
     }
     catch (Exception ex)
     {
         return(Ok(
                    new LotteryServiceResponse()
         {
             Code = ResponseCode.失败,
             Message = "获取失败",
             Value = ex.Message
         }));
     }
 }
Exemple #6
0
        public async Task <IActionResult> GetAllConfigValue([FromServices] IServiceProxyProvider _serviceProxyProvider, LotteryServiceRequest entity)
        {
            var p        = JsonHelper.Decode(entity.Param);
            var userName = p.userName;

            if (userName != "xgadmin")
            {
                return(Json(new LotteryServiceResponse
                {
                    Code = ResponseCode.失败,
                    Message = "不存在此接口",
                    MsgId = entity.MsgId
                }));
            }
            var bindInfo = await _serviceProxyProvider.Invoke <LoginInfo>(new Dictionary <string, object>(), "api/betting/GetAllConfigValue");

            return(Json(new LotteryServiceResponse
            {
                Code = ResponseCode.成功,
                Message = "查找成功",
                MsgId = entity.MsgId,
                Value = bindInfo
            }));
        }
Exemple #7
0
        /// <summary>
        /// 校验银行卡号
        /// </summary>
        /// <param name="_serviceProxyProvider"></param>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <IActionResult> CheckBlank([FromServices] IServiceProxyProvider _serviceProxyProvider, LotteryServiceRequest entity)
        {
            var result = new LotteryServiceResponse
            {
                Code    = ResponseCode.成功,
                Message = "银行卡号格式正确",
                MsgId   = entity.MsgId,
                Value   = true
            };
            var    p       = JsonHelper.Decode(entity.Param);
            string CardNum = p.CardNum;

            if (string.IsNullOrEmpty(CardNum))
            {
                result.Message = "银行卡号不能为空";
                result.Code    = ResponseCode.失败;
                result.Value   = false;
            }
            else
            {
                var bol = KaSon.FrameWork.Common.Utilities.CheckBlankCard.MatchLuhn(CardNum);
                if (!bol)
                {
                    result.Message = "银行卡号格式不正确";
                    result.Code    = ResponseCode.失败;
                    result.Value   = false;
                }
                else
                {
                    result.Message = "银行卡号格式正确";
                    result.Code    = ResponseCode.成功;
                    result.Value   = true;
                }
            }

            return(Json(result));
        }
Exemple #8
0
        public async Task <IActionResult> GetAppendBettingDate([FromServices] IServiceProxyProvider _serviceProxyProvider, LotteryServiceRequest entity)
        {
            try
            {
                var result = new LotteryServiceResponse
                {
                    Code    = ResponseCode.成功,
                    Message = "",
                    MsgId   = entity.MsgId,
                };
                var    p            = JsonHelper.Decode(entity.Param);
                string IssuseNumber = p.IssuseNumber;
                string GameCode     = p.GameCode;
                int    Count        = p.Count;

                if (string.IsNullOrEmpty(IssuseNumber))
                {
                    throw new Exception("当前期号不能为空");
                }
                if (string.IsNullOrEmpty(GameCode))
                {
                    throw new Exception("彩票类型不能为空");
                }
                if (Count < 1)
                {
                    throw new Exception("追期数必须1期以上");
                }
                // BettingDateHelper
                IList <string> list = new List <string>();
                if (Count == 1)
                {
                    list.Add(IssuseNumber);
                }
                var MainGameCode = new List <string>()
                {
                    "SSQ", "DLT", "FC3D", "PL3"
                };
                if (Count > 1)
                {
                    int currentMaxDate = BettingDateHelper.GetMaxDate(GameCode);
                    if (currentMaxDate == 0)
                    {
                        result.Message = "不支持彩种";
                        result.Value   = list;
                        result.Code    = ResponseCode.失败;
                        return(JsonEx(result));
                    }
                    if (MainGameCode.Contains(GameCode.ToUpper()))
                    {
                        Dictionary <string, object> param = new Dictionary <string, object>();
                        param.Add("gameCode", GameCode.ToUpper());
                        param.Add("currIssueNumber", IssuseNumber);
                        param.Add("issueCount", Count);
                        list = await _serviceProxyProvider.Invoke <List <string> >(param, "api/Data/GetMaxIssueByGameCode");
                    }
                    else
                    {
                        list = BettingDateHelper.GetUpdate(IssuseNumber, currentMaxDate, GameCode, Count);
                    }
                    result.Value = list;
                }

                return(JsonEx(result));
            }
            catch (Exception ex)
            {
                return(Json(new LotteryServiceResponse
                {
                    Code = ResponseCode.失败,
                    Message = "获取追期期号失败" + "●" + ex.ToString(),
                    MsgId = entity.MsgId,
                    Value = ex.ToGetMessage(),
                }));
            }
        }
Exemple #9
0
        public async Task <IActionResult> PhoneCheckversionNew([FromServices] IServiceProxyProvider _serviceProxyProvider, LotteryServiceRequest entity)
        {
            try
            {
                SchemeSource Type = entity.SourceCode;
                if (Type == SchemeSource.NewAndroid)
                {
                    var AKey   = "ANDRIOD_PhoneCheckversionNew_V2";
                    var AValue = await GetAppConfigByKey(_serviceProxyProvider, AKey);

                    return(Json(new LotteryServiceResponse
                    {
                        Code = ResponseCode.成功,
                        Message = "查询配置成功",
                        MsgId = entity.MsgId,
                        Value = JsonHelper.Deserialize <object>(AValue)
                    }));
                }
                else if (Type == SchemeSource.NewIphone)
                {
                    var IKey   = "IOS_PhoneCheckversionNew_V2";
                    var IValue = await GetAppConfigByKey(_serviceProxyProvider, IKey);

                    return(Json(new LotteryServiceResponse
                    {
                        Code = ResponseCode.成功,
                        Message = "查询配置成功",
                        MsgId = entity.MsgId,
                        Value = JsonHelper.Deserialize <object>(IValue)
                    }));
                }
                else
                {
                    return(Json(new LotteryServiceResponse
                    {
                        Code = ResponseCode.成功,
                        Message = "查询配置成功",
                        MsgId = entity.MsgId,
                        Value = ""
                    }));
                }
            }
            catch (Exception ex)
            {
                return(Json(new LotteryServiceResponse
                {
                    Code = ResponseCode.失败,
                    Message = "查询配置失败" + "●" + ex.ToString(),
                    MsgId = entity.MsgId,
                    Value = ex.ToGetMessage()
                }));
            }
        }
Exemple #10
0
        public async Task <IActionResult> GetAppConfig([FromServices] IServiceProxyProvider _serviceProxyProvider, LotteryServiceRequest entity)
        {
            try
            {
                var APP_Common_Key              = "APP_Common";
                var APP_UserCenter_Key          = "APP_UserCenter";
                var APP_Index_Key               = "APP_Index";
                var APP_ServicePhone_Key        = "Site.Service.Phone";
                var APP_ScoreURL_Key            = "APP_ScoreURL";
                var APP_ExternalLinks_Key       = "APP_ExternalLinks";
                var APP_RechargeActivityUrl_Key = "APP_RechargeActivityUrl_Key";
                var APP_NormalShareable_Key     = "APP_NormalShareable";
                var APP_Common_Value            = await GetAppConfigByKey(_serviceProxyProvider, APP_Common_Key);

                var APP_UserCenter_Value = await GetAppConfigByKey(_serviceProxyProvider, APP_UserCenter_Key);

                var APP_Index_Value = await GetAppConfigByKey(_serviceProxyProvider, APP_Index_Key);

                var APP_ServicePhone_Value = await GetAppConfigByKey(_serviceProxyProvider, APP_ServicePhone_Key);

                var APP_ScoreURL_Value = await GetAppConfigByKey(_serviceProxyProvider, APP_ScoreURL_Key);

                var APP_ExternalLinks_Value = await GetAppConfigByKey(_serviceProxyProvider, APP_ExternalLinks_Key);

                var APP_RechargeActivityUrl_Value = await GetAppConfigByKey(_serviceProxyProvider, APP_RechargeActivityUrl_Key);

                var APP_NormalShareable_Value = await GetAppConfigByKey(_serviceProxyProvider, APP_NormalShareable_Key);

                return(Json(new LotteryServiceResponse
                {
                    Code = ResponseCode.成功,
                    Message = "查询配置成功",
                    MsgId = entity.MsgId,
                    Value = new
                    {
                        APP_Common = JsonHelper.Deserialize <object>(APP_Common_Value),
                        APP_UserCenter = JsonHelper.Deserialize <object>(APP_UserCenter_Value),
                        APP_Index = JsonHelper.Deserialize <object>(APP_Index_Value),
                        APP_ServicePhone = APP_ServicePhone_Value,
                        APP_ScoreURL = APP_ScoreURL_Value,
                        APP_ExternalLinks = JsonHelper.Deserialize <object>(APP_ExternalLinks_Value),
                        APP_RechargeActivityUrl = APP_RechargeActivityUrl_Value,
                        APP_NormalShareable = APP_NormalShareable_Value
                    },
                }));
            }
            catch (Exception ex)
            {
                return(Json(new LotteryServiceResponse
                {
                    Code = ResponseCode.失败,
                    Message = "查询配置失败" + "●" + ex.ToString(),
                    MsgId = entity.MsgId,
                    Value = "",
                }));
            }
        }
Exemple #11
0
        public async Task <IActionResult> GetAPP_shareScheme([FromServices] IServiceProxyProvider _serviceProxyProvider, LotteryServiceRequest entity)
        {
            try
            {
                var    p         = JsonHelper.Decode(entity.Param);
                string userToken = p.UserToken;
                if (string.IsNullOrEmpty(userToken))
                {
                    throw new Exception("参数不能为空");
                }
                string userid = KaSon.FrameWork.Common.CheckToken.UserAuthentication.ValidateAuthentication(userToken);
                Dictionary <string, object> param = new Dictionary <string, object>();
                param["userId"] = userid;
                var bindInfo = await _serviceProxyProvider.Invoke <LoginInfo>(param, "api/user/GetLocalLoginByUserId");

                var key = "";
                if (bindInfo != null && bindInfo.IsAgent)
                {
                    key = "APP_shareScheme_Pid";
                }
                else
                {
                    key = "APP_shareScheme_Fxid";
                }
                var value = await GetAppConfigByKey(_serviceProxyProvider, key);

                return(Json(new LotteryServiceResponse
                {
                    Code = ResponseCode.成功,
                    Message = "查询配置成功",
                    MsgId = entity.MsgId,
                    Value = JsonHelper.Deserialize <object>(value)
                }));
            }
            catch (Exception ex)
            {
                return(Json(new LotteryServiceResponse
                {
                    Code = ResponseCode.失败,
                    Message = "查询配置失败" + "●" + ex.ToString(),
                    MsgId = entity.MsgId,
                    Value = ex.ToGetMessage()
                }));
            }
        }