示例#1
0
 public static PushfeedLog GetTopicPushFeedLog(int tid)
 {
     if (tid < 0)
     {
         return(null);
     }
     return(PushfeedLog.FindByID(tid));
 }
示例#2
0
 public static int DeleteTopicPushFeedLog(int tid)
 {
     if (tid < 0)
     {
         return(-1);
     }
     //return Discuz.Data.DiscuzCloud.DeleteTopicPushFeedLog(tid);
     return(PushfeedLog.Delete(PushfeedLog._.ID == tid));
 }
示例#3
0
 public static int CreateTopicPushFeedLog(PushfeedLog feedInfo)
 {
     //todo 这里的验证代码应该移到实体类的Valid方法里面
     if (feedInfo == null || feedInfo.ID < 0 || feedInfo.Uid < 0 || feedInfo.AuthorToken.Length < 16 || feedInfo.AuthorSecret.Length < 16)
     {
         return(-1);
     }
     return(PushfeedLog.Insert(feedInfo));
 }
示例#4
0
        public static bool DeletePushedFeedInDiscuzCloud(PushfeedLog feedInfo, string ip)
        {
            DiscuzCloudConfigInfo       config = DiscuzCloudConfigInfo.Current;
            List <DiscuzOAuthParameter> list   = new List <DiscuzOAuthParameter>();

            list.Add(new DiscuzOAuthParameter("client_ip", ip));
            list.Add(new DiscuzOAuthParameter("thread_id", feedInfo.ID.ToString()));
            DiscuzOAuth discuzOAuth = new DiscuzOAuth();
            string      postData    = "";
            string      oAuthUrl    = discuzOAuth.GetOAuthUrl(API_CONNECT_URL + "connect/feed/remove", "POST", config.Connectappid, config.Connectappkey, feedInfo.AuthorToken, feedInfo.AuthorSecret, "", "", list, out postData);

            Utils.GetHttpWebResponse(oAuthUrl, postData);
            return(true);
        }
示例#5
0
        private bool DeletePushedFeedInCloud(int tid)
        {
            if (tid < 0)
            {
                return(false);
            }
            PushfeedLog topicPushFeedLog = DiscuzCloud.GetTopicPushFeedLog(tid);

            if (topicPushFeedLog == null)
            {
                return(false);
            }
            bool flag = DiscuzCloud.DeletePushedFeedInDiscuzCloud(topicPushFeedLog, this.ip);

            if (flag)
            {
                DiscuzCloud.DeleteTopicPushFeedLog(tid);
            }
            return(true);
        }