public static PushfeedLog GetTopicPushFeedLog(int tid) { if (tid < 0) { return(null); } return(PushfeedLog.FindByID(tid)); }
public static int DeleteTopicPushFeedLog(int tid) { if (tid < 0) { return(-1); } //return Discuz.Data.DiscuzCloud.DeleteTopicPushFeedLog(tid); return(PushfeedLog.Delete(PushfeedLog._.ID == tid)); }
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)); }
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); }
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); }