예제 #1
0
        public ResponseContext <AskMomentDetailResponse> AskMomentDetail(Guid applyId, RequestHead head)
        {
            var response  = new ResponseContext <AskMomentDetailResponse>();
            var applyInfo = applyInfoDao.GetByApplyId(applyId);

            if (applyInfo == null)
            {
                return(response);
            }
            var myUserInfo = uerInfoBiz.GetUserInfoByUid(applyInfo.MomentUId);
            var userInfo   = uerInfoBiz.GetUserInfoByUid(applyInfo.UId);
            var moment     = MomentBuilder.GetMoment(applyInfo.MomentId);

            if (myUserInfo == null || userInfo == null || moment == null)
            {
                return(response);
            }
            response.Data = new AskMomentDetailResponse()
            {
                ApplyState     = applyInfo.ApplyState,
                ApplyStateDesc = ApplyStateMap(applyInfo.ApplyState),
                IsOverTime     = MomentContentBuilder.IsOverTime(moment.StopTime),
                MomentId       = moment.MomentId,
                ShareTitle     = MomentContentBuilder.GetShareTitle(moment),
                Address        = moment.Address,
                Latitude       = moment.Latitude,
                Longitude      = moment.Longitude,
                IsOffLine      = moment.IsOffLine,
                TextColor      = ApplyBuilder.TextColorMap(applyInfo.ApplyState),
                UserInfo       = UserInfoBuilder.BuildUserInfo(userInfo, head),
                BtnVisable     = applyInfo.ApplyState == ApplyStateEnum.申请中,
                ApplyList      = ApplyBuilder.GetApplyDetails(applyInfo.ApplyId, head, true)
            };
            return(response);
        }
예제 #2
0
        public ResponseContext <ApplyMomentDetailResponse> ApplyMomentDetail(Guid applyId, RequestHead head)
        {
            var response  = new ResponseContext <ApplyMomentDetailResponse>();
            var applyInfo = applyInfoDao.GetByApplyId(applyId);

            if (applyInfo == null)
            {
                return(response);
            }
            var userInfo = uerInfoBiz.GetUserInfoByUid(applyInfo.MomentUId);
            var moment   = MomentBuilder.GetMoment(applyInfo.MomentId);

            if (userInfo == null || moment == null)
            {
                return(response);
            }
            string btnText = ApplyBuilder.BtnTextMap(applyInfo.ApplyState);

            response.Data = new ApplyMomentDetailResponse()
            {
                ApplyState     = applyInfo.ApplyState,
                ApplyStateDesc = ApplyStateMap(applyInfo.ApplyState),
                MomentId       = moment.MomentId,
                ShareTitle     = MomentContentBuilder.GetShareTitle(moment),
                BtnText        = btnText,
                Address        = moment.Address,
                Latitude       = moment.Latitude,
                Longitude      = moment.Longitude,
                IsOffLine      = moment.IsOffLine,
                NextAction     = ApplyBuilder.BtnActionMap(applyInfo.ApplyState),
                BtnVisable     = !string.IsNullOrEmpty(btnText),
                TextColor      = ApplyBuilder.TextColorMap(applyInfo.ApplyState),
                UserInfo       = UserInfoBuilder.BuildUserInfo(userInfo, head),
                ContentList    = MomentContentBuilder.BuilderContent2Contact(moment, userInfo, applyInfo.ApplyState == ApplyStateEnum.申请通过),
                ApplyList      = ApplyBuilder.GetApplyDetails(applyInfo.ApplyId, head, false)
            };
            return(response);
        }