Beispiel #1
0
        public ActionResult MatchListGet(string matchDate)
        {
            ResponesJson jsonResp = new ResponesJson();

            try
            {
                if (matchDate.Length != 10)
                {
                    jsonResp.Success    = false;
                    jsonResp.ResultData = $"日期格式不對(yyyy-MM-dd) => {matchDate}";
                }
                var matchList = DataSave.MatchListGet(matchDate);
                jsonResp.Success    = true;
                jsonResp.ResultData = matchList;
            }
            catch (Exception ex)
            {
                jsonResp.ResultData = ex.Message;
                jsonResp.Success    = false;
            }
            return(Content(JsonConvert.SerializeObject(jsonResp)));
        }