Ejemplo n.º 1
0
        public ResultJsonModel <User_Current> UserScoreInfo(UserIDRequest request)
        {
            ResultJsonModel <User_Current> result = new ResultJsonModel <User_Current>();
            var usermodel    = CacheForModelUser.Instance.GetUserInfo(request.UserId);
            var user_Current = StringHandle.Instance.CalculateScore(usermodel.UserScore.GetValueOrDefault());

            if (user_Current == null)
            {
                result.HttpCode = 300;
                result.Message  = Enum_Message.NoMoreDataMessage.Enum_GetString();
            }
            else
            {
                result.HttpCode = 200;
                result.Message  = Enum_Message.SuccessMessage.Enum_GetString();
                result.Model1   = user_Current;
            }
            return(result);
        }
Ejemplo n.º 2
0
 public ResultJsonModel <GetScoreResponse, GetScoreResponse, GetScoreResponse> GetClickScore(UserIDRequest request)
 {
     return(ScoreBiz.Instance.GetClickScore(request));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 获得未获取分数列表
        /// </summary>
        public ResultJsonModel <GetScoreResponse, GetScoreResponse, GetScoreResponse> GetClickScore(UserIDRequest request)
        {
            ResultJsonModel <GetScoreResponse, GetScoreResponse, GetScoreResponse> result = new ResultJsonModel <GetScoreResponse, GetScoreResponse, GetScoreResponse>();
            var scoreList = CacheForModelScore.Instance.ScoreList(request.UserId);

            scoreList = scoreList.Where(p => p.ScoreClick == false).ToList();
            var scoreEatList   = scoreList.Where(p => p.ScoreType == Enum_ScoreType.Eat.Enum_GetString()).ToList();
            var scoreSleepList = scoreList.Where(p => p.ScoreType == Enum_ScoreType.Sleep.Enum_GetString()).ToList();
            var scoreSportList = scoreList.Where(p => p.ScoreType == Enum_ScoreType.Sport.Enum_GetString()).ToList();

            result.HttpCode = 200;
            result.Message  = Enum_Message.SuccessMessage.Enum_GetString();
            if (scoreEatList.Count != 0)
            {
                GetScoreResponse scoreResponse = new GetScoreResponse(scoreEatList, Enum_ScoreType.Eat);
                result.Model1 = scoreResponse;
            }
            if (scoreSleepList.Count != 0)
            {
                GetScoreResponse scoreResponse = new GetScoreResponse(scoreSleepList, Enum_ScoreType.Sleep);
                result.Model2 = scoreResponse;
            }
            if (scoreSportList.Count != 0)
            {
                GetScoreResponse scoreResponse = new GetScoreResponse(scoreSportList, Enum_ScoreType.Sport);
                result.Model3 = scoreResponse;
            }
            return(result);
        }