Пример #1
0
        public async Task <IActionResult> Detail(int opportunityId)
        {
            try
            {
                var detailQueryResult = await _mediator.Send(new GetDetailQuery { OpportunityId = opportunityId });

                if (detailQueryResult == null)
                {
                    return(NotFound());
                }

                var response = new GetDetailResponse
                {
                    Opportunity = detailQueryResult.Opportunity,
                    Sectors     = detailQueryResult.Sectors,
                    JobRoles    = detailQueryResult.JobRoles,
                    Levels      = detailQueryResult.Levels,
                };

                return(Ok(response));
            }
            catch (Exception e)
            {
                _logger.LogError(e, $"Error attempting to get Detail result");
                return(new StatusCodeResult((int)HttpStatusCode.InternalServerError));
            }
        }
Пример #2
0
        public void GetDetailTest(string symbol)
        {
            GetDetailResponse result = client.GetDetailAsync(symbol).Result;
            string            strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }
Пример #3
0
    /// <summary>
    /// 获取排行榜详情
    /// </summary>
    /// <param name="form"></param>
    /// <param name="OnSucceed"></param>
    /// <param name="OnFail"></param>
    /// <returns></returns>
    public IEnumerator GetRankDetail(WWWForm form, Action <string> OnSucceed, Action <string> OnFail)
    {
        WWW www = new WWW(DetailURL, form);

        float responseTime = 0;

        while (!www.isDone && responseTime < TimeOut)
        {
            responseTime += Time.deltaTime;
            yield return(www);
        }

        string message = "";

        if (www.isDone)
        {
            GetDetailResponse response = JsonUtility.FromJson <GetDetailResponse>(www.text);
            if (response != null)
            {
                if (response.code == (int)CodeID.SUCCESS)
                {
                    MyDebug.LogGreen("Get Rank Detail Succeed!");
                    if (OnSucceed != null)
                    {
                        OnSucceed(response.data);
                    }
                    yield break;
                }
                else if (response.code == (int)CodeID.GAME_VERSION_ERROR)
                {
                    MyDebug.LogYellow("Get Rank Detail Fail:" + response.code);
                    message = LanguageController.Instance.GetLanguage("Text_20079");
                }
                else
                {
                    MyDebug.LogYellow("Get Rank Detail Fail:" + response.code);
                    message = LanguageController.Instance.GetLanguage("Text_20066");
                }
            }
            else
            {
                MyDebug.LogYellow("Get Rank Detail Fail: Message Is Not Response!");
                message = LanguageController.Instance.GetLanguage("Text_20066");
            }
        }
        else
        {
            MyDebug.LogYellow("Get Rank Detail Fail: Long Time!");
            message = LanguageController.Instance.GetLanguage("Text_20067");
        }

        if (OnFail != null)
        {
            OnFail(message);
        }
    }