Exemple #1
0
        public ResponseContext <MyPublishMomentDetailType> MyPublishMomentDetail(Guid momentId, RequestHead head)
        {
            var moment = momentDao.GetMomentByMomentId(momentId);

            if (moment == null)
            {
                return(new ResponseContext <MyPublishMomentDetailType>(ErrCodeEnum.DataIsnotExist));
            }
            bool overCount = ApplyBuilder.IsOverCount(moment);
            var  userInfo  = uerInfoBiz.GetUserInfoByUid(moment.UId);

            return(new ResponseContext <MyPublishMomentDetailType>()
            {
                Data = new MyPublishMomentDetailType()
                {
                    MomentId = momentId,
                    State = moment.State,
                    ShareTitle = MomentContentBuilder.GetShareTitle(moment),
                    Address = moment.Address,
                    Latitude = moment.Latitude,
                    Longitude = moment.Longitude,
                    IsOffLine = moment.IsOffLine,
                    IsOverTime = MomentContentBuilder.IsOverTime(moment.StopTime),
                    ShareFlag = moment.State == MomentStateEnum.正常发布中,
                    VerifyStateDesc = MomentContentBuilder.VerifyStateMap(moment.State),
                    StateDesc = MomentContentBuilder.MomentStateMap(moment.State, moment.StopTime, overCount),
                    TextColor = MomentContentBuilder.TextColorMap(moment.State, moment.StopTime, overCount),
                    UserInfo = UserInfoBuilder.BuildUserInfo(userInfo, head),
                    ContentList = MomentContentBuilder.BuilderContent(moment, false),
                    ApplyList = ApplyBuilder.GetApplyList(momentId, false, head, moment.UId),
                    CheckList = ApplyBuilder.GetCheckDetails(moment, userInfo, head)
                }
            });
        }
Exemple #2
0
        public ResponseContext <ShareDetailResponse> ShareDetail(Guid momentId, RequestHead head)
        {
            var moment = momentDao.GetMomentByMomentId(momentId);

            if (moment == null)
            {
                return(new ResponseContext <ShareDetailResponse>(ErrCodeEnum.DataIsnotExist));
            }
            var userInfo = uerInfoBiz.GetUserInfoByUid(moment.UId);

            if (userInfo == null)
            {
                return(new ResponseContext <ShareDetailResponse>(ErrCodeEnum.DataIsnotExist));
            }
            var    applyInfo = applyInfoDao.GetByMomentIdAndUId(momentId, head.UId);
            bool   isApply   = applyInfo != null;
            bool   selfFlag  = moment.UId == head.UId;
            bool   overCount = ApplyBuilder.IsOverCount(moment);
            string btnText   = MomentContentBuilder.BtnTextMap(moment.State, moment.StopTime, isApply, selfFlag, overCount);
            string stateDesc = MomentContentBuilder.MomentStateMap(moment.State, moment.StopTime, overCount);

            return(new ResponseContext <ShareDetailResponse>()
            {
                Data = new ShareDetailResponse()
                {
                    MomentId = momentId,
                    ApplyId = isApply ? applyInfo.ApplyId : Guid.Empty,
                    ApplyFlag = isApply,
                    BtnText = btnText,
                    StateDesc = stateDesc,
                    ShareTitle = MomentContentBuilder.GetShareTitle(moment),
                    Address = moment.Address,
                    Latitude = moment.Latitude,
                    Longitude = moment.Longitude,
                    IsOffLine = moment.IsOffLine,
                    AskFlag = string.Equals(btnText, "申请参与"),
                    BtnVisable = !string.IsNullOrEmpty(btnText),
                    TextColor = MomentContentBuilder.TextColorMap(moment.State, moment.StopTime, overCount),
                    UserInfo = UserInfoBuilder.BuildUserInfo(userInfo, head),
                    ContentList = MomentContentBuilder.BuilderContent(moment, true),
                    ApplyList = ApplyBuilder.GetApplyList(momentId, true, head, moment.UId)
                }
            });
        }