Пример #1
0
        public IHttpActionResult PostCareerPath([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId  = Convert.ToString(value.user_id);
                string FirstId = Convert.ToString(value.first_id);

                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                VD.Run(FirstId, new VerifyFirstPath());

                UserDomain UD = new UserDomain();
                result = UD.FollowCareerPath(UserId, FirstId);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("User", "PostCareerPath", "api/user/path", "关注职业路径接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "关注失败,请重试";
                return(Json(result));
            }
        }
Пример #2
0
        public IHttpActionResult ChangeNickName([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId   = Convert.ToString(value.user_id);
                string NickName = Convert.ToString(value.nick_name);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());

                UserDomain UD = new UserDomain();
                result = UD.ChangeNickName(UserId, NickName);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("User", "ChangeNickName", "api/user/changename", "修改用户名", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "失败,请重试";
                return(Json(result));
            }
        }
Пример #3
0
        public IHttpActionResult PostReviewerVote([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId    = Convert.ToString(value.user_id);
                string modifyId  = Convert.ToString(value.modify_id);
                int    isSupport = Convert.ToInt32(value.is_support);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                VD.Run(modifyId, new VerifyModifyPath());

                UserDomain UD = new UserDomain();
                result = UD.ReviewerVote(UserId, modifyId, isSupport);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("User", "PostReviewerVote", "api/user/p/rvote", "Reviewer表决接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "失败,请重试";
                return(Json(result));
            }
        }
Пример #4
0
        public IHttpActionResult PostFavour([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId     = Convert.ToString(value.user_id);
                string TypeId     = Convert.ToString(value.type_id);
                int    favourType = Convert.ToInt32(value.favour_type);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                VD.Run(TypeId, InterfaceArray.DicVD[favourType]);

                UserDomain UD = new UserDomain();
                result = UD.Favour(UserId, TypeId, favourType);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("User", "PostFavour", "api/user/p/favour", "点赞接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "失败,请重试";
                return(Json(result));
            }
        }
Пример #5
0
        public IHttpActionResult ReadMsg([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string        UserId = Convert.ToString(value.user_id);
                List <string> msgIds = JsonConvert.DeserializeObject <List <string> >(Convert.ToString(value.msg_ids));

                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());

                MessageDomain MD = new MessageDomain();
                result = MD.ReadMsg(UserId, msgIds);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Message", "ReadMsg", "api/message/read", "阅读通知接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "请求失败,请重试";
                return(Json(result));
            }
        }
Пример #6
0
        public IHttpActionResult PostComment([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId   = Convert.ToString(value.user_id);
                string pathId   = Convert.ToString(value.path_id);
                string content  = Convert.ToString(value.content);
                int    pathType = Convert.ToInt32(value.path_type);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                VD.Run(pathId, InterfaceArray.DicVD[pathType]);

                UserDomain UD = new UserDomain();
                result = UD.PublishComment(UserId, pathId, content, pathType);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("User", "PostComment", "api/user/p/comment", "发表对职业路线的评论", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "评论失败,请重试";
                return(Json(result));
            }
        }
Пример #7
0
        public IHttpActionResult PublishQues([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId    = Convert.ToString(value.user_id);
                string Desc      = Convert.ToString(value.desc);
                string TopicName = Convert.ToString(value.topic_name);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());

                FeedDomain FD = new FeedDomain();
                result = FD.PublishQues(UserId, Desc, TopicName);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "PublishQues", "bus/feed/publishques", "问答-发起提问接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "提交失败,请重试";
                return(Json(result));
            }
        }
Пример #8
0
        public IHttpActionResult PostIsLogin([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId = Convert.ToString(value.user_id);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());

                LoginDomain LD = new LoginDomain();
                result = LD.IsLogin(UserId);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Login", "PostIsLogin", "api/login/status", "验证账号是否处在登陆中", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.msg    = "数据异常,请重试";
                result.time   = FunctionHelper.GetTimestamp();
                result.data   = false;
                return(Json(result));
            }
        }
Пример #9
0
        public IHttpActionResult Get(string user_id, string path_id, int cursor, int count)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(user_id, new VerifyUser());
                VD.Run(path_id, new VerifyFirstPath());

                PlanDomain PD = new PlanDomain();
                result = PD.GetPlanByPath(user_id, path_id, cursor, count);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Plan", "Get", "bus/plan/get", "根基规划id获取计划", "用户ID:" + user_id + "已经获取的卡片数量:" + cursor + ";本次请求的卡片数量:" + count + "计划头ID" + path_id, ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #10
0
        public IHttpActionResult PostPlan([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId  = Convert.ToString(value.user_id);
                int    IsShare = Convert.ToInt32(value.is_share);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                PlanHeaderModel planModel = JsonConvert.DeserializeObject <PlanHeaderModel>(Convert.ToString(value.plan_info));
                VD.Run(planModel.FIRST_PATH_ID, new VerifyFirstPath());

                PlanDomain PD = new PlanDomain();
                result = PD.PostPlan(UserId, IsShare, planModel);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Plan", "PostPlan", "bus/plan/post", "发布计划接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "发布失败,请重试";
                return(Json(result));
            }
        }
Пример #11
0
        public IHttpActionResult SharePlanCancel([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId = Convert.ToString(value.user_id);
                string PlanId = Convert.ToString(value.plan_id);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                VD.Run(PlanId, new VerifyPlanHead());

                PlanDomain PD = new PlanDomain();
                result = PD.SharePlanCancel(UserId, PlanId);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Plan", "SharePlanCancel", "bus/plan/sharecancel", "取消分享计划接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "取消失败,请重试";
                return(Json(result));
            }
        }
Пример #12
0
        public IHttpActionResult PostAduit([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                int    isPass = Convert.ToInt32(value.is_pass);
                int    isDel  = Convert.ToInt32(value.is_del);
                string UserId = Convert.ToString(value.user_id);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());

                List <string> firstId = JsonConvert.DeserializeObject <List <string> >(Convert.ToString(value.first_id));
                FeedDomain    FD      = new FeedDomain();
                result = FD.AuditPath(firstId, isPass, isDel, UserId);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "PostAduit", "bus/feed/aduit", "审批职业路径接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "审核失败,请重试";
                return(Json(result));
            }
        }
Пример #13
0
        public IHttpActionResult GetTabsInfo(string user_id)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(user_id, new VerifyUser());

                FeedDomain FD = new FeedDomain();
                result = FD.GetTabsInfo(user_id);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "GetTabsInfo", "bus/feed/gettabs", "下发用户个人页tab信息", $"用户ID:{user_id}", ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #14
0
        public IHttpActionResult GetDetailedPage(string user_id, string path_id)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                if (!string.IsNullOrEmpty(user_id))
                {
                    VD.Run(user_id, new VerifyUser());
                }
                VD.Run(path_id, new VerifyFirstPath());

                FeedDomain FD = new FeedDomain();
                result = FD.GetPathDetailedInfo(user_id, path_id);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "GetDetailedPage", "bus/feed/detailed", "获取职业路径详情页接口", "用户ID:" + user_id + ";职业路径ID:" + path_id, ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #15
0
        public IHttpActionResult GetFaqDtlById(string user_id, string faq_id)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(user_id, new VerifyUser());
                VD.Run(faq_id, new VerifyFaq());

                FeedDomain FD = new FeedDomain();
                result = FD.GetFaqDtlById(user_id, faq_id);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "GetTopicDtlById", "bus/feed/gettopicinfo", "根据话题ID获取话题的详细信息", $"用户ID:{user_id};问答ID:{faq_id};", ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #16
0
        public IHttpActionResult ShareContent([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId     = Convert.ToString(value.user_id);
                string ContentId  = Convert.ToString(value.content_id);
                string ToSharedId = Convert.ToString(value.to_shared_id);
                int    ShareType  = Convert.ToInt32(value.share_type);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                if (ShareType == 1)
                {
                    VD.Run(ContentId, new VerifyFirstPath());
                    VD.Run(ToSharedId, new VerifyFaq());
                }

                FeedDomain FD = new FeedDomain();
                result = FD.ShareContent(UserId, ContentId, ToSharedId, ShareType);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "ShareContent", "bus/feed/share", "分享接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "提交失败,请重试";
                return(Json(result));
            }
        }
Пример #17
0
        public IHttpActionResult GetModifyDetailedInfo(string user_id, string modify_id)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(user_id, new VerifyUser());
                VD.Run(modify_id, new VerifyModifyPath());

                FeedDomain FD = new FeedDomain();
                result = FD.GetModifyDetailedInfo(user_id, modify_id);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                string message = "用户ID:" + user_id + ";修改职业规划表ID:" + modify_id;
                FunctionHelper.SaveFailLog("Feed", "GetModifyDetailedInfo", "bus/feed/hmodif/detailed", "查询修改职业规划的详情页", message, ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #18
0
        public IHttpActionResult GetMessageInfo(string userid, int cursor, int count)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(userid, new VerifyUser());

                MessageDomain MD = new MessageDomain();
                result = MD.GetMessageInfo(userid, cursor, count);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Message", "GetMessageInfo", "api/message/getmsg", "获取用户收到的通知", $"用户ID:{userid};已下发数:{cursor};本次请求数:{count}", ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #19
0
        public IHttpActionResult GetHistortModify(string user_id, string path_id, int path_class, int cursor, int count)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(user_id, new VerifyUser());
                VD.Run(path_id, InterfaceArray.DicVD[path_class]);

                FeedDomain FD = new FeedDomain();
                result = FD.GetHistortModify(user_id, path_id, path_class, cursor, count);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                string message = "用户ID:" + user_id + ";职业规划ID:" + path_id + ";职业规划等级:" + path_class + ";已下发数:" + cursor + ";本次请求数:" + count;
                FunctionHelper.SaveFailLog("Feed", "GetHistortModify", "bus/feed/hmodify", "查询某一职业规划的历史修改记录", message, ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #20
0
        public IHttpActionResult GetPermission(string user_id)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                LoginDomain LD = new LoginDomain();
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(user_id, new VerifyUser());

                result = LD.GetRolePermission(user_id);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Login", "GetPermission", "api/login/per", "获取当前账号拥有的权限", "当前登录用户ID:" + user_id, ex.Message.ToString(), "POST");

                result.status = 0;
                result.msg    = "数据异常,请重试";
                result.time   = FunctionHelper.GetTimestamp();
                result.data   = new List <string>();
                return(Json(result));
            }
        }
Пример #21
0
        public IHttpActionResult PostModify([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string userId    = Convert.ToString(value.user_id);
                string pathId    = Convert.ToString(value.path_id);
                string content   = Convert.ToString(value.content);
                int    pathClass = Convert.ToInt32(value.path_class);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(userId, new VerifyUser());
                VD.Run(pathId, InterfaceArray.DicVD[pathClass]);

                FeedDomain FD = new FeedDomain();
                result = FD.ModifyPath(userId, pathId, pathClass, content);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "PostModify", "bus/feed/modify", "发起对某一级职业规划修改的接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #22
0
        public IHttpActionResult UpdateStatus([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId    = Convert.ToString(value.user_id);
                string PlanId    = Convert.ToString(value.plan_id);
                string PlanDtlId = Convert.ToString(value.plan_dtl_id);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                VD.Run(PlanId, new VerifyPlanHead());
                VD.Run(PlanDtlId, new VerifyPlanDetail());

                PlanDomain PD = new PlanDomain();
                result = PD.UpdateStatus(UserId, PlanId, PlanDtlId);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Plan", "UpdateStatus", "bus/plan/complete", "完成计划接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "请求失败,请重试";
                return(Json(result));
            }
        }
Пример #23
0
        public IHttpActionResult GetUnreadMessage(string userid)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(userid, new VerifyUser());

                MessageDomain MD = new MessageDomain();
                result = MD.UnreadMessage(userid);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Message", "GetUnreadMessage", "api/message/getunread", "获取用户未读通知数量", $"用户ID:{userid}", ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #24
0
        public IHttpActionResult PostReply([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId    = Convert.ToString(value.user_id);
                string commentId = Convert.ToString(value.comment_id);
                string replyId   = Convert.ToString(value.reply_id);
                string content   = Convert.ToString(value.content);
                string toUid     = Convert.ToString(value.to_uid);

                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                VD.Run(toUid, new VerifyUser());
                VD.Run(commentId, new VerifyComment());
                if (commentId != replyId)
                {
                    VD.Run(replyId, new VerifyReply());
                }

                //执行业务
                UserDomain UD = new UserDomain();
                result = UD.PublishReply(UserId, commentId, replyId, content, toUid);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("User", "PostReply", "api/user/p/reply", "发表对于评论下面的回复", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "回复失败,请重试";
                return(Json(result));
            }
        }
Пример #25
0
        public IHttpActionResult GetComment(string user_id, string id, int cursor, int count, int code)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(user_id, new VerifyUser());
                if (code == 1)
                {
                    VD.Run(id, new VerifyFirstPath());
                }
                if (code == 2)
                {
                    VD.Run(id, new VerifyComment());
                }
                if (code == 3)
                {
                    VD.Run(id, new VerifyReply());
                }

                FeedDomain FD = new FeedDomain();
                result = FD.GetComment(user_id, id, cursor, count, code);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "GetComment", "bus/feed/getcomment", "获取更多评论或回复", $"用户ID:{user_id};被评论对象的ID:{id};已获取:{cursor};本次获取:{count};评论类型{code}", ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }
Пример #26
0
        public IHttpActionResult UpdatePlan([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId  = Convert.ToString(value.user_id);
                int    IsShare = Convert.ToInt32(value.is_share);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());
                PlanHeaderModel planModel = JsonConvert.DeserializeObject <PlanHeaderModel>(Convert.ToString(value.plan_info));
                if (planModel.PLAN_DTL == null)
                {
                    throw new Exception("前台传的计划明细为空");
                }
                VD.Run(planModel.ID, new VerifyPlanHead());
                foreach (var item in planModel.PLAN_DTL.Where(x => !string.IsNullOrEmpty(x.PLAN_DTL_ID)).ToList())
                {
                    VD.Run(item.PLAN_DTL_ID, new VerifyPlanDetail());
                }

                PlanDomain PD = new PlanDomain();
                result = PD.UpdatePlan(UserId, IsShare, planModel);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Plan", "UpdatePlan", "bus/plan/update", "修改计划接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "修改失败,请重试";
                return(Json(result));
            }
        }
Пример #27
0
        public IHttpActionResult PostFeed([FromBody] dynamic value)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                string UserId = Convert.ToString(value.user_id);
                //数据校验
                RunVerify VD = new RunVerify();
                VD.Run(UserId, new VerifyUser());

                FeedPathFirstModel feedModel = JsonConvert.DeserializeObject <FeedPathFirstModel>(Convert.ToString(value.feed_info));
                if (!string.IsNullOrEmpty(feedModel.TOPIC_ID))
                {
                    VD.Run(feedModel.TOPIC_ID, new VerifyTopic());
                }
                if (!string.IsNullOrEmpty(feedModel.FAQ_ID))
                {
                    VD.Run(feedModel.FAQ_ID, new VerifyFaq());
                }

                FeedDomain FD = new FeedDomain();
                result = FD.PostPath(UserId, feedModel);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "PostFeed", "bus/feed/save", "发文接口", Convert.ToString(value), ex.Message.ToString(), "POST");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "提交失败,请重试";
                return(Json(result));
            }
        }
Пример #28
0
        public IHttpActionResult Get(string user_id, int cursor, int count, int status, string topic_id, string faq_id, string code)
        {
            RetJsonModel result = new RetJsonModel();

            try
            {
                //数据校验
                RunVerify VD = new RunVerify();
                if (!string.IsNullOrEmpty(user_id))
                {
                    VD.Run(user_id, new VerifyUser());
                }
                if (!string.IsNullOrEmpty(topic_id))
                {
                    VD.Run(topic_id, new VerifyTopic());
                }
                if (!string.IsNullOrEmpty(faq_id))
                {
                    VD.Run(faq_id, new VerifyFaq());
                }

                FeedDomain FD = new FeedDomain();
                result = FD.GetCardInfo(user_id, cursor, count, status, topic_id, faq_id, code);
                return(Json(result));
            }
            catch (Exception ex)
            {
                //记录失败日志
                FunctionHelper.SaveFailLog("Feed", "Get", "bus/feed/getfeed", "获取Feed信息", $"用户ID:{user_id};cursor:{cursor};count:{count};状态:{status};话题:{topic_id};问答:{faq_id};tab编码:{code}", ex.Message.ToString(), "GET");

                result.status = 0;
                result.time   = FunctionHelper.GetTimestamp();
                result.msg    = "数据异常,请重试";
                return(Json(result));
            }
        }